Products
3.1 Introduction
IIR filters are digital filters with infinite impulse response. Unlike FIR filters, they have the feedback (a recursive part of a filter) and are known as recursive digital filters therefore.
The dsPICPRO4 supports the latest 64and 80-pin dsPIC30F microcontrollers from Microchip. It comes w ith a dsPIC30F6014A. The system includes an USB 2.0 programmer, mikroICD (In-Circuit Debugger), touch panel controller, CAN, RS485, DAC and RTC. [more info]
EasydsPIC4A is a full-featured development system that supports the latest 18-, 28- and 40-pin dsPIC30F MCUs. It comes w ith the dsPIC30F4013 microcontroller. The board features a USB 2.0 programmer, mikroICD (In-Circuit Debugger), touch panel controller etc. [more info]
For this reason IIR filters have much better frequency response than FIR filters of the same order. Unlike FIR filters, their phase characteristic is not linear which can cause a problem to the systems which need phase linearity. For this reason, it is not preferable to use IIR filters in digital signal processing when the phase is of the essence. Otherwise, when the linear phase characteristic is not important, the use of IIR filters is an excellent solution. There is one problem known as a potential instability that is typical of IIR filters only. FIR filters do not have such a problem as they do not have the feedback. For this reason, it is always necessary to check after the design process whether the resulting IIR filter is stable or not. IIR filters can be designed using different methods. One of the most commonly used is via the reference analog prototype filter. This method is the best for designing all standard types of filters such as low-pass, high-pass, band-pass and band-stop filters. This book describes the design method using reference analog prototype filter. Figure 3-1-2 illustrates the block diagram of this method.
Figure 3-1-2. Block diagram of design m ethod using reference analog prototype filter
FIR filters can have linear phase characteristic, which is not typical of IIR filters. When it is necessary to have linear phase characteristic,
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
1/45
9/22/13
FIR filters are the only available solution. In other cases when linear phase characteristic is not necessary, such as speech signal processing, FIR filters are not good solution. IIR filters should be used instead. The resulting filter order is considerably lower for the same frequency response. The filter order determines the number of filter delay lines, i.e. number of input and output samples that should be saved in order that the next output sample can be computed. For instance, if the filter order is 10, it means that it is necessary to save 10 input samples plus 10 output samples preceeding the current sample. All these 21 samples will affect the next output sample. The IIR filter transfer function is a ratio of two polynomials of complex variable z-1. The numerator defines location of zeros, whereas the denominator defines location of poles of the resulting IIR filter transfer function. Figure 3-1-3. illustrates input and output signals of the system with non-linear phase characteristic.
The system introduces phase shift of 0 radians at frequency of , and radians at three times higher frequency. Input signal consists of nature frequency and harmonics with the same amplitude at three times higher frequency. Figure on the left illustrates an input signal, whereas Figure on the right illustrates an output signal. As seen, these two signals have different waveforms. Neither the power of the signal nor amplitudes of particular harmonics have been changed, but the phase of the second harmonic. Assume that an input represents a speech signal where the phase is not important. In this case such phase distorsion would be negligable as the system satisfies the stated requirements. Otherwise, if the phase is important, such a huge distorsion mustnt be allowed.
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
2/45
9/22/13
p normalized passband cut-off frequency; s normalized stopband cut-off frequency; 1 maximum passband ripples; 2 minimum stopband attentuation; passband attenuation parameter; A stopband attenuation parameter; ap maximum passband ripples [dB]; and as minimum stopband attenuation [dB].
where:
fs is the sampling frequency; f is the frequency to normalize; and is the normalized frequency.
Specifications for high-pass, band-pass and band-stop filters are defined almost the same way as those for low-pass filters. Figure 3-2-2 illustrates a high-pass filter specification, whereas Figure 3-2-3 illustrates a band-pass filter specification.
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
3/45
9/22/13
Comparing these two Figures 3-2-1 and 3-2-2, it is obvious that low-pass and high-pass filters have similar specifications. The same parameters are defined in both cases with the difference that in the later case the passband is substituded by the stopband and vice versa. Figure 3-2-3 illustrates a band-pass specification.
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
4/45
9/22/13
3.2.2 Z-transform
The Z-transform is performed upon discrete-time signals. It converts a discrete timedomain signal into a complex frequency-domin representation. It is very suitable for analyzing discrete time-domain signals and systems as well. The z-transform is derived from the Fourier discrete time-domain transformation and is considered the basic operation in digital filter design process. The Z-transform is defined as:
where z is the complex number. Example: Assume that samples of a discrete-time signal x(n) are known. It is necessary to transform this signal with the z-transform and Fourier fransform.
x(n)={1,2,3,4,5,4,3,2,1} ; 0 n 8
z-transform is defined via expression:
It becomes:
The last expression is the z-transform of the given signal. The Fourier transformation can be found by rewriting the previous expression in terms of z as z=e^j. It becomes:
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
5/45
9/22/13
Comparing Z and Fourier transforms, it is easy to notice some similarities between them:
The two last expressions lead us to the conclusion that Fourier transform is just a special form of the z-transform for r=1. In the z plane, the Fourier transform is represented as a unit circle, which can be seen in Figure 3-2-6 below.
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
6/45
9/22/13
The z-transform of the transfer function is of great importance for IIR filters. The location of poles in the z plane is used for testing stability of designed IIR filter. The poles of the IIR filter transfer function must be located within the unit circle in order that filter is stable. Figure 3-2-7a illustrates zeros and poles of the transfer function of a stable IIR filter in the z plane.
Transfer function zeros are denoted by small circles, whereas its poles are denoted by small crosses.
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
7/45
9/22/13
Re Real axis Im Imaginary axis
As seen in Figure 3-2-7, one transfer function zero is located outside the unit circle. It doesnt cause any problem as the location of poles is the only thing that matters. All four poles of transfer function are located within the unit circle, which guarantees tha stability of IIR filters. According to the location of poles in the z plane, it is easy to determine whether it refers to FIR or IIR filter. The poles of the FIR filter transfer function are located at the origin. It is obviously not the case in Figure 3-2-7, which means that it refers to IIR, not FIR filter. Also, Figure 3-2-7a clearly indicates interrelation between zeros and poles in the z plane. If a zero or a pole is located on the real axe in the z plane, i.e. the imaginary part is zero, then it is single. If either of them is not located on the real axis in the z plane, then it has the corresponding pair having the same real value and the same imaginary value with the opposite sign. In the z plane, it is illustrated as a pair of zeros or poles which are symmetric around the real axis. Such a pair is also called a complex-conjugated pair of zeros or poles. Figure 3-2-7b illustrates the zeros and poles of the transfer function of an instable IIR filter in the z plane.
As seen from Figure 3-2-7b, two poles located outside the unit circle make this IIR filter instable. If bilinear transformation is used in the filter design, the resulting filter is stable before the coefficient quantization starts. This quantization changes the location of zeros and poles of the resulting IIR filter, which can cause one pole or one pair of poles to be located outside the unit circle. The result of such a quantization is a filter that is not stable.
where:
bi are the feedforward filter coefficients (non-recursive part); aj are the feedback filter coefficients (recursive part); H0 is a constant; qi are the zeros of the transfer function;
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
8/45
9/22/13
The recursive part of the transfer function is actually a discrete-time system feedback. Unlike the FIR filters, the IIR filters have feedback which enable them to have greater selectivity as well as nonlinearity of phase characteristic than FIR filters. Figure 3-2-8. illustrates block diagram of discrete-time system with feedback.
In the time domain, the discrete-time system shown in Figure 3-2-8 can be expressed as follows:
OR
The later expression is more convenient for software IIR filters realization. In the frequency domain, the discrete-time system shown in Figure 3-2-8 can be expressed as the multiplication of Z-transform input signal X(z) and the transform function H(z):
The first way of representing discrete-time systems is suitable for both software and hardware IIR filter implementation, whereas the representation in the z domain is suitable for analyzes of designed filters and synthesis itself (design process). Example: The transfer function of a 3th order IIR filter, designed using Chebyshev function is:
This process is also known as convolution. Another expression for convolusion that is more useful in practical applications is:
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
9/45
9/22/13
Using expression:
it is possible to find function for particular normalized frequency. For example, when = 0.2:
Then denominator:
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
10/45
9/22/13
The software realization would require two buffers each of minimum length 3. One buffer would be used for input samples and another one for output samples. These are usually circular buffers whose length can be expressed as 2^n, which in this case means that the circular buffer is 4 = 2^2 in length. By complexity, the given IIR filter corresponds to a 6th order FIR filter. Selectivity and attenuation of this filter are much higher than those of any 6th order FIR filter. The result of the feedback, which provides so high selectivity and attenuation, is a non-linear phase characteristic.
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
11/45
9/22/13
function of an IIR filter is clearly marked in this figure.
The frequency deviation shown in Figure 3-2-10 is basically slight deviation, even though it is very large at certain frequencies. The minimum attenuation and the width of transition region of the resulting IIR filter remain unchanged, so that such deviation is acceptable.
1. Defining filter specification; 2. Specifying analog prototype filter; 3. Computing the filter order required for a given set of specifications and specified analog prototype filter; 4. Computing the transfer function of reference analog prototype filter; 5. Conversion into analog filter via scaling; 6. Conversion into digital filter via bilinear transformation; and 7. If the obtained filter doesnt satisfy the given specifications or if it is possible to decrease the filter order, then it is necessary to do it. The filter order can be increased or decreased according to needs and after that steps 4, 5 and 6 are repeated as many times as needed.
The final objective of defining IIR filter specifications is to find the desirable normalized cutoff frequencies (c, c1, c2), transition width, maximum passband attenuation and minimum stopband attenuation. The type of analog prototype filter as well as the filter order will be specified according to these parameters. Now, it is time to specify the type of reference analog prototype filter. Be aware that every type has its good and bad sides. It is only important that its characteristics can satisfy the given specifications. However, it is preferable to specify such a type of analog prototype filter that can produce the lowest order IIR filter. After this step, that is, when the type of analog proptotype filter is known, it is necessary to specify or compute the filter order required for a given set of specifications. The initial value of the filter order is roughly estimated and is changed after that depending on the obtained characteristics and requirements. When both type and order of analog prototype filter are known, it is possible to find its transfer function. The transfer function of analog prototype filter depends on frequencies which are not scaled into the desirable range. For this reason, it is necessary to perform scaling of the transfer function so that cut-off frequencies go into the desirable range. This operation is actually conversion of reference analog prototype filter into analog filter with desirable characteristic. Finally, the transfer function of the specified type of reference analog prototype filter is obtained by converting analog filter into digital one. This book represents the most commonly used conversion known as bilinear transformation. If the resulting filter doesnt satisfy the given specifications, or if the filter order can be less than actual one, it should be changed. IIR filters have much greater selectivity and attenuation than FIR filters of the same order. For this reason, it is preferable to increase or decrease the filter order by 1. After changing the filter order, the entire IIR filter design process, i.e. computing of the transfer function of reference analog prototype filter, scaling and obtaining analogue filters and conversion into digital filter, is repeated.
where:
N is the filter order; bk the coefficient of non-recursive part of IIR filter; and ak the coefficient of recursive part (feedback) of IIR filter.
The coefficients bk and ak are of interest for IIR filter realization (both hardware and software). Figure 3-2-11 illustrates the block diagram of
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
12/45
9/22/13
IIR filter.
There are several types of IIR filter realization. This chapter covers direct, direct transpose, direct canonic, direct transpose canonic and cascade realizations. All of them are very convenient and most commonly used for both hardware and software IIR filter realization. Each of them will be described in detail along with their advantages and disadvantages.
The first part of the expression refers to non-recursive part and the other refers to recursive part of IIR filter. In IIR filter direct realization, these two parts are separately considered and realized. The realization of non-recursive part of IIR filter is identical to the direct realization of FIR filter. Figure 3-2-12. illustrates the block diagram of direct realization of non-recursive part of IIR filter.
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
13/45
9/22/13
As seen from Figure 3-2-12 above, multiplication coefficients are identical to those of the transfer function. Realization of non-recursive part of IIR filter is similar to that of recursive part. Figure 3-2-13. illustrates the direct realization of the filter recursive part.
As non-recursive and recursive part of IIR filter are separately realized, it doesnt matter which of them will be used first in filtering process. Figures 3-2-14a and 3-2-14b illustrate block diagrams of IIR filter realization when non-recursive part is used before and after recursive part of IIR filter, respectively.
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
14/45
9/22/13
Figure 3-2-14a. IIR filter direct realization, non-recursive part is used first
Figure 3-2-14b. IIR filter direct realization, recursive part is used first
This structure is also known as a direct form I structure. As seen from Figures 3-2-14a and 3-2-14b, direct realization requires in total of 2N delay lines, (2N+1) multiplications and 2N additions. Direct realization is very convenient for software implementation and this is where it is most commonly used. Some of disadvantages of
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
15/45
9/22/13
this realization are the greatest sensitivity to accuracy of realized coefficients (i.e. the largest finite word-length effect), and the greatest complexity due to implementation (i.e. needs most resources). On IIR filter software implementation with direct structure, it is necessary to have two buffers with at least N+1 samples, where N is the IIR filter order. For their simplicity and effectiveness, most commonly used are the so called circular buffers the length of which can be expressed as 2^k. The value of constant k is defined as a minimum value for which N 2^k is valid. Accordingly:
Since the buffer length is 16, location addressing in the circular buffer is performed via module 16 operations:
Example: A 6th order FIR filter is used in this example. It is necessary to design this filter using direct structure with circular buffer. The length of the buffer needs to be 2^k. The length of circular buffer is obtained from the following expression:
It means that the minimum length of circular buffer is 2^3 = 8. The contents of the buffer after receiving the first 10 samples is shown in the table 3-2-1. Input samples are denoted by x[n] and each shaded cell represents changed location in buffer.
A DDR. 7 A DDR. 6 A DDR. 5 A DDR. 4 A DDR. 3 A DDR. 2 A DDR. 1 A DDR. 0
S T EP 0 1 2 3 4 5 6 7 8 9 10
x[0] x[1] x[2] x[3] x[4] x[5] x[6] x[7] x[7] x[7] x[6] x[6] x[6] x[5] x[5] x[5] x[5] x[4] x[4] x[4] x[4] x[4] x[3] x[3] x[3] x[3] x[3] x[3] x[2] x[2] x[2] x[2] x[2] x[2] x[2] x[1] x[1] x[1] x[1] x[1] x[1] x[1] x[9] x[0] x[0] x[0] x[0] x[0] x[0] x[0] x[8] x[8]
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
16/45
9/22/13
Figure 3-2-16. IIR filter direct transpose realization, non-recursive part is used first
Figure 3-2-17. IIR filter direct transpose realization, recursive part is used first
There are no significant differences between direct and direct transpose realizations. Both structures have the same multiplication coefficients. The only difference is in the position of delay lines. Similar to direct realization structure, the direct transpose realization structure uses 2N delay lines, (2N+1) multiplications and 2N additions.
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
17/45
9/22/13
3.2.6.3 Direct Canonical Realization
Direct canonical realization structure has reduced number of delay lines to the minimum, that is, N delay lines. This way, one of the main disadvantages of direct and direct transpose realization structures is eliminated. Recursive and non-recursive parts of IIR filter are not considered separately, which causes implementation to be more complex than for direct realization structure. A good thing is that the coefficients are the same as for direct realization. Figure 3-2-18 illustrates the block diagram describing direct canonic realization structure of IIR filter.
Similarities between direct canonic structure block diagram and direct realization structure shown in Figure 3-2-14b are obvious. The difference between realization structures shown in Figures 3-2-14b and 3-2-18 is that non-recursive and recursive part for direct canonic realization structure cannot be treated separately, although it is easy to differentiate between them. Direct canonic structure uses N delay elements, (2N+1) multipilications and 2N additions. Sensitivity to the accuracy of coefficients is the same as for all previously described structures, which is the main disadvantage of this realization structure.
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
18/45
9/22/13
Similarities between direct transpose canonical structure block diagram and direct transpose realization structure shown in Figure 3-2-16 are obvious. The difference between realization structures shown in Figures 3-2-16 and 3-2-19 is that non-recursive and recursive part for direct transpose canonical realization structure cannot be treated separately, although it is easy to differentiate between them. Direct transpose canonic structure uses N delay elements, (2N+1) multipilication elements and N+1 adders. Sensitivity to the accuracy of coefficients is the same as for all previously described structures, which is the main disadvantage of this realization structure.
where:
bi are the coefficients of transfer function numerator (non-recursive part); aj are the coefficients of transfer function denominator (recursive part); H0 is a constant; qi are the zeros of the transfer function; pj are the poles of the transfer function; B(z) is the transfer function of non-recursive part; A(z) is the transfer function of recursive part (feedback); and M is the number of sections in cascade realization structure.
Cascade realization requires the given expression to be factorized so that the transfer function is expressed as follows:
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
19/45
9/22/13
where: a[i, k] are the coefficients of recursive part of the i-th IIR filter section; b[i, k] are the coefficients of non-recursive part of the i-th IIR filter section. Individual sections are of the first or second order. Direct transpose canonical structure is most frequently used in realization. Figure 3-220 illustrates a first-order section.
The use of direct transpose realization structure reduces necessary number of delay lines and adders as well. Filter dividing in independent sections reduces the sensitivity to the accuracy of quantization coefficients and simplifies analysing the stability of the resulting filter. Besides, the possibility that IIR filter becomes instable after quantization is drastically reduced as the coefficients quantization is performed after dividing filter in sections, so the changes of poles locations are smaller, therefore. Software realization requires M buffer of length 2 or 1. Each section must have its own buffer for saving samples of intermediate signals. Such complexity and needed factorization are two main disadvantages of this realization structure. Figure 3-2-21 illustrates the block diagram describing cascade IIR filter structure.
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
20/45
9/22/13
where: N is the filter order; s is the complex frequency (s = + j); and M N. In order that a system described via expression above is stable, it is necessary that all poles (the square roots of polinomial Aa(s)) are located in the left half of S plane. Figure 3-3-1 illustrates S plane.
A low-pass filter is used for analog filter design. The conversion into the appropriate type of filter (high-pass, band-pass or band-stop) is performed by converting into analog filter, i.e. frequency axis scaling.
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
21/45
9/22/13
Figure 3-3-3 illustrates IIR filter specification with parameters of most interest for Butterworth filter. To design Butterworth reference analog prototype filter, it is necessary to know the filter order. All poles of the resulting filter must be located in the left half of the S plane, i.e. to the left of the imaginary axis. Note: In the z plane, filter is stab le if all poles are located within the unit circle. In the s plane, filter is stab le if all poles are located in the left half of the s plane. Z-transform is used for digital filters, whereas Laplase transform (s plane) is used for analog filters. Even though these two types of transformations are similar to some extent, they should not b e mixed up concerning the filter stab ility analyse. When the filter order is known, it is easy to find its poles using expression:
Butterworth poles are equally allocated (equidistantly) on the unit circle within the left half of the s plane. The location of poles for N=5 and N=6 is shown in Figure 3-3-4.
Figure 3-3-4. Position of Butterw orth filter poles for N=5 and N=6
The transfer function of the Butterworth reference analog prototype filter is expressed as follows:
where: Sk is the k-th pole of the Butterworth filter transfer function For N=5, the transfer function is:
To design Chebyshev reference analog prototype filter, it is necessary to know the filter order. Chebyshev analog filter is defined via expression:
where: is the frequency; N is the filter order; is a parameter used to define maximum oscillations in the passband frequency response; and TN is the Chebyshev polynomial. The Chebyshev polynomial TN() can be obtained via recursive relations:
If the filter order is known in advance, neither recursive relations nor expression for the square of frequency response are necessary. The design process starts from the values of poles of a 1st order Chebyshev reference analog filter. The values of poles are expressed as:
where: si is the i-th transfer function pole of analog prototype filter (complex value); i is the pole; and i is the imaginary pole.
where: N is the filter order; and i=1, 2, ..., N. The value of parameter is obtained via expression:
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
22/45
9/22/13
The value of A0 is found via expression:
To design inverse Chebyshev reference analog pototype filter, it is necessary to know the filter order. Inverse Chebyshev analog filter is defined via expression:
where: is the frequency; N is the filter order; is the parameter of maximum oscillation in the passband frequency response; and TN is the Chebyshev polynomial. The Chebyshev polynomial TN() can be obtained from recursive relation:
If the filter order is familiar in advance, neither these recursive relations nor expression for the square of frequency response are necessary. The design process starts from the values of poles of a 1st order inverse Chebyshev reference analog filter. The poles of the transfer function of inverse Chebyshev analog filter are considered reciprocal poles of the transfer function of a 1st order Chebyshev analog filter. The poles of a 1st order Chebyshev analog filter are expressed as:
where: si is the i-th pole of the transfer function of analog prototype filter (complex value); i is the real pole; and i is the imaginary pole.
where: N is the filter order; and i=1, 2, ..., N. The poles of the transfer function of inverse Chebyshev analog filter are found via expression:
where: si is the pole of the transfer function of a 1st order Chebyshev analog filter; and s2i is the pole of the transfer function of inverse Chebyshev analog filter. Transfer function is expressed as:
The coefficient k in numerator can be only an odd number. Table 3-3-1 provides a few examples of values of k.
N 5 6 7 8 M IN 1 1 1 1 M AX 5 5 7 7 V A L UES 1, 3, 5 1, 3, 5 1, 3, 5, 7 1, 3, 5, 7
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
23/45
9/22/13
The value H0 is found via expression:
Figure 3-3-8. Location of poles and zeros of inverse Chebyshev filter for N=5
As seen from Figure 3-3-8 and expression for k, the zeros of the transfer function are always complex-conjugated values, which is not the case with the poles of the transfer function.
where H0 is a costant; zk is the k-th zero of the transfer function of the reference analog prototype filter; M is a number of zeros of the transfer function of the reference analog prototype filter; pk is the k-th pole of the transfer function of the reference analog prototype filter; and N is a number of poles of the transfer function of the reference analog prototype filter and the filter order as well. By performing the transformation:
each expression within brackets in the transfer function numerator is transformed into:
By replacing numerator and denominator by their transformed expressions, the transform function of the analog filter is obtained:
Example: The transform function of the Butterworth reference analog prototype filter of the 3rd order is expressed as follows:
The transformation in a band-pass analog filter with the cut-off frequency c = 0.2929 in the passband is obtained via expression:
Example: The transform function of inverse Chebyshev reference analog prototype filter of the 3rd order is expressed as follows:
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
24/45
9/22/13
The transformation to a band-pass analog filter with the cut-off frequency c=0.3719 in the passband is obtained via expression:
Generally, the transform function of the reference analog prototype filter can be expressed as follows:
where: H0 is a constant; zk is the k-th zero of the transfer function of the reference analog prototype filter; M is a number of zeros of the transfer function of the reference analog prototype filter; pk is the k-th pole of the transfer function of the reference analog prototype filter; and N is a number of poles of the transfer function of the reference analog prototype filter and the filter order as well. By performing the following transformation:
Substituting these transformed expressions for numerator and denominator, the transform function of the analog filter is obtained:
Example: The transfer function of the Chebyshev reference analog prototype filter of the 3rd order is expressed as follows:
The transformation in a band-pass analog filter with the cut-off frequency c = 0.3721 in the passband is expressed as:
Example: The transfer function of inverse Chebyshev reference analog prototype filter of the 2nd order is expressed as follows:
The transformation in a band-pass analog filter with the cut-off frequency c=0.1434 in the passband is expressed as:
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
25/45
9/22/13
When designing, the required filter order is divided by two. The resulting filter order is used to design a low-pass reference analog prototype filter. By transforming it into a band-pass analog filter the filter order is doubled. The required filter order is obtained this way. Example: Assume that it is necessary to design an 8th order band-pass digital filter. A low-pass reference analog filter of the 4th order is designed first. Reference analog filter is further transformed in a bandpass analog filter. This transformation doubles the filter order. The order of the resulting filter is 8. The transformation into a band-pass analog filter is expressed as:
where: p1 is a lower cut-off frequency in the passband (refer to figure 3-4-1); and p2 is a higher cut-off frequency in the passband (refer to figure 3-4-1).
The transfer function of an analog prototype filter is transformed first in a band-pass analog filter, and normalized after that with c. Generally, the transfer function of the reference analog prototype filter can be expressed as:
where: H0 is a constant; zk is the k-th zero of the transfer function of the reference analog prototype filter; M is a number of zeros of the transfer function of the reference analog prototype filter; pk is the k-th pole of the transfer function of the reference analog prototype filter; and N is a number of poles of the transfer function of the reference analog prototype filter and the filter order as well. By performing the transformation:
Substituting the transformed expressions for numerator and denominator, the transform function of analog filter is obtained:
Example: The transfer function of the Chebyshev reference analog prototype filter of the 2nd order is expressed as:
The transformation in a band-pass analog filter with the cut-off frequency c = 0.1626 in the passband is expressed as:
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
26/45
9/22/13
The result is the transfer function of analog filter:
where: s1 is a lower cut-off frequency in the stopband (refer to figure 3-4-2); and s2 is a higher cut-off frequency in the stopband (refer to figure 3-4-2).
The transfer function of the reference analog prototype filter is transformed first into a band-stop analog filter, and normalized after that with c. Generally, the transfer function of the reference analog prototype filter can be expressed as follows:
where: H0 is a constant; zk is the k-th zero of the transfer function of the reference analog prototype filter; M is a number of zeros of the transfer function of the reference analog prototype filter; pk is the k-th pole of the transfer function of the reference analog prototype filter; and N is a number of poles of the transfer function of the reference analog prototype filter and the filter order as well. The first step refers to normalization with the frequency c:
Substituting the transformed expressions for numerator and denominator, the transform function of analog filter is obtained:
Example: The transfer function of inverse Chebyshev reference analog prototype filter of the 2nd order is expressed as:
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
27/45
9/22/13
The transformation into a band-stop analog filter with the cut-off frequency c=0.252.5727 in the passband is expressed as:
1. faithfully approximate the frequency response of analog filter; and 2. provide that the resulting digital filter is guaranteed to be stable.
This transformation also transforms s plane into z plane. Analog filter is stable if the poles of the transfer function are located in the left half of s plane, whereas digital filter is stable if the poles are located within the unit circle. For this reason, the transformation must provide that the left half of s plane coincides with the area within the unit circle of z plane, as shown in Figure 3-5-1.
One of most commonly used method of transforming analog filters into appropriate IIR filters is known as bilinear transformation. It is defined via expression:
Using the previous expression, the transformation of the analog filter transform function into a digital one can be expressed as:
As seen, the transformation is performed by a simple change of variable s in the expression for the transfer function of the resulting analog filter. The analog filter transfer function can be expressed as:
where: H0 is a constant. If s=0 then H(s)=H0 ; zk is the zero of the analog filter transfer function; and pk is the pole of the analog filter transfer function. After transformation, the analog filter transfer function is further transformed into:
Example: The transfer function of a second-order high-pass analog filter (inverse Chebyshev, fc=2KHz, fs=44100Hz, 60dB) is expressed as:
It is necessary to transform the given analog filter into the appropriate digital filter by bilinear transformation. Using expression for linear transformation:
we obtain:
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
28/45
9/22/13
The result is the transfer function of a digital high-pass IIR filter. Realization structure is illustrated in Figure 3-5-2 below.
Digital filters designed via bilinear trasnformation are guaranteed to be stable. However, the accurate values of coefficients are obtained immediately after the implementation of bilinear transformation. On filter realization, it is impossible to represent coefficients without an error. In software digital filter realization (implementation), the resulting coefficients are quantized, which also generates a certain error. Any error made during the quantization of coefficients affects more or less the frequency response, which may further cause the stopband attenuation to decrease. The quantization effect on digital filter stability is much more dangerous. Special care is required when quantizing feedback coefficients as it causes the location of the digital IIR filter transfer function poles to change their location. It is very important to prevent the poles from being located outside the unite circle. However, if it happens, the resulting IIR filter is not stable and is useless therefore. A disadvantage of the bilinear transformation is a non-linear transformation of the analog filter frequency axis into a digital one. When designing, the cut-off frequencies are defined on the basis of the given specifications and type of a filter. When transforming, these frequencies have appropriate locations, which is not the case with the rest of the frequency axis. Such a non-linear transformation of analog filter frequencies causes the phase characteristic distorsion, so that it is not linear.
3.6 Examples
This chapter discusses various IIR filter design methods. The four standard types of filters are used here:
1. Defining filter specifications; 2. Specifying the type of analog prototype filter; 3. Computing the filter order according to the filter specifications and specified analog prototype filter; 4. Computing the transfer function of reference analog prototype filter; 5. Transformation into analog filter by range scaling; 6. Transformation into digital filter by bilinear transformation; and 7. If the resulting filter doesnt satisfy the given specifications or if it is possible to decrease the filter order, then it is necessary to do it. The specified filter order is increased or decreased according to needs, and steps 4, 5 and 6 are repeated after that as many times as needed.
Some steps are skipped in some cases. If the filter order is known, step 3 is skipped. If the type of reference analog prototype filter is predetermined, step 2 is skipped. In every given example, the IIR filter design process will be described through these steps in order to make it easier for you to observe similarities and differencies between various design methodes, analog prototype filters and design of various types of filters as well. Figure 3-6-1 illustrates the design steps along with input and output data for each of them.
The first block refers to design of reference analog prototype filter of appropriate order. The output data is a reference analog prototype filter transfer function Ha (s). Regardless of the type of reference analog prototype filter in use, the transfer function is given by:
where: H0 is a constant; zk is the k-th zero of the reference analog prototype filter transfer function; M is a number of zeros of the reference analog prototype filter transfer function; pk is the k-th pole of the reference analog prototype filter transfer function; and N is a number of poles of the reference analog prototype filter transfer function and filter order as well. Reference analog prototype filter is always a low-pass filter. The next step is the transformation into an analog filter of appropriate type. The expression used to transform the reference analog prototype filter transfer function depends on the type of filter that needs to be obtained. The final result is the transfer function H(s) given by:
where: H0 is a constant; zk is the k-th zero of the reference analog prototype filter transfer function;
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
29/45
9/22/13
M is a number of zeros of the reference analog prototype filter transfer function; pk is the k-th pole of the reference analog prototype filter transfer function; and N is a number of poles of the reference analog prototype filter transfer function and filter order as well. As seen, the transfer functions of reference analog prototype filter and analog filter are very similar. They differ only in the value of constant H0 , the values of the transfer function poles and zeros zk and pk as well as in the number of transfer function zeros M. The filter order is the same if the analog filter is a low-pass or high-pass filter, whereas it is different if the analog filter is a band-pass or band-stop filter. In the later case, the analog filter order (N) is twice that of the reference analog prototype filter. The next step is the transformation into appropriate digital IIR filter using bilinear transformation given by expression:
Filter Designer Tool is used for testing and analysing the resulting IIR filters in this chapter. All data are calculated with the accuracy of 4 decimal digits, which is sufficient for most examples.
Filter order N=2; Sampling frequency fs=20KHz; Passband cut-off frequency fc=2.5KHz; and Minimum stopband attenuation ap=40dB.
Step 2: Method- filter design using Butterworth reference analog prototype filter. Step 3: Filter order is predetermined, N=2. Step 4: The Butterworth reference prototype filter transfer function has no zeros, only poles. These can be computed via expression:
Step 5: First it is necessary to compute the analog prototype filter cut-off frequency c.
The analog filter transfer function is obtained from the reference analog prototype filter transfer function using expression:
As the Butterworth reference prototype filter has no zeros, the expression for transfer function is simpler:
Generally, substituting the complex variable s into the expression for analog filter transfer function, the following is obtained:
where: zk are the zeros of analog filter transfer function; and pk are the poles of analog filter transfer function. This general expression can be written in a simpler way in this example:
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
30/45
9/22/13
The result is the IIR filter transfer function. Step 7: The filter order is predetermined. There is no need to additionally change it. Filter realization: Figure 3-6-2 illustrates the direct realization of designed IIR filter, whereas Figure 3-6-3 illustrates the frequency response of the filter obtained using Filter Designer Tool.
Figure 3-6-2. Digital IIR filter direct realization in this exam ple
Figure 3-6-3. Digital IIR filter frequency characteristic in this exam ple
3.6.1.2 Example 2
Step 1: Type of filter high-pass filter Filter specifications:
Filter order N=3; Sampling frequency fs=20KHz; Passband cut-off frequency fc=5KHz; and Minimum stopband attenuation ap=40dB.
Step 2: Method- filter design using Butterworth reference analog prototype filter Step 3: Filter order is predetermined, N = 3. Step 4: The Butterworth reference prototype filter transfer function has no zeros, only poles. These can be computed via expression:
Step 5: First it is necessary to compute the analog prototype filter cut-off frequency c.
The analog filter transfer function is obtained from the reference analog prototype filter transfer function using expression:
As the Butterworth reference prototype filter has no zeros, the expression for transfer function is simpler:
Generally, substituting the complex variable s into the expression for analog filter transfer function, the following is obtained:
where: zk are the zeros of analog filter transfer function; and pk are the poles of analog filter transfer function. This general expression can be written in a simpler way in this example:
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
31/45
9/22/13
A more condensed form of the previous expression is:
The result is the IIR filter transfer function. Step 7: The filter order is predetermined. There is no need to additionally change it. Filter realization: Figure 3-6-4 illustrates the direct realization of designed IIR filter.
Figure 3-6-4. Digital IIR filter direct realization in this exam ple
Figure 3-6-5. Digital IIR filter frequency characteristic in this exam ple
3.6.1.3 Example 3
Step 1: Type of filter band-pass filter Filter specifications:
Filter order N=4; Sampling frequency fs=20KHz; and Passband cut-off frequency fc1=4KHz, fc2=6KHz.
Step 2: Method - filter design using Butterworth reference analog prototype filter Step 3: Filter order is predetermined, N = 4. Step 4: The Butterworth reference prototype filter transfer function has no zeros, only poles. These can be computed via expression:
When designing an IIR band-pass filter, the reference prototype filter order is half that of the required IIR filter order. In this example for N=4, the order of reference prototype filter is 2, so the values of poles are:
Step 5: First it is necessary to compute the analog prototype filter cut-off frequency c.
The analog filter transfer function is obtained from the reference analog prototype filter transfer function using expression:
As the Butterworth reference prototype filter has no zeros, the expression for transfer function is simpler:
Generally, by substituting the complex variable s into the expression for analog filter transfer function, the following is obtained:
where: zk are the zeros of analog filter transfer function; and pk are the poles of analog filter transfer function.
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
32/45
9/22/13
The result is the IIR filter transfer function. Step 7: Filter order is predetermined. There is no need to additionally change it. Filter realization: Figure 3-6-6 illustrates the direct realization of designed IIR filter.
Figure 3-6-6. Digital IIR filter direct realization in this exam ple
Figure 3-6-7. Digital IIR filter frequency characteristic in this exam ple
3.6.1.4 Example 4
Step 1: Type of filter band-stop filter Filter specifications:
Filter order N=4; Sampling frequency fs=20KHz; and Passband cut-off frequency fc1=3000Hz, fc2=3300Hz.
Step 2: Method - filter design using Butterworth reference analog prototype filter. Step 3: Filter order is predetermined, N = 4. Step 4: The Butterworth reference prototype filter transfer function has no zeros, only poles. These can be computed via expression:
When designing an IIR band-stop filter, the reference prototype filter order is half that of the required IIR filter order. In this example for N = 4, the order of reference prototype filter is 2, so the values of poles are:
Step 5: First it is necessary to compute the analog prototype filter cut-off frequency c.
The analog filter transfer function is obtained from the reference analog prototype filter transfer function using expression:
As the Butterworth reference prototype filter has no zeros, the expression for transfer function is simpler:
Generally, by substituting the complex variable s into the expression for analog filter transfer function, the following is obtained:
where: zk are the zeros of analog filter transfer function; and pk are the poles of analog filter transfer function.
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
33/45
9/22/13
The result is the IIR filter transfer function. Step 7: Filter order is predetermined. There is no need to additionally change it. Filter realization: Figure 3-6-8 illustrates the direct realization of designed IIR filter.
Figure 3-6-8. Digital IIR filter direct realization in this exam ple
Figure 3-6-9. Digital IIR filter frequency characteristic in this exam ple
Sampling frequency fs=44100Hz; Passband cut-off frequency fc1=15KHz; Stopband cut-off frequency fc2=18KHz; Maximum passband attenuation ap=1dB; and Minimum stopband attenuation as=40dB.
Step 2: Method - filter design using Chebyshev reference analog prototype filter Step 3: Filter order is not pre-determined, so it is necessary to choose an initial solution from which iterative method starts. The solution is redefined progressively until some pre-determined requirements are satisfied. Lets assume that the initial filter order is 4. Step 4: The Chebyshev reference prototype filter transfer function has no zeros, only poles. These can be computed via expression:
A0 = 0.2457
so that the Chebyshev reference analog prototype filter transfer function is:
Step 5: First it is necessary to compute the analog prototype filter cut-off frequency c.
The analog filter transfer function is obtained from the reference analog prototype filter transfer function using expression:
As the Chebyshev reference prototype filter has no zeros, the expression for transfer function is simpler:
Step 6:
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
34/45
9/22/13
Generally, by substituting the complex variable s into the expression for analog filter transfer function, the following is obtained:
where: zk are the zeros of analog filter transfer function; and pk are the poles of analog filter transfer function. This general expression can be written in a simpler way in this example:
The result is the IIR filter transfer function. Step 7: By analyzing the resulting filter using Filter Designer Tool, it is obvious that the attenuation amounting to 31.2dB approximately at the frequency of 18KHZ is not sufficient. The frequency characteristic of the resulting digital filter is illustrated in Figure 3-6-10 below.
It is necessary to additionally redefine the filter order until the predefined requirements are satisfied. The filter order is incremented by 1 and is 5 therefore. All steps starting with step 3 are iterated. Step3: The filter order is incremented in the second iteration. A new filter order is 5. Step 4: The Chebyshev reference prototype filter transfer function has no zeros, only poles. These can be computed via expression:
A0 = - 0.1228
so the Chebyshev reference analog prototype filter transfer function is:
Step 5: First it is necessary to compute the analog prototype filter cut-off frequency c.
The analog filter transfer function is obtained from the reference analog prototype filter transfer function using expression:
As the Chebyshev reference prototype filter has no zeros, the expression for transfer function is simpler:
Generally, substituting the complex variable s into the expression for analog filter transfer function, the following is obtained:
where: zk are the zeros of analog filter transfer function; and pk are the poles of analog filter transfer function.
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
35/45
9/22/13
The result is the IIR filter transfer function. Step 7: By analyzing the resulting filter using Filter Designer Tool, it is obvious that the attenuation amounting to 41.6dB approximately at the frequency of 18KHZ is not sufficient. The frequency characteristic of the resulting digital filter is illustrated in Figure 3-6-11 below.
It is not necessary to further increase the filter order as this one is appropriate. Sometimes more iterations are needed to determine the filter order. The whole procedure is the same, only it takes more time. Filter realization: Figure 3-6-12 illustrates the direct realization of designed IIR filter, whereas Figure 3-6-13 illustrates the frequency characteristic of the filter obtained using Filter Designer Tool.
3.6.1.2 Example 2
Step 1: Type of filter high-pass filter Filter specifications:
Filter order N = 3; Sampling frequency fs = 20KHz; Passband cut-off frequency fc = 5KHz; and Maximum passband attenuation ap = 1dB.
Step 2: Method - filter design using Chebyshev reference analog prototype filter Step 3: Filter order is predetermined, N = 3. Step 4: The Chebyshev reference prototype filter transfer function has no zeros, only poles. These can be computed via expression:
A0 = - 0.4913
The reference analog prototype filter transfer function is:
Step 5: First it is necessary to compute the analog prototype filter cut-off frequency c.
The analog filter transfer function is obtained from the reference analog prototype filter transfer function using expression:
As the Chebyshev reference prototype filter has no zeros, the expression for transfer function is simpler:
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
36/45
9/22/13
After substitution of poles and c into expression:
Generally, substituting the complex variable s into the expression for analog filter transfer function, the following is obtained:
where: zk are the zeros of analog filter transfer function; and pk are the poles of analog filter transfer function. This general expression can be written in a simpler way in this example:
The result is the IIR filter transfer function. Step 7: The filter order is predetermined. There is no need to additionally change it. Filter realization: Figure 3-6-14 illustrates the direct realization of designed IIR filter.
Figure 3-6-14. Direct realization of digital IIR filter in this exam ple
Figure 3-6-15. Frequency characteristic of digital IIR filter in this exam ple
3.6.1.3 Example 3
Step 1: Type of filter band-pass filter Filter specifications:
Filter order N = 4; Sampling frequency fs = 20KHz; Passband cut-off frequencies fc1 = 4KHz, fc2 = 6KHz; and Maximum passband attenuation ap = 1dB.
Step 2: Method filter design using Chebyshev reference analog prototype filter. Step 3: Filter order is predetermined, N = 4. Step 4: The Chebyshev reference prototype filter transfer function has no zeros, only poles. These can be computed via expression:
When designing an IIR band-pass filter, the reference prototype filter order is half that of the required IIR filter order. In this example for N = 4, the order of reference prototype filter is 2, so the values of poles are:
A0 = 0.9826
The reference analog prototype filter transfer function is:
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
37/45
9/22/13
Step 5:
The analog filter transfer function is obtained from the reference analog prototype filter transfer function using expression:
As the Chebyshev reference prototype filter has no zeros, the expression for transfer function is simpler:
Generally, substituting the complex variable s into the expression for analog filter transfer function, the following is obtained:
where: zk are the zeros of analog filter transfer function; and pk are the poles of analog filter transfer function. In this expression, the general expression can be written in a simpler way:
The result is the IIR filter transfer function. Step 7: Filter order is predetermined. There is no need to additionally change it. Filter realization: Figure 3-6-16 illustrates direct realization of designed IIR filter.
Filter 3-6-16. Direct realization of digital IIR filter in this exam ple
Figure 3-6-17. Frequency characteristic of digital IIR filter in this exam ple
3.6.1.4 Example 4
Step 1: Type of filter band-stop filter Filter specifications:
Filter order N = 4; Sampling frequency fs = 20KHz; Passband cut-off frequencies fc1 = 3000Hz, fc2 = 3300Hz; and Maximum passband attenuation ap = 1dB.
Step 2: Method - filter design using Chebyshev reference analog prototype filter. Step 3: Filter order is predetermined, N = 4. Step 4: The Chebyshev reference prototype filter transfer function has no zeros, only poles. These can be computed via expression:
When designing an IIR band-pass filter, the reference prototype filter order is half that of the required IIR filter order. In this example for N = 4, the order of reference prototype filter is 2, so the values of poles are:
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
38/45
9/22/13
In this example, the value of constant A0 is:
A0 = 0.9826
The reference analog prototype filter transfer function is:
Step 5: First it is necessary to compute the analog prototype filter cut-off frequency c.
The analog filter transfer function is obtained from the reference analog prototype filter transfer function using expression:
As the Chebyshev reference prototype filter has no zeros, the expression for transfer function is simpler:
Generally, substituting the complex variable s into the expression for analog filter transfer function, the following is obtained:
where: zk are the zeros of analog filter transfer function; and pk are the poles of analog filter transfer function. In this expression, the general expression can be written in a simpler way:
The result is the IIR filter transfer function. Step 7: Filter order is predetermined. There is no need to additionally change it. Filter realization Figure 3-6-18 illustrates the direct realization of designed IIR filter.
Figure 3-6-18. Direct realization of digital IIR filter in this exam ple
Figure 3-6-19. Frequency characteristic of digital IIR filter in this exam ple
Sampling frequency fs = 44100Hz; Passband cut-off frequency fc1 = 15KHz; Stopband cut-off frequency fc2 = 18KHz; Maximum passband attenuation ap = 1dB; and Minimum stopband attenuation as = 40dB.
Step 2: Method - filter design using inverse Chebyshev reference analog prototype filter. Step 3: Filter order is not pre-determined, so it is necessary to choose an initial solution from which iterative method starts. The solution is
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
39/45
9/22/13
redefined progressively until some pre-determined requirements are satisfied. Lets assume that the initial filter order is 4. Step 4: The Chebyshev reference prototype filter transfer function has no zeros, only poles. These can be computed via expression:
H0 = 0.01
so that the Chebyshev reference analog prototype filter transfer function is:
Step 5: First it is necessary to compute the analog prototype filter cut-off frequency c.
The analog filter transfer function is obtained from the reference analog prototype filter transfer function using expression:
Generally, substituting the complex variable s into the expression for analog filter transfer function, the following is obtained:
where: zk are the zeros of analog filter transfer function; and pk are the poles of analog filter transfer function. This general expression can be written in a simpler way in this example:
The result is the IIR filter transfer function. Step 7: By analyzing the resulting filter using Filter Designer Tool, it is obvious that the attenuation amounting to 5.2dB approximately at the frequency of 15KHZ is not sufficient. The frequency characteristic of the resulting digital filter is illustrated in Figure 3-6-20 below.
The attenuation at 15KHz is higher than 1dB and the resulting filter doesnt satisfy the specifications therefore. It is necessary to additionally redefine the filter order until the predefined requirements are satisfied. The filter order is incremented by 1, and becomes 5 therefore. All steps starting with step 3 are iterated. Step 3: The filter order is incremented in the second iteration. A new filter order is 5. Step 4: The inverse Chebyshev reference prototype filter transfer function has no zeros, only poles. These can be computed via expression:
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
40/45
9/22/13
The Chebyhsev filter transfer function is expressed as:
H0 = - 0.05
so the inverse Chebyshev reference analog prototype filter transfer function is:
Step 5: First it is necessary to compute the analog prototype filter cut-off frequency c.
The analog filter transfer function is obtained from the reference analog prototype filter transfer function using expression:
Generally, substituting the complex variable s into the expression for analog filter transfer function, the following is obtained:
where: zk are the zeros of analog filter transfer function; and pk are the poles of analog filter transfer function. This general expression can be written in a simpler way in this example:
The result is the IIR filter transfer function. Step 7: By analysing the resulting filter using Filter Designer Tool, it is obvious that the attenuation at 18KHZ is less than 1dB (approximately 0.8dB). The frequency characteristic of the resulting digital filter is illustrated in Figure 3-6-21 below.
It is not necessary to further increase the filter order as this one is approriate. Sometimes more iterations are needed to determine the filter order. The whole procedure is the same, only it takes more time. Filter realization: Figure 3-6-22 illustrates the direct realization of designed IIR filter, whereas Figure 3-6-23 illustrates the frequency characteristic of the filter obtained using Filter Designer Tool.
Figure 3-6-22. Direct realization of digital IIR filter in this exam ple
Figure 3-6-23. Frequency characteristic of digital IIR filter in this exam ple
3.6.1.2 Example 2
Step 1: Type of filter high-pass filter Filter specifications:
Filter order N = 3; Sampling frequency fs = 20KHz; Passband cut-off frequency fc = 5KHz; and Minimum stopband attenuation 40dB.
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
41/45
9/22/13
Step 2:
Method - filter design using inverse Chebyshev reference analog prototype filter. Step 3: Filter order is predetermined, N=3. Step 4: The Chebyshev reference prototype filter transfer function has no zeros, only poles. These can be computed via expression:
H0 = -0.03
The reference analog prototype filter transfer function is:
Step 5: First it is necessary to compute the analog prototype filter cut-off frequency c.
The analog filter transfer function is obtained from the reference analog prototype filter transfer function using expression:
Generally, by substituting the complex variable s into the expression for analog filter transfer function, the following is obtained:
where: zk are the zeros of analog filter transfer function; and pk are the poles of analog filter transfer function. This general expression can be written in a simpler way in this example:
The result is the IIR filter transfer function. Step 7: The filter order is predetermined. There is no need to additionally change it. Filter realization: Figure 3-6-24 illustrates the direct realization of designed IIR filter.
Figure 3-6-24. Direct realization of digital IIR filter in this exam ple
Figure 3-6-25. Frequency characteristic of digital IIR filter in this exam ple
3.6.1.3 Example 3
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
42/45
9/22/13
Step 1: Type of filter band-pass filter Filter specification:
Filter order N = 4; Sampling frequency fs = 20KHz; Passband cut-off frequencies fc1 = 4KHz, fc2 = 6KHz; and Minimum stopband attenuation 40dB.
Step 2: Method - filter design using inverse Chebyshev reference analog prototype filter. Step 3: Filter order is predetermined, N = 4. Step 4: The Chebyshev reference prototype filter transfer function has no zeros, only poles. These can be computed via expression:
When designing an IIR band-pass filter, the reference prototype filter order is half that of the required IIR filter order. In this example for N=4, the order of reference prototype filter is 2, so the values of poles are:
H0 = 0.01
The reference analog prototype filter transfer function is:
Step 5: First it is necessary to compute the analog prototype filter cut-off frequency c.
The analog filter transfer function is obtained from the reference analog prototype filter transfer function using expression:
Generally, substituting the complex variable s into the expression for analog filter transfer function, the following is obtained:
where: zk are the zeros of analog filter transfer function; and pk are the poles of analog filter transfer function. In this example, the general expression can be written in a simpler way:
The result is the IIR filter transfer function. Step 7: Filter order is predetermined. There is no need to additionally change it. Filter realization: Figure 3-6-26 illustrates direct realization of designed IIR filter.
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
43/45
9/22/13
Figure 3-6-27. Frequency characteristic of digital IIR filter in this exam ple
3.6.1.4 Example 4
Step 1: Type of filter band-stop filter Filter specification:
Filter order N=4; Sampling frequency fs=20KHz; Stopband cut-off frequencies fc1=3000Hz, fc2=3300Hz; and Minimum stopband attenuation 40dB.
Step 2: Method - filter design using inverse Chebyshev reference analog prototype filter. Step 3: Filter order is predetermined, N = 4. Step 4: The inverse Chebyshev reference prototype filter transfer function has no zeros, only poles. These can be computed via expression:
When designing an IIR band-stop filter, the reference prototype filter order is half that of the required IIR filter order. In this example for N = 4, the order of reference prototype filter is 2, so the values of poles are:
H0 = 0.01
The reference analog prototype filter transfer function is:
Step 5: First it is necessary to compute the analog prototype filter cut-off frequency c.
The analog filter transfer function is obtained from the reference analog prototype filter transfer function using expression:
Generally, substituting the complex variable s into the expression for analog filter transfer function, the following is obtained:
where: zk are the zeros of analog filter transfer function; and pk are the poles of analog filter transfer function. In this expression, the general expression can be written in a simpler way:
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
44/45
9/22/13
Step 7: Filter order is predetermined. There is no need to additionally change it. Filter realization:
Figure 3-6-28. Direct realization of digital IIR filter in this exam ple
Figure 3-6-29. Frequency characteristic of digital IIR filter in this exam ple
Follow us on
PIC32 Solution
PIC 32 De ve lopm e nt Boards PIC 32 C om pile rs PIC 32 Program m e rs/De bugge rs PIC 32 Kits
dsPIC Solution
dsPIC De ve lopm e nt Boards dsPIC C om pile rs dsPIC Program m e rs/De bugge rs dsPIC Kits dsPIC Book s
Add-on boards
C lick Boards m ik rom e dia shie lds C om m unication boards Storage boards R e al Tim e C lock boards Display boards Me asure m e nt boards Audio & Voice boards Powe r Supply boards GPS boards GSM/GPR S boards
Additional Software
Visual TFT Visual GLC D Pack age Manage r GLC D Font C re ator
8051 Solution
8051 De ve lopm e nt Boards 8051 C om pile rs 8051 Program m e rs/De bugge rs 8051 Book s 8051 Kits
AVR Solution
AVR De ve lopm e nt Boards AVR C om pile rs AVR Program m e rs/De bugge rs AVR Kits
ARM Solution
AR M De ve lopm e nt Boards AR M C om pile rs AR M Program m e rs/De bugge rs AR M Kits
Support
Forum
m ik roBUS
Le ts m ak e
Pre ss
Product Archive
About Us
C opyright 1998 - 2013. MikroElektronika. All rights reserved. All trade and/or services marks mentioned are the property of their respective owners.
www.mikroe.com/chapters/view/73/chapter-3-iir-filters/
45/45