Lowpass vs bandpass filtering
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Otto Randolph
am 20 Jun. 2024
Beantwortet: Star Strider
am 20 Jun. 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
0 Kommentare
Akzeptierte Antwort
Star Strider
am 20 Jun. 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.
.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Filter Design finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!