Digital Signal Processing/IIR Filter Design
IIR filters are typically designed basing on continuous-time filter functions. Once the transfer function has been chosen, different filter structures allow to implement the filter, be it in hardware or in software.
Transfer function edit
The classical design technique is to start from a well known lowpass filter function and to transform it to a highpass, a bandpass or a bandstop function if required. Classical transfer functions are:
The general form of the transfer function is given by the ratio of 2 polynoms:
Filter structures edit
The most straightforward digital filter implementation would be done by implementing its difference equation which is given by:
The following circuit shows a possible implementation of the difference equation for a 4th order filter:
Nevertheless, this form is not used in practice. Indeed, the first who tried to implement a filter in that way have found out that this circuit is very sensitive to the coefficient values: a small change in one coefficient can have dramatic effects on the shape of the filter's transfer function. So rounding the coefficients to integer or fixed-point values resulted into a design nightmare. Because of this, engineers turned over to one of the following approaches:
- simulating analog filter structures which had shown not to suffer of this acute sensitivity
- breaking the total transfer function into a chain of second order sections, with an additional first order section for even-order filters
All-Pole Filters edit
Some filter structures based on the simulation of analog filters are used for the implementation of all-pole filters.
Chains of Integrators edit
A Chain of Integrators with Feedback (CIF) allows a straightforward implementation of an all-pole transfer function.
This circuit, with to being the multiplier ouputs, can be described by the following equations:
which can be iteratively solved as:
From this, the time constants can be iteratively retrieved from the transfer function's coefficients.
The digital structure corresponding to the analog CIF is given in the following figure:
If the sampling rate is much higher than the time constants, the filter coefficients can be obtained directly from the CIF in the analog domain. Else, they can be found from the sampled system transfer function:
Leapfrog Filters edit
A leapfrog filter simulates the functionality of an analog ladder filter and provides a robust implementation of an all-pole transfer function. It can be shown that a large variation of coefficient values only leads to small variations of the transfer function, especially in the passband.
Taking the example of the following 4th order all-pole lowpass ladder filter,
one can write the following equations:
Rewriting these equations in order to have only voltages on the left side gives:
This new set of equations shows that the filter can be implemented with a chain of 4 integrators with:
- state variables having the form of or
- time constants having the form of or
The resulting circuit is an integrator chain where each integrator output is brought back to the preceeding integrator input. Hence the name leapfrog.
This analog device can be implemented as a digital circuit by replacing the analog integrators with accumulators:
The filter coefficients can be derived from tables providing the , and values for the selected filter functions and from the sampling period . An interesting point is that the relative values of the coefficients set the shape of the transfer function (Butterworth, Chebyshev, …), whereas their amplitudes set the cutoff frequency. Dividing all coefficients by a factor of two shifts the cutoff frequency down by one octave, which corresponds to a factor of two.
Let us note that the replacement of the analog integrators with accumulators corresponds is a very primitive design technique. In terms of signal processing, this corresponds to simplify the Z-transform to , which are the two first terms of the Taylor series of . Nevertheless, this approximation is good enough for filters where the sampling frequency is much higher than the signal bandwidth.
The state space representation of the preceeding filtre can be written as:
From this equation set, one can write the A, B, C, D matrices as:
A special case is the Butterworth 3rd order filter which has time constants with relative values of 1, 1/2 and 1. Due to that, this filter can be implemented in hardware without any multiplier, but using shifts instead.
Filters with poles and zeroes edit
Filters with poles and zeroes are best implemented in the form of a chain of biquadratic cells or by the parallel connection of two all-pass filters.
Chain of Second Order Sections edit
A second order section, often referred as biquad, implements a second order transfer function. The transfer function of a filter can be split into a product of transfer functions each associated to a pair of poles and possibly a pair of zeroes. If the transfer function's order is odd, then a first order section has to be added to the chain. This section is associated to the real pole and to the real zero if there is one.
The second order section's transfer function is given by:
The most known biquad structures are shown next.
Direct-form 1 biquad edit
The following figure shows a direct form 1 biquad:
Direct-form 1 transposed biquad edit
The following figure shows a direct form 1 transposed biquad:
Direct-form 2 biquad edit
The following figure shows a direct form 2 biquad:
Direct-form 2 transposed biquad edit
The following figure shows a direct form 2 transposed biquad:
Obviously, the corresponding first order sections are done by removing the multipliers for coefficients and , together with the associated delay element(s).
Parallel connection of allpass filters edit
Allpass filters are used to modify the phase of a signal's frequency components without altering their amplitude. They can be used to compensate for other undesired phase shifts, as for example in the design of close-to-linear phase IIR filters.
Additionally, the parallel connection of two allpass filters allows to implement any kind of transfer function. Indeed, at frequencies where the two branches show the same phase shift, the output will follow the input, but at the frequencies where the relative phase shift is 180°, the output will be zero. An example of this functionality is given in the family of Wave Digital Filters (WDFs).