Why does filtfilt provide me wrong results?

2 visualizaciones (últimos 30 días)
pietro
pietro el 8 de Feb. de 2015
Comentada: pietro el 19 de Mzo. de 2015
Hi all,
I'm using filtfilt function to filter some signals since i would like to minimize the phase lag between the original signal and the filtered one.
Here my code:
LPsig= designfilt('lowpassiir','FilterOrder',10,'PassbandFrequency',1,'PassbandRipple',0.2, ...
'SampleRate',Fs);
dfCoeff=double(LPsig);
FilteredSignalP=filtfilt(dfCoeff.Coefficients,1,Signal);
In this plot the filtered and non filtered signal are compared: http://s9.postimg.org/46qlzkz67/Immagine.jpg
There is the edge effect with a huge ripple. I found out that both effect are increased with the filter order, with a filter order of 10 both of them are negligeble. Could someone explain to me why? Anytime I have to filter data, I change almost randomly the filter parameter (filter order, filter type, passband ripple, etc) until I get a good result. How may I select the filter parameters?
Thanks
Regards
Pietro

Respuestas (1)

Erik S.
Erik S. el 8 de Feb. de 2015
Why do you write dfCoeff = double(LPsig);
Everything is double precision already.
Call the filter function like
FilteredSignal = filtfilt(LPsig,Signal);
  3 comentarios
Erik S.
Erik S. el 9 de Feb. de 2015
Can you send the data you want to filter? Do you know which answer to get from the filter?
pietro
pietro el 19 de Mzo. de 2015
Hi Erik, I'm sorry for the delayed reply, I was convinced I had the email notification turned on. I will send you the data this evening, because I have limited internet connection at my workplace.

Iniciar sesión para comentar.

Categorías

Más información sobre Single-Rate Filters en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by