filter_sois (1)

IIR filter implementation through a cascad of second order sections.


Prototype

sptr<FilterGen<T>> filter_sois(const FRat<cfloat> &h, RIIStructure structure=FormeDirecte2)

Parameters

hTransfert function.
structureRIIStructure::FormeDirecte1 or RIIStructure::FormeDirecte2 (see notes below)

Returns

real to real filter.

Description

The given transfert function is factored into a cascad of second order sections, and eventually a first order section if the whole filter order is odd, enabling an efficient implementation of a IIR filter:

\[ H(z) = G\cdot\prod_{i=1}^{M} H_i(z) = G\cdot\prod_{i=1}^{M} \frac{1 + b_1^{(i)} z^{-1} + b_2^{(i)} z^{-2} }{1 - a_1^{(i)} z^{-1} - a_2^{(i)} z^{-2}} \]

The direct form II is a little more efficient than the form I. However, if the coefficients are to be reloaded while the filter is in use, the form II can generate discontinuities, which is not the case with the first form.

Warning
It is highly recommanded that the given transfert function is specified by its roots and poles rather by its coefficients, because in the latter case, the poles and zeros locations (and hence the frequency response) may be very unstable (high sensitivity to troncating errors). Note that the function design_iira() returns a correct tranfert function (zeros & poles).

See also

filter_iir(), design_iira()