2017-10-18 126 views
1

這是我第一次使用scipy.signal庫,並且正在用方法filtfilt()試驗一個錯誤。Scipy.signal方法'filtfilt()'無法正確識別

這是我試圖執行代碼:

Fs = 1000 
# s is an array of numbers 
a=signal.firwin(10, cutoff=0.5/(Fs/2)) 

ss = s - np.mean(s) 
se = signal.filtfilt(a, 1, ss, method="gust") 

當我執行這個代碼中,我得到了一個錯誤:

TypeError: filtfilt() got an unexpected keyword argument 'method' 

但這種方法的文件中清楚地顯示參數'方法'存在。

可能是什麼問題?

+0

爲什麼不接受答案?它沒有解決你的問題嗎? – desertnaut

回答

2

我想你有不同版本的scipy在使用。 filtfilt的文檔說在0.16中添加了「陣風」方法。我假設方法參數在早期版本中不存在。

+0

的確:https://docs.scipy.org/doc/scipy-0.15.0/reference/generated/scipy.signal.filtfilt.html – desertnaut