简体   繁体   English

MATLAB 的 lowpass() function 的 python 中的等效 function?

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

I have the following code in matlab that applies a filter to the "data" dataset.我在 matlab 中有以下代码,它将过滤器应用于“数据”数据集。 I would like to find the equivalent function in python.我想在 python 中找到等效的 function。

epsilon = 8;
minpts = 12;
Normfreq = 0.0045;
Steepness = 0.9999;
StopbandAttenuation = 20;
filtered = lowpass(data, Normfreq, 'Steepness', Steepness, 'StopbandAttenuation', StopbandAttenuation);

Scipy is probably the best tool for this. Scipy 可能是最好的工具。 You can use scipy's signal processing libraries.您可以使用 scipy 的信号处理库。

From their docs , they even offer matlab style filter desing.从他们的文档中,他们甚至提供了 matlab 风格的滤波器设计。

Matlab-style IIR filter design Matlab 风格的 IIR 滤波器设计

butter(N, Wn[, btype, analog, output, fs]) -Butterworth digital and analog filter design.黄油(N,Wn[,btype,模拟,output,fs])-巴特沃斯数字和模拟滤波器设计。

buttord(wp, ws, gpass, gstop[, analog, fs]) - Butterworth filter order selection. buttord(wp, ws, gpass, gstop[, analog, fs]) - 巴特沃斯滤波器阶数选择。

cheby1(N, rp, Wn[, btype, analog, output, fs]) - Chebyshev type I digital and analog filter design. cheby1(N, rp, Wn[, btype, analog, output, fs]) - Chebyshev I 型数字和模拟滤波器设计。

cheb1ord(wp, ws, gpass, gstop[, analog, fs]) - Chebyshev type I filter order selection. cheb1ord(wp, ws, gpass, gstop[, analog, fs]) - Chebyshev I 型滤波器阶数选择。

cheby2(N, rs, Wn[, btype, analog, output, fs])- Chebyshev type II digital and analog filter design. cheby2(N, rs, Wn[, btype, analog, output, fs])- Chebyshev II 型数字和模拟滤波器设计。

cheb2ord(wp, ws, gpass, gstop[, analog, fs]) - Chebyshev type II filter order selection. cheb2ord(wp, ws, gpass, gstop[, analog, fs]) - Chebyshev II 型滤波器阶数选择。

ellip(N, rp, rs, Wn[, btype, analog, output, fs])- Elliptic (Cauer) digital and analog filter design. ellip(N, rp, rs, Wn[, btype, analog, output, fs])- 椭圆 (Cauer) 数字和模拟滤波器设计。

ellipord(wp, ws, gpass, gstop[, analog, fs])- Elliptic (Cauer) filter order selection. ellipord(wp, ws, gpass, gstop[, analog, fs]) - 椭圆 (Cauer) 滤波器阶数选择。

bessel(N, Wn[, btype, analog, output, norm, fs]) - Bessel/Thomson digital and analog filter design. bessel(N, Wn[, btype, analog, output, norm, fs]) - Bessel/Thomson 数字和模拟滤波器设计。

iirnotch(w0, Q[, fs]) - Design second-order IIR notch digital filter. iirnotch(w0, Q[, fs]) - 设计二阶 IIR 陷波数字滤波器。

iirpeak(w0, Q[, fs]) - Design second-order IIR peak (resonant) digital filter. iirpeak(w0, Q[, fs]) - 设计二阶 IIR 峰值(谐振)数字滤波器。

You'd probably want to use a butterworth filter and then use the lfilter to apply the filter to your data.您可能希望使用一个butterworth过滤器,然后使用lfilter将过滤器应用于您的数据。

Ref to this SO answer for a more in-depht example.有关更深入的示例,请参阅此SO 答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM