From: Leena on
I have a butterworth low pass filter of order 5, I am using "filtfilt" function to reduce the startup transient. it is working perfectly well. now I need to derive the transfer function for this implementation of this butterworth filter to integrrate the filter in C++ application. is it simlpy the (H(z)*H(1/z)) 10th order transfet function? I tried that and compared the output of each input sample with the output of the filtfilt function but they did not match. what am I missing? and can someone tell me what is the best way to implement it?

appreciate your help

thanks
From: R vdM on
"Leena " <rula.kiblawi(a)zimmer.com> wrote in message <heh00t$kak$1(a)fred.mathworks.com>...
> I have a butterworth low pass filter of order 5, I am using "filtfilt" function to reduce the startup transient. it is working perfectly well. now I need to derive the transfer function for this implementation of this butterworth filter to integrrate the filter in C++ application. is it simlpy the (H(z)*H(1/z)) 10th order transfet function? I tried that and compared the output of each input sample with the output of the filtfilt function but they did not match. what am I missing? and can someone tell me what is the best way to implement it?
>
> appreciate your help
>
> thanks

Hi,

Kind of the same problem do I have. I need to transfer the functionality of the Matlab's "filtfilt" and indirect its "filter" function to C. The "filtfilt" function puts in some initial states (zi) in the "filter" function leading to a reduce startup transient effects. Therefore the transfer-function is not simply (H(z)*H(1/z)) I guess. But it is unknown to me what is actually done with those zi parameters in the "filter" function.

So if there is somebody who can answer the first question of Leena, I hope that he/she can answer mine as well.

Thanks.
From: Leena on
I was able to implement it, if you refer to the filtfilt.m file in:
toolbox\signal\signal\
or simply type edit filtfilt.m . it will open the code behind the filtfilt function. it will show you how to estimate the initial conditions (IC's). keep in mind that this is a non-causal filter therefore, it is not possible to run it on line, you need the whole sequnce of samples before you can estimate IC's. also you have to be careful how you apply IC's. the best and simplest way is to use the direct-form II structure. you can refer to:
http://www.mathworks.com/access/helpdesk/help/toolbox/signal/f1-22616.html
to learn how to implement the filter.
good luck

"R vdM" <taaiesoepkip(a)hotmail.com> wrote in message <hej5pk$74l$1(a)fred.mathworks.com>...
> "Leena " <rula.kiblawi(a)zimmer.com> wrote in message <heh00t$kak$1(a)fred.mathworks.com>...
> > I have a butterworth low pass filter of order 5, I am using "filtfilt" function to reduce the startup transient. it is working perfectly well. now I need to derive the transfer function for this implementation of this butterworth filter to integrrate the filter in C++ application. is it simlpy the (H(z)*H(1/z)) 10th order transfet function? I tried that and compared the output of each input sample with the output of the filtfilt function but they did not match. what am I missing? and can someone tell me what is the best way to implement it?
> >
> > appreciate your help
> >
> > thanks
>
> Hi,
>
> Kind of the same problem do I have. I need to transfer the functionality of the Matlab's "filtfilt" and indirect its "filter" function to C. The "filtfilt" function puts in some initial states (zi) in the "filter" function leading to a reduce startup transient effects. Therefore the transfer-function is not simply (H(z)*H(1/z)) I guess. But it is unknown to me what is actually done with those zi parameters in the "filter" function.
>
> So if there is somebody who can answer the first question of Leena, I hope that he/she can answer mine as well.
>
> Thanks.