IIR Filter design (cf. Shenoi, 2006) The transfer function of the IIR filter is given by Its frequency responses are (where w is the normalized frequency ranging in [, ]. When a and b are real, the magnitude response |H(ejw)| is an even function, and the phase response (jw) is an odd function. Very often it is convenient to compute and plot the log magnitude of |H(ejw)| as 10log10 | H (e jw ) |2 measured in dB. Linear phase: Consider the ideal delay system. The impulse response is hid [n] [n nd ] and the frequency response is Hid [e jw ] e jwnd In this case, the magnitude and phase responses are and | Hid [e jw ] | 1 Hid [e jw ] wnd | w | Hence, when time domain is a constant delay, it causes the frequency a “linear phase distortion.” Sometimes we hope the filter response is linear phase, i.e., the phase response is linear with w. Eg. an ideal lowpass filter with linear phase (i.e., ideal low-pass but the output is delayed by nd samples in the time domain) jwnd e , w wc | H lp [e ] | wc w 0, jw However, linear phase is difficult to achieve by using IIR filters, but it can be easily designed by using FIR filters. Group delay: A convenient measure of the linearity of the phase is the group delay. d ( w) grd [ H (e )] {[ H (e jw )]} dw jw For the IIR filter, the group delay is where and (unit: samples) Since the state-of-the-arts of analog IIR filter is more advanced, the design of discrete-time IIR filter is usually an approximation of the analog one. Three approximation criteria commonly used: The Butterworth approximation The Chebyshev (minimax) approximation Analog filters represented by Laplace transform H(s). Substituting s=jw, we obtain its frequency response (in terms of continuous Fourier transform). where |H(jw)| and (jw) can be found by Maximally Flat and Butterworth Approximation Magnitude response of an ideal low-pass analog filter showing the tolerances: passband: [0, wp], transition band:[wp, ws], stopband: [ws, ] passband tolerance: p, stopband tolerance: s. Butterworth response (or maximally flat magnitude response): and now we have Magnitude responses of Butterworth lowpass filters normalized passband D2n and n are the parameters of the Butterworth filter, where n is the order of this filter. If, for example, the magnitude at the passband frequency p, is 1/ 2 , which means that the log magnitude required is 3dB, then we choose D2n = 1. If the magnitude at the passband frequency = p = 1 is required to be 1 p, then we choose D2n, normally denoted by 2, such that If the magnitude at the bandwith = p = 1 is given as Ap dB, the values 2 is computed by We get the formula Let us consider the common case of a Butterworth filter with a log magnitude of 3dB at the bandwith of p = 1 to develop the design procedure of Butterworth lowpass filter. In this case, we use the function for the prototype filter, in the form This satisfies the following properties: Design theory of Butterworth lowpass filters Let us consider the design of Butterworth lowpass filter for which (1) the frequency p at which the magnitude is 3DB below the maximum value at =0, and (2) the magnitude at another frequency s in the stopband are specified. 2 2n | H ( j ) | 1 /( 1 ) but want to Since we only know that infer H(ej). Let us consider the relationship that |H(ej)|2 = H(ej)H(ej). We denote = p/j, so There are n poles satisfying the following equations: This gives us the 2n poles of H(p)H(p), which are and In general, These poles have a magnitude of one, and the angle between adjacent poles is equal to /n. There are n poles in the left half plane and n poles in the right plane. Note that for a continuous-time linear system, it is stable iff all poles lie in the left half plane. Note that, for every pole of H(p) at p=pa, that lies in the left half-plane, there is a pole of H(p) at p=pa that lies in the right half-plane. Because of this property, we identify n poles that are in the left half of the p planes as the poles of H(p) so that it is a stable transfer function. The poles that are in the left half of the p plane are given by When we have found these n poles, we construct the denominator polynomial D(p) of the prototype filter from H(p) = 1/D(p) from Pole locations of Butterworth low-pass filters of orders n=6 The only unknown parameter at this stage of design is the order n of the filter function H(p). This is calculated using the specification that at the stopband frequency s, the log magnitude is required to be no more than As dB. So we choose n as an integer satisfying The pairs of poles from left and right half-planes can be found by the polynomial in the denominator D(p), Their coefficients can be computed recursively from where d0=1. The polynomial is referred to as Butterworth polynomials. Chebyshev 1 Approximation: The Chebyshev 1 approximation for an ideal lowpass filter has equal-valued ripples in the passband . It is known as minimax approximation and also known as the equiripple approximation. The magnitude squared function of Chebyshev approximation: where Cn() is the Chebyshev polynomial of degree n. It is defined by For n = 2, 3, 4, 5, these polynomials are Chebyshev II Approximation: (or inverse Chebyshev filters) Maximally flat at w=0; decreases monotonically as the frequency increases and has an equiripple response in the stopband. The magnitude square function of the inverse Chebyshev low pass filter: |H(j)|2 = Chebyshev I Chebyshev II Discrete-time IIR filter The procedure used for designing discrete-time IIR filters employ different transformations of the form s = f(z) to transform H(s) into H(z). Two methods: Impulse invariance Bilinear Transform Please see the copy of book chapters (Oppenheim 1999, Section 7.1) General concept on digital filter design (cf. D. Ellis, Columbia University) Discrete-time FIR filters Discrete-time FIR filters Linear Phase Discrete-time FIR filters Now we consider the special types of FIR filters in which the impulse response h[n] are assumed to be symmetric or antisymmetric. Since the order of the polynomial in each of these two types can be either odd or even, we have four types of filters with different properties. Linear phase FIR filters: Type 1: The coefficients are symmetric, i.e., h[n] = h[Nn], and the order N is even. Linear phase response Linear phase FIR filters: Type II: The coefficients are symmetric, i.e., h[n] = h[Nn], and the order N is odd. Linear phase FIR filters: Type III: The coefficients are antisymmetric, i.e., h[n] = h[Nn], and the order N is even. Linear phase FIR filters: Type IV: The coefficients are antisymmetric, i.e., h[n] = h[Nn], and the order N is odd. Fourier Series Method Modified by Windows Let us consider the magnitude response of the ideal lowpass filter to be HLP(ejw), in which the cutoff frequency is given as wc. Its inverse Fourier transform (i.e., the impulse response of the ideal low pass filter) is: We choose the following finite series to approximate HLP(ejw): Since {ejnw} form an set of orthonormal bases, CLP[n] is the the least squared solution. The approximation error is As M increases, the number of ripples in the passband (and the stopband) increases while the width between the frequencies at which the the maximum error occurs in the passband (0wwc) and in the stopband (wcw<) decreases. Gibbs phenomenon: as M increases, the maximum deviation from the ideal value decreases except near the point of discontinuity, where the error remains the same, however large the value M we choose. (i.e., as M increases, the maximum amplitude of the oscillation does not approch zero)