Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: zero phase low pass filter - filtfilt and IFIR
Replies: 9   Last Post: May 15, 2013 4:25 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
stefano Mangione

Posts: 36
Registered: 9/12/09
Re: zero phase low pass filter - filtfilt and IFIR
Posted: Sep 12, 2009 10:34 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Look at the structure returned by design(). If it is a Direct-Form FIR, you can substitute the call

y=filter(h,data)

with

[y,y_tail]=filter(h.Numerator,1,data).

the group delay of this filter (hoping that the design is always linear-phase) is

gd = (numel(h.Numerator)-1)/2

Then you obtain the whole y by concatenating y and y_tail

y = [y,y_tail.']

and finally obtain an 'undelayed' filtered sequence by skipping the first gd samples:

y_nodelay = y(floor(gd)+(1:numel(data)))

Hope this is useful
Stefano
(A reader who understands DSP knows these are quirks and hacks)

"Hans " <temp1@gmx.com> wrote in message <h8g666$9c9$1@fred.mathworks.com>...
> What I mean, is that I don't want to have the filtered time series been delayed too much. I tried IFIR as well as Butterworth and found a big time shift in the result.
> So I continued searching and found "filtfilt" which should avoid this, but can't deal with filter operator from design, as it seems to me.
>
> Hans




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.