0
我有一个信号,想带通滤波器是:巴特沃斯滤波器x平移
def butter_bandpass_prep(lowcut, highcut, fs, order=5):
"""Butterworth bandpass auxilliary function."""
nyq = 0.5 * fs # Minimal frequency (nyquist criterion)
low = lowcut/nyq
high = highcut/nyq
b, a = butter(order, [low, high], btype='band')
return b, a
def butter_bandpass(src, lowcut, highcut, fs, order=5):
"""Butterworth bandpass filter."""
b, a = butter_bandpass_prep(lowcut, highcut, fs, order=order)
dst = lfilter(b, a, src)
return dst
然而,我的信号不会从零开始,这似乎为滤波后的信号x中转移到导致问题-方向。我怎样才能弥补这一点? 或者butterworth过滤器不是选择的过滤器?!
太棒了!那就是我需要的! 但是,我不明白为什么会有转变。你有链接哪个(至少基本上)解释发生了什么? – refle