实施scipy butterworth过滤器

时间:2016-10-06 00:50:09

标签: filter scipy

我正在尝试通过butterworth过滤器运行一系列数据样本。以200个样品/秒的采样率拍摄样品。我想要一个20-40赫兹之间的乐队通行证。我使用fs = 200,因为采样率但我在所有频率都得到衰减,并且没有看到" passband"是一个" 0db"通过 - 我在所有频率上统一了-20db

def butter_bandpass(lowcut, highcut, fs, order =4):
    nyq = 0.5 * fs
    low = lowcut/nyq
    high = highcut/nyq
    b, a = butter(order, [low, high], btype='band')
    return b, a

def butter_bandpass_filter(data, lowcut, highcut, fs, order = 4):
    b, a= butter_bandpass(lowcut, highcut, fs, order = order)
    y = lfilter(b,a,data)
    return y

fs = 200.00
lowcut = 20.0
highcut = 40.0

x = Signal_X_Col 
y = butter_bandpass_filter(x, lowcut, highcut, fs, order = 4 )

0 个答案:

没有答案