DSPRelated.com
Forums

How does Matlab implement the [y z] = filter(b,a,X,zi) function?

Started by niko_vloeberghs June 22, 2007
Hi...
I am trying to convert a Matlab script to C++ involving the filter.m
function. It is said in the Matlab doc that this function is
implemented using the Direct Form II transposed structure, but when I
implement this directly as it is, it gives results which are not as
close as usual with the Matlab output, that is several magnitudes of
order difference compared to machine precision.

For instance, using a particular filter definition (from WLAN TGn
channel model), I get an absolute error in the order of 1e-8, even for
short input sequences. I'm more used to achieving errors of <1e-14.

So my question is: does anyone know how Matlab implements this
function? Are there any tricks to improve the accuracy of IIR filters?

Thanks for your thoughts on this!

Niko