IIR Filtering Class Functions and Coefficient design

(Asouth) #1


Id like to propose that the constructir for the OnlineIirFilter class is overloaded to allow coefficients to be specified as two arrays, one for the numerator and one for the denominator.

For example:

OnlineIirFilter octavebandfilter = new OnlineIirFilter(b,a);

Also i believe there a crippling bug with IIR implementation, IirCoefficients class seems to produce non-stable coefficients. Has anyone else tried this?


(Tobias Glaubach) #2

regarding the constructor: I strongly support your proposal.

regarding the non stability of the IIR coefficients:

  1. The source code comments state, that the implementation is based on the canoic Direct Form II structure. See here:
    Which is described here:
    Every direct implemengtation (especially for high order filters) is numerically sensitive to roundoff errors on the coefficients (see last point on properties in the upper link). More stable would be to use a series of second order filters structure. See here:

  2. Did you consider, that you are working with discrete time (or digital) systemes here? Stability is given by poles within a unit circle in the complex plane, as opposed to left half plane for continuous time systems. You can check the poles of your filter by using the Polynomial.GetRoots() method from MathNet (not sure, if in latest release yet though)