在SciPy中创建低通滤波器-了解方法和单位
我正在尝试使用python过滤嘈杂的心率信号。因为心率永远不应该超过每分钟220次跳动,所以我想过滤掉所有220 bpm以上的噪音。我将220 /分钟转换为3.66666666赫兹,然后将该赫兹转换为rad / s,以获得23.0383461 rad / sec。 采集数据的芯片的采样频率为30Hz,因此我将其转换为rad / s以获得188.495559 rad / s。 在网上查找了一些东西之后,我发现了一些我想做成低通的带通滤波器的功能。这是带通代码的链接,所以我将其转换为: from scipy.signal import butter, lfilter from scipy.signal import freqs def butter_lowpass(cutOff, fs, order=5): nyq = 0.5 * fs normalCutoff = cutOff / nyq b, a = butter(order, normalCutoff, btype='low', analog = True) return b, a …