EEE35, EEE8 Part A : Digital Signal Proceing Chapter 5 Deign of IIR Filter 5. Introduction IIR filter deign primarily concentrate on the magnitude repone of the filter and regard the phae repone a econdary. The mot common deign method for digital IIR filter i baed on deigning an analogue IIR filter and then converting it to an equivalent digital filter. There are many clae of analogue low-pa filter, uch a the Butterworth, Chebyhev and Elliptic filter. The clae differ in their nature of their magnitude and phae repone. The deign of analogue filter other than low-pa i baed on frequency tranformation, which produce an equivalent high-pa, band-pa, or band-top filter from a prototype low-pa filter of the ame cla. The analogue IIR filter i then converted into a imilar digital filter uing a relevant tranformation method. There are three main method of tranformation, the impule invariant method, the backward difference method, and the bilinear -tranform. 5. IIR Filter Baic A recurive filter involve feedback. In other word, the output value are calculated uing one or more of the previou output, a well a input. In mot cae a recurive filter ha an impule repone which theoretically continue forever. It i therefore referred to a an infinite impule repone (IIR) filter. Auming the filter i caual, o that the impule repone h[n] for n <, it follow that h[n] cannot be ymmetrical in form. Therefore, an IIR filter cannot diplay pure linear-phae characteritic like it adverary, the FIR filter. The finite difference equation and tranfer function of an IIR filter i decribed by Equation 3.3 and Equation 3.4 repectively. In general, the deign of an IIR filter uually involve one or more trategically placed pole and ero in the -plane, to approximate a deired frequency repone. An analogue filter can alway be decribed by a frequencydomain tranfer function of the general form, hown in Equation 5.. ( )( )( 3) H ( ) K (5.) ( p )( p )( p ) 3 Where i the Laplace variable and K i a contant, or gain factor. The filter i characteried by it pole p, p, p 3, and it ero,, 3, which can be plotted in the complex -plane. The frequency repone of the filter H(ω), can be obtained by replacing jω into Equation 5.. The complete repone of the filter i then generated by varying ω in Equation 5. between and. ( jω )( jω )( jω 3) H ( ω ) K (5.) ( jω p )( jω p )( jω p ) 3 5.3 Analogue Low-pa Filter There are everal clae of analogue low-pa filter, three of which are the Butterworth, Chebyhev and Elliptic. Thee filter differ in the poition of their and in the nature of their magnitude and phae repone. Their frequency repone are illutrated in Figure 5. below. The Butterworth filter i aid to be monotonic at all frequencie (i.e. no local maxima or minima), the Chebyhev i monotonic in the top-band and equiripple in the pa-band, and an Elliptic filter i equiripple in all band. Univerity of Newcatle upon Tyne Page 5.
EEE35, EEE8 Part A : Digital Signal Proceing Pa-band ripple.5 db Filter order n 3 ω o.5.77 Chebyhev filter H(ω) Ideal low-pa filter Butterworth filter Elliptic filter ω o Frequency ω Figure 5.: Typical frequency repone of variou analogue low-pa filter. 5.4 The Bilinear -tranform One of the mot effective and widely ued technique for converting an analogue filter into a digital equivalent i by mean of the bilinear -tranform. In thi method, we replace in equation (5.) by the bilinear -tranform: F ( ) (5.3) to give the following function of : 3 ( ) H K (5.4) p p p3 The frequency repone of thi -tranfer function i obtained by ubtituting e jω in Equation (5.4). The reult of doing thi i mot eaily een by making thi ubtitution firt in the function F() in equation (5.3): e F Ω) e e e e e jω jω jω ( jω jω jω Subtituting thi into equation (5.4) we obtain: ( Ω) jin co ( Ω ) ( Ω ) Ω j tan [ j tan( Ω ) ] [ j tan( Ω ) ][ j tan( Ω ) 3 ] [ j tan( Ω ) p ][ j tan( Ω ) p ][ j tan( Ω ) p ] H K (5.8) The frequency repone of a deirable analogue filter wa given by Equation (5.). The function H(Ω) in equation (5.8) take all value of the frequency repone of the analogue filter, but compreed into the range Ω π. Note that the compreion of the frequency cale i non-linear. The hape of the tan function, a depicted in Figure 5., mean that the warping effect i mall near Ω, but increae greatly toward Ω π/. 3 (5.7) Univerity of Newcatle upon Tyne Page 5.
EEE35, EEE8 Part A : Digital Signal Proceing 8 Function ωtan(ω/) 6 4 ω - -4-6 -8 π/ π 3π/ π (Ω/) Figure 5.: The "warping" effect of the tan function. There are everal advantage in uing the bilinear - tranform. Firtly, the equiripple amplitude propertie of the filter are preerved when the frequency axi i compreed. Secondly, there i no aliaing of the original analogue frequency repone. A a reult, the repone of a low-pa filter fall to ero at Ω π. Thi i an extremely important feature in many practical application. The principle of the bilinear -tranform, by making the ubtitution of Equation 5.6, i illutrated in Figure 5.3 below. It how that the imaginary axi in the -plane ( jω) map into the unit circle of the - plane. Imag Imag Real Real -plane -plane Figure 5.3: Illutration of -plane to -plane mapping uing the bilinear -tranform. The ubtitution map the left-hand ide of the -plane to the inide of the unit circle in the -plane. Thi enure that the Nyquit tability criterion i obeyed and therefore filter tability i preerved. To overcome the frequency warping introduced by the bilinear -tranform, it i common practice to pre-warp the pecification of the analogue filter, o that after warping they will be located at the deired frequencie. For example, uppoe we wih to deign a digital low-pa filter with a cut-off frequency Ω c. We firt tranform thi frequency to the analogue-domain cut-off frequency ω ac, uing the pre-warping relationhip of Equation (5.9). Ωc ω ac k tan k or (5.9) T We then proceed to deign the analogue filter uing the correponding cut-off frequency, obtained from Equation (5.9). After the analogue filter ha been tranformed uing the bilinear -tranform, the reulting digital filter will have it cutoff frequency in the correct place. Since pre-warping i performed in the beginning of the deign procedure, and bilinear tranformation i performed at the end, the value of k i immaterial. Univerity of Newcatle upon Tyne Page 5.3
EEE35, EEE8 Part A : Digital Signal Proceing 5.5 Frequency Tranformation The deign of analogue filter other than low-pa i uually achieved by deigning a low-pa filter of the deired cla e.g. Butterworth, Chebyhev, or Elliptic, and then tranforming the reulting filter to get the deired frequency repone e.g. high-pa, band-pa, or band-top. Thi i accomplihed by ubtituting the frequency-domain tranfer function H() with one of the relevant frequency tranformation lited below. Where ω and ω are the band-edge frequencie of the deired filter and are alo poitive parameter atifying ω > ω. Low-pa to Low-pa tranformation: Low-pa to High-pa tranformation Low-pa to Band-pa tranformation Low-pa to Band-top tranformation (5.) ω ac ω ac (5.) ωω ( ω ω ) (5.) ( ω (5.3) ω) ωω 5.6 Summary of IIR Filter Deign Uing the Bilinear -tranform Ue the digital filter pecification to determine a uitable normalied frequency-domain tranfer function H(). Determine the cut-off frequency of the digital filter Ω c. Obtain the equivalent analogue filter cut-off frequency ω ac uing the pre-warping function of Equation 5.9. Denormalie the analogue filter by frequency caling H(), with one of the appropriate frequency tranformation e.g. /ω ac etc. Apply the bilinear -tranform to obtain the digital filter tranfer function H() by replacing with ( - )/( ). 5.6. Example Deign a digital filter equivalent of a nd order Butterworth low-pa filter with a cut-off frequency f c H and a ampling frequency f ample/ec. Derive the finite difference equation and draw the realiation tructure of the filter. Given that the analogue prototype of the frequency-domain tranfer function H() for a Butterworth filter i: H ( ) The normalied cut-off frequency of the digital filter i given by the following equation: Ω c πf f c π.68 Now determine the equivalent analogue filter cut-off frequency ω ac, uing the pre-warping function of Equation 5.9. The value of K i immaterial o let K. ω ac Ω K tan c tan ω ac.35 rad /ec.68 Univerity of Newcatle upon Tyne Page 5.4
EEE35, EEE8 Part A : Digital Signal Proceing Now denormalie the frequency-domain tranfer function H() of the Butterworth filter, with the correponding lowpa to low-pa frequency tranformation of Equation 5.. Hence the tranfer function of the Butterworth filter become: H ).35 (.35 Next, convert the analogue filter into an equivalent digital filter by applying the bilinear -tranform. Thi i achieved by making a ubtitution for in the tranfer function. H ( ).35.35 H Y( ) X ( ).67.35.67.49.47 ( ) The finite difference equation of the filter i found by inverting the tranfer function. y ( n).49y( n ).47 y( n ).67x( n).35x( n ).67x( n ) The tranfer equation H() above, reemble the direct tructure of Equation 3.3, from Chapter 3. So the realiation of thi filter follow the ame format a Figure 3.9, where the correponding coefficient a, a, b, b, and b are taken from the Equation above. x[n].67 y[n] -.49.35 - -.47.67 Figure 5.4: Direct realiation for a nd order Butterworth equivalent filter. 5.7 Z-Plane Pole and Zero A very ueful repreentation of a -tranform i obtained by plotting it pole and ero in the complex plane. It i quite eay to viualie the frequency repone from uch a diagram and it alo give a good indication of the degree of tability of a ytem. The frequency-elective propertie of firt and econd-order ytem can be controlled by the appropriate choice of the pole-ero location. Pole are particularly effective in thi repect becaue when they are placed cloe to the unit circle they produce harp, well-defined peak in the frequency repone. Uually an equal number of ero are then placed at the -plane origin (, ) to enure that the impule repone begin at n. The frequency repone of a firt-order ytem i defined by Equation 5.4 below; it ha one real pole at the location α and one real ero at the origin. The frequency repone of a econd-order ytem i alo defined by Equation 5.5; it ha two pole (either both real or a Univerity of Newcatle upon Tyne Page 5.5
EEE35, EEE8 Part A : Digital Signal Proceing complex conjugate pair) at the location r exp(jθ) and r exp(-jθ). In addition, it alo ha two ero at the origin. (a) 4 3 (a) r.9, θ h[n] 5 5 5 3 35 4 45 5 n 8 H(Ω ) 6 4 π Ω (b) 4 (b) r.99, θ 5 h[n] - -4 5 5 5 3 35 4 45 5 n 5 H(Ω ) 5 π Ω (c).5 (c) r.8, θ h[n] -.5-5 5 5 3 35 4 45 5 n 3 H(Ω ) π Ω (d) 4 (d) r.9, θ 8 h[n] - -4 5 5 5 3 35 4 45 5 n 8 H(Ω ) 6 4 π Ω Univerity of Newcatle upon Tyne Page 5.6
EEE35, EEE8 Part A : Digital Signal Proceing Figure 5.5: The impule and frequency repone of everal econd-order ytem. H( ) α H ) [ r exp( jθ ) ][ r exp( jθ ) ( ] (5.4) (5.5) By uing the trigonometric repreentation of the exponential function, Equation 5.5 can be re-written a Equation 5.6, after multiplying out the denominator. H ) [ r coθ ( r ] (5.6) By changing the parameter r and θ, the impule repone h[n] and frequency repone magnitude H(Ω) vary. Some typical reult are illutrated in Figure 5.3 for variou econd-order ytem. In illutration (a) of Figure 5.3, the value of r.9, θ how that thi configuration i a low-pa ytem with a econd-order pole on the real axi in the - plane. The choice of r.9 give a moderately elective frequency repone. In illutration (b), r.99 and θ 5 deg. The pole are now much cloer to the unit circle, giving a very elective frequency-domain characteritic H(Ω). In the time-domain, the impule repone i prolonged, with the frequency of ocillation correponding to θ 5 deg, which relate to 4 H. Diagram (c) illutrate the reult for r.8, θ deg. Thi ytem i much le elective in the frequency domain, o it impule repone i hort. Finally, (d) ha r.9 and θ 8 deg, producing a high-pa counterpart of the low-pa ytem hown in (a), but with the frequency repone centered at Ω π. 5.8 Finite Word Length Effect in IIR Filter In general IIR filter are much more difficult to analye than FIR filter becaue of the feedback tructure. However, both type of filter uffer from the ame problem and have the ame ource of noie due to finite word length effect. The extent of filter degradation depend on the length of the word and the type of arithmetic (fixed or floating point) ued to perform the filtering operation. A ummary of the main four ource of noie and their correponding effect on IIR filter performance are ummaried in Table 5.. Source of noie Affect on performance Reduction technique A/D converion. Quantiation noie q Increae number of bit. /. Ue multirate technique. Ue double word length for Caue low level limit cycle i.e. intermediate reult. ocillation at the filter output, or Optimie filter tructure to Arithmetic round off. output tuck at a nonero value, include error pectral haping. even when there i no input. Add a dither ignal before rounding. Coefficient quantiation. Arithmetic overflow. Modifie poition of the pole and ero, may caue intability and a change in the frequency repone. Incorrect output ignal. Table 5.: Finite word length effect in IIR filter. Ue ufficient No. of bit in fixed-point repreentation. Optimie election of filter coefficient. Ue floating-point arithmetic. Scale filter coefficient (at cot of reduced SNR). Detect and ue maximum rather than overflowed value. Ue floating-point arithmetic. 5.8. Arithmetic Round-Off Arithmetic round off, can caue low-level limit cycle to occur in IIR filter. Thee can caue ocillation of the filter output, or the output to remain tuck at a non-ero value, even when there i no input. For example, conider the Univerity of Newcatle upon Tyne Page 5.7
EEE35, EEE8 Part A : Digital Signal Proceing following output of a t order IIR filter, a hown in Figure 5.6, with a 4-bit data and regiter length. Notice how the output ocillate between [-, ]. 6 y(n) x(n).75y(n-) 4 4 6 8 - -4-6 Figure 5.6: Low-level limit cycle caued by arithmetic round off. Low-level limit cycle, a illutrated by Figure 5.6, can be reduced by uing longer regiter or by adding a dither ignal before rounding. In addition, arithmetic round off can alo be reduced by utiliing feedback and feedforward path in the nd order ection, often known a error pectral haping (ESS). 5.8. Coefficient Quantiation If an error i introduced during coefficient quantiation, it can caue the pole and ero to deviate from their expected poition and change the deired frequency repone. If a pole poition i moved outide of the unit circle then thi will caue intability in the filter. Now let u examine the effect of finite word length on the poition of the pole-ero placement in the -domain of the unit circle. 5.8.. Firt-Order Sytem Conider a firt-order ytem with a ingle pole at poition b and a ero at the origin, a depicted in Figure 5.7 below. Imag b δ Real Figure 5.7: A ingle pole at b in the domain, and a ero at the origin. The -tranfer function of thi firt-order filter i given by the equation below: H ( ) ( b ) The change δ in b that would caue the pole to lie at, i defined below: ( b δ ) ( b δ ) δ b Univerity of Newcatle upon Tyne Page 5.8
EEE35, EEE8 Part A : Digital Signal Proceing A an example, let u aume that the poition of the pole wa located at b.95. Then, from the equation above, δ.5. Now let u aume that the pecification of the filter coefficient i not permitted to exceed % of the value of δ. Therefore the preciion of the filter coefficient ha to be accurate to within.5. The minimum number of bit that i required to meet thi pecification, after rounding, i given below: log () x log log.5 log () ( ).966 Furthermore, an additional bit ha to be added to x for the mantia (or ign) of the filter coefficient, o the total number of bit required to meet thi pecification i. 5.8.. Double Pole at b Now let u conider a econd-order ytem with a double pole at poition b and two ero at the origin. The - tranfer function of thi econd-order filter i given by thi equation: H ( ) ( b ) b b a a The δ change in coefficient a that would caue one of the two pole to lie at, i defined by equation ( a δ ) a, evaluated at : ( a δ ) a δ ( a a) ( b b ) ( b ) Uing the ame value for b.95, then δ can be evaluated: δ (.5).5 with a correponding coefficient wordlength requirement of: log (4) x log log ( 4) 5.87 6 ( for the ign bit).5 log () We can therefore conclude that fewer bit are required by implementing the filter a a cacade of two firt-order ection rather than a ingle econd-order ection. It i fairly eay to generalie thi reult to higher order and tate that implementing a digital filter a a cacade of firt or econd-order ection alway reult in horter coefficient wordlength requirement than if it were implemented a a ingle high order ection. 5.8..3 Second-Order Sytem Now let u examine the cae of a econd-order complex conjugate pole pair with a double ero at the origin, a illutrated in Figure 5.8. The -tranfer function of thi econd-order filter i given by the equation below: H ) a a [ r coθ ( r ] where r and θ ( a r).5 a co For tability the pole mut lie within the unit circle, atifying the condition: a < and a a (derivation not given here, and i not required for thi coure) A an example, let u conider the econd-order Butterworth filter deigned in ection 5.6.. The coefficient value turned out to be a -.49 and a.47. Calculate δ and δ (correponding to the two condition above) that would put the pole on the unit circle..47 δ < reulting in the condition δ. 47 Univerity of Newcatle upon Tyne Page 5.9
EEE35, EEE8 Part A : Digital Signal Proceing.49 δ.47 reulting in the condition δ. 698 Imag π Real Figure 5.8: A complex conjugate pole pair and a double ero at the origin. Now let u aume that the pecification of the filter coefficient i not permitted to exceed % of the lowet value of δ (δ.698). Therefore the preciion of the filter coefficient ha to be accurate to within.698. The minimum number of bit that i required to meet thi pecification, after rounding up, i given below:.49.698.698 74.898 x log (74.898) x 9.5339 log () (rounded up) Furthermore, an additional bit ha to be added to x for the mantia (or ign) of the filter coefficient, o the total number of bit required to meet thi pecification i. Univerity of Newcatle upon Tyne Page 5.