0

我在 python 中创建了一个低通巴特沃斯滤波器。有什么办法可以将截止频率降低到毫赫兹范围?甚至可能吗?下面是我使用的代码。

def butter_bandpass(cutoff_freq, fs, order=5):
   nyq = 0.5 * fs
   cutoff_freq = cutoff_freq / nyq
   b, a = butter(order, cutoff_freq, btype='low')
   w, h = freqz(b, a)
   return b, a

def butter_bandpass_filter(data, time, cutoff_freq, fs, flag, order=5):
   b, a = butter_bandpass(cutoff_freq, fs, order=order)
   #zi = lfilter_zi(b, a)
   y = lfilter(b, a, np.array(data))
   return y
4

1 回答 1

0

如果截止频率太小 Fs 的一小部分,则 5 阶滤波器将在数值上变得不稳定(舍入“错误”将产生 NaN)。尝试通过对数据进行极端下采样来降低采样率 Fs。

于 2018-07-26T19:10:02.043 回答