Lowpass vs bandpass filtering
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Otto Randolph
el 20 de Jun. de 2024
Respondida: Star Strider
el 20 de Jun. de 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 comentarios
Respuesta aceptada
Star Strider
el 20 de Jun. de 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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Digital Filter Design en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!