python 中 MATLAB 的 lowpass() 函数的等效函数?

Equivalent function in python for MATLAB's lowpass() function?

我在 matlab 中有以下代码,将过滤器应用于 "data" 数据集。我想在 python.

中找到等效函数
epsilon = 8;
minpts = 12;
Normfreq = 0.0045;
Steepness = 0.9999;
StopbandAttenuation = 20;
filtered = lowpass(data, Normfreq, 'Steepness', Steepness, 'StopbandAttenuation', StopbandAttenuation);

Scipy 可能是最好的工具。您可以使用 scipy 的信号处理库。

从他们的docs,他们甚至提供 matlab 风格的滤波器设计。

Matlab-style IIR filter design

butter(N, Wn[, btype, analog, output, fs]) -Butterworth digital and analog filter design.

buttord(wp, ws, gpass, gstop[, analog, fs]) - Butterworth filter order selection.

cheby1(N, rp, Wn[, btype, analog, output, fs]) - Chebyshev type I digital and analog filter design.

cheb1ord(wp, ws, gpass, gstop[, analog, fs]) - Chebyshev type I filter order selection.

cheby2(N, rs, Wn[, btype, analog, output, fs])- Chebyshev type II digital and analog filter design.

cheb2ord(wp, ws, gpass, gstop[, analog, fs]) - Chebyshev type II filter order selection.

ellip(N, rp, rs, Wn[, btype, analog, output, fs])- Elliptic (Cauer) digital and analog filter design.

ellipord(wp, ws, gpass, gstop[, analog, fs])- Elliptic (Cauer) filter order selection.

bessel(N, Wn[, btype, analog, output, norm, fs]) - Bessel/Thomson digital and analog filter design.

iirnotch(w0, Q[, fs]) - Design second-order IIR notch digital filter.

iirpeak(w0, Q[, fs]) - Design second-order IIR peak (resonant) digital filter.

您可能想要使用 butterworth 过滤器,然后使用 lfilter 将过滤器应用于您的数据。

请参阅此 SO answer 以获得更详细的示例。