def butter_bandstop_filter(data, lowcut, highcut, fs, order):
from scipy.signal import butter, lfilter
nyq = 0.5 * fs
low = lowcut / nyq
high = highcut / nyq
b, a = butter(order, [low, high], btype='bandstop')
y = lfilter(b, a, data)
return y
评论列表
文章目录