Effacer les filtres
Effacer les filtres

Lowpass vs bandpass filtering

8 vues (au cours des 30 derniers jours)
Otto Randolph
Otto Randolph le 20 Juin 2024
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

Réponses (1)

Star Strider
Star Strider le 20 Juin 2024
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.
.

Community Treasure Hunt

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

Start Hunting!

Translated by