18.3.2 Algorithms (IIR Filters)
IIR (Infinite Impulse Response) filter is a digital filter with feedback, as showing in the following picture.
Digital filter is also often described in the difference equation form, which defines the relationship between output signal and input signal.
where , N is the feedforward filter order, is the feedforward filter coefficient, M is the feedback filter order, is the feedback coefficient, x(n) is the input signal, and y(n) is the output signal. The term is the feedback.
Digital Filter Representation
In Origin, there are four outputs for representation of IIR filter.
- Transfer Function
The transfer function of IIR filter is represented in the z-domain by the ratio of two polynomials of complex . To find the transfer function of the IIR filter, rearrange the above equation as:
The z-transform is represented as:
Take the z-transform of each side of the filter equation, then get
The transfer function of IIR filter in the z-domain represents:
As the transfer function shows above, the numerator is for the location of zeros, and the denominator for the poles. Then the transfer function can be rewritten as zero-pole-gain form.
where k is the gain, and are the zeros and poles of the transfer function, respectively.
The state-space representation for the filter system can be defined as:
where u(n) is the input, x(n) is the state vector, y(n) is the output, A is an m-by-m matrix, m is the filter order, B is a column vector, C is row vector, and D is a scalar.
- Second Order Section (SOS)
The equivalent second order section representation of the digital filter transfer function is written as:
where g is the gain, are the numerator coefficients, and are the denominator coefficients. If the filter order m is even, , if m is odd, . And SOS can be represented as the following L-by-6 matrix.
How to Design IIR Filter
The typical procedure to design IIR filter is:
- Specify filter specification.
- Specify low pass analog filter prototype, and the available prototypes supported in Origin include Butterworth, Chebyshev Type I, Chebyshev Type II, and Elliptic.
||Squared Magnitude Response Function
||Analog Filter Transfer Function
|Chebyshev Type I
|Chebyshev Type II
In the table above, is the frequency, N is the filter order, is the maximum oscillation in the passband frequency response, is the Chebyshev polynomial, is the Jacobian elliptic function, g is the scalar gain, s is the plane of Laplace transform, or is the zero, and or is the pole.
- Frequency transform for analog filter
Transform the low pass filter into a high pass, band pass, or band stop filter with desired cutoff frequency. In Origin, the state-space form will be used in the frequency transform calculation. Assume the original transfer function of the low pass filter is , and the transfer function after transform is .
- Low pass to low pass, which transforms an analog low pass filter with cutoff frequency of 1 rad/s into a low pass filter with any specified cutoff frequency.
- Low pass to high pass
- Low pass to band pass
- Low pass to band stop
where is the center frequency, is the bandwidth, and are the lower and upper band edges respectively.
Convert analog filter into a digital filter.
To convert analog filter into a digital filter, Origin uses the bilinear transformation, which is defined by expression:
Forward and Backward Filtering
Origin allows to perform the forward and backward filtering, which will result to zero-phase distortion. First of all, it will perform filtering the data in the forward direction, and then reverses the filtered data, then runs it back through the filter again.