Lowpass vs bandpass filtering

12 次查看(过去 30 天)
I'm having troubles using the lowpass filter. Here is the code I use.
Yacc=lowpass(Yacc,high,fs);
I set the filter to 100 Hz and looking at the power spectrum graph the filter doesn't kick in until well over 2kHz.
I don't have this problem using a bandpass filter. I use this code.
Yacc = bandpass(Yacc,[low high],fs);
Filtering from 10 to 100 Hz gives me this power spectrum graph.
Can someone explain what I'm doing wrong

采纳的回答

Star Strider
Star Strider 2024-6-20
The functions may by default design a FIR filter, and FIR filters have problems with some signals, since the FIR filter order may be dictated by the length of the signal. I generally force these functions to design an IIR filter by specifying the name-value pair 'ImpulseResponse','iir'.
Try this instead —
Yacc = lowpass(Yacc,high,fs,'ImpulseResponse','iir');
Yacc = bandpass(Yacc,[low high],fs,'ImpulseResponse','iir');
Those should design very efficient ellipic filters.
Both functions have a second output, that being the digital filter object itself that you can then use in other instances in your code, rather than designing the filter again each time you call the function. Use the digital filter objects with the filtfilt function for best results.
.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Filter Design 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by