小编Chr*_*isG的帖子

Python高通滤波器

我使用以下代码在python中实现了高通滤波器:

from scipy.signal import butter, filtfilt
import numpy as np

def butter_highpass(cutoff, fs, order=5):
    nyq = 0.5 * fs
    normal_cutoff = cutoff / nyq
    b, a = butter(order, normal_cutoff, btype='high', analog=False)
    return b, a

def butter_highpass_filter(data, cutoff, fs, order=5):
    b, a = butter_highpass(cutoff, fs, order=order)
    y = filtfilt(b, a, data)
    return y

rawdata = np.loadtxt('sampleSignal.txt', skiprows=0)
signal = rawdata
fs = 100000.0

cutoff = 100
order = 6
conditioned_signal = butter_highpass_filter(signal, cutoff, fs, order)
Run Code Online (Sandbox Code Playgroud)

我在100 kHz电压信号上应用此滤波器,它对于> = 60 Hz的截止频率工作正常.但它在下面不起作用.我想切断低于10赫兹的所有频率.我的错误是什么提示?我观察到的是滤波器的阶数越低,截止频率就越低.

样本信号可以在这里找到.

python signal-processing

7
推荐指数
2
解决办法
3万
查看次数

标签 统计

python ×1

signal-processing ×1