필터 지우기
필터 지우기

Extraction of filter used in filtfilt

조회 수: 7 (최근 30일)
Riccardo Sorvillo
Riccardo Sorvillo 2020년 5월 15일
댓글: Paul 2023년 4월 14일
Hello world!
I hope that my question is not trivial, but I am stuck on this.
I am filtering accelerometer signal with a Butterworth digital filter, say order 2 lowpass. In order to eliminate phase delays, I chose function filtfilt to apply the filter to the data. According to its documentation (see here), this function guarantees zero-phase distortion applying the filter in both forward and inverse direction, thus resulting in a filter with:
  • transfer function equal to the squared magnitude of the original filter transfer function;
  • order that is double the order of the filter specified by b and a.
I would like to visualize the transfer function of this resulting filter: is it possibile to extract the magnitude and phase behaviour of the filter applied by filtfilt?
For magnitude it would be enough (I guess) to square it, but how to take into account the doubled order? My code up to now reads:
[Num, Den] = butter(2,100/1e5,'low'); % to create filter
dataflt = filtfilt(Num,Den,data); % to filter data
Dflt = freqz(num2,den2);
figure
subplot(2,1,1)
plot(f,mag2db(abs(Dflt).^2));
subplot(2,1,2)
plot(f,unwrap(angle(Dflt)));
Thank you in advance for your help.

답변 (1개)

Ryan Gellner
Ryan Gellner 2023년 4월 13일
I have the same question, and was disappointed to see no one had attempted an answer to this one. I believe you are spot on with squaring the magnitudes, but don't know if there is more to it. Thanks for sharing what you've done so far.
  댓글 수: 3
Ryan Gellner
Ryan Gellner 2023년 4월 14일
Thanks Paul for your response. So I take it that the magnitude is "close" to the magnitude squared and the phase response is "close" to zero as a result of using filtfilt - is that correct?
Paul
Paul 2023년 4월 14일
I said the magnitude is probably close to the magnitude squared of the filter. "Probably" in the sense that there may be inputs where it really isn't. I didn't say anything about the phase being close to zero. I updated the post in the linked question in my Answer to illustrate. Please take a look and comment/answer if you feel appropriate.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Digital Filtering에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by