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