Search All of the Math Forum:

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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

 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

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

Date Subject Author
9/12/09 hans
9/12/09 stefano Mangione
9/12/09 hans
9/12/09 stefano Mangione
9/12/09 hans
12/13/09 Yow Cheong Kok
12/13/09 Wayne King
12/18/09 Yow Cheong Kok
12/20/09 Yow Cheong Kok
5/15/13 Fernan