2019年10月13日
近日在学习小波变换,把学习的链接贴在下面供大家查阅,之后再自己总结总结笔记看看有哪些点需要注意。
1.小波变换完美通俗讲解系列之 (一)
2.小波变换完美通俗讲解系列之 (二)
3.小波变换完美通俗讲解系列之 (三)
2019年10月27日
小波变换我觉得大家可以放放。。
真的挺难的,我最近是在想要不然就看看别人的代码调參,实用主义来了~
不过这里放一个基础的东西。关于FFT的一些细节和专业的英语词汇方便大家将中文和英文对照起来。
FFT Zero Padding
2019年10月28日
记scipy.interpolate.interp1d的使用
scipy.interpolate.interp1d (x, y, kind=‘linear’, axis=-1, copy=True, bounds_error=None, fill_value=nan, assume_sorted=False)`
api中对于参数y
有这么一句话:
A N-D array of real values. The length of y along the interpolation axis must be equal to the length of x.
想破脑子都不知所谓的interpolation是什么意思,但是看别人的代码,发现了这么一个问题。(sig是读取的音频)
interpolator = interpolate.interp1d(time_old, sig.T)
sig.shape
Out[37]: (1321623, 2)
time_old.shape
Out[38]: (1321623,)
自然而然的,为什么需要转置?
所以interpolation axis 到底是哪个维度呢?剧透:不转置是不行滴~~
那么怎么理解呢?
我写了如下的代码
from scipy import interpolate
import numpy as np
from matplotlib import pyplot as plt
x = np.linspace(0,10,num=1000)
y1 = np.cos(x*2*3.14)
y2 = np.sin(x*2*3.14+1)
y = np.array([y1,y2])
然后我们来看看的y1
、y2
、y
的大小
y1.shape
Out[40]: (1000,)
y2.shape
Out[41]: (1000,)
y.shape
Out[42]: (2, 1000)
y[0].shape
Out[43]: (1000,)
y[1].shape
Out[44]: (1000,)
现在是不是清楚了呢?问题的根源在于我们对于numpy array的不够彻底。
插值,只能一个一个信号的进行插取。
对于多维的信号,要由第一个图分解成两个这样的图
OVER