0% found this document useful (0 votes)
13 views16 pages

Digital Signal Processoer

DSP notes of Ashok ambadar.

Uploaded by

Bunty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
13 views16 pages

Digital Signal Processoer

DSP notes of Ashok ambadar.

Uploaded by

Bunty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 16
Chapter 9 DESIGN OF IIR FILTERS 9.0 Scope and Objectives ‘This chapter begins with an introduetion to IIR filters, and the various mappings that are used to con- vert analog filters to digital filters, It then describes the design of IIR digital filters based on an analog Iowpass prototype that. meets the given specifications, followed by an appropriate mapping and spectral transformation. The bilinear transformation and its applications are discussed in detail 9.1 Introduction ‘Typical magnitude and phase specifications for TIR filters are identical to those for FIR filters. Digital filter design revolves around two distinctly different approaches. If linear phase is not critical, IIR filters yield a. much smaller filter order for a given application. The design starts with an analog lowpass prototype based on the given specifications. It is then converted to the required digital filter, using an appropriate mapping and an appropriate spectral transformation, A causal, stable HR filter can never display linear phase for several reasons, The transfer function of a linear-phase filter must correspond to a symmetric sequence and ensure that H(z) = -+H(—1/2). For every pole inside the unit circle, there is a reciprocal pole outside the unit circle. This makes the system unstable (if causal) or noncausal (if stable). To make the infinitely long symmetric impulse response sequence of an IIR filter causal, we need an infinite delay, which is not practical, and symmetric truncation (to preserve linear phase) simply transforms the IIR filter into an FIR filter 9.2 IIR Filter Design There are two related approaches for the design of IR digital filters. A popular method is based on using methods of well-established analog filter design, followed by a mapping that converts the analog filter to the digital filter. Am alternative method is based on designing the digital filter directly, using digital equivalents of analog (or other) approximations, Any transformation of an analog filter to a digital filter should ideally preserve both the response and stability of the analog filter. In practice, this is seldom possible because of the effects of sampling. 9.2.1 Equivalence of Analog and Digital Systems ‘The impulse response A(#) of an analog system may be approximated by N= halth=te Y> AHH(e— nt.) =t. J lnt,)6(E— nts) (a1) 362 Ashok Amaedae, September 1, 2005 9.2_IIR Filter Design 363 Here, t, is the sampling interval corresponding to the sampling rate $ = 1/t,. ‘The discrete-time impulse response h,(n] describes the samples h(nt.) of h(t) and may be written as hala] = Wnts) = Shel — A] (9.2) ‘The Laplace transform #,(s) of y(t) and the etransform H(2) off H(s) = Hals) = te J) lity)em* Halz)= So halle (93) c “oe Comparison suggests the equivalence Ha(s) = tsHa(2) provided 2-* = e+, or zoel 5 n(2)/t, (04) ‘These relations describe a mapping between the variables = and s. Since s = + jw, where w is the continuous frequency, we can express the complex variable = as forint be a ptagiats = pttigi (05) Here, © = wt, = 2x f/S = 2xP is the digital frequency in radians/sample ‘The sampled signal h.g[n] has a periodic spectrum given by its DTFT: HS) = > HUE-#S) (9.6) IF the analog signal h(t) is band-limited to B and sampled above the Nyquist rate ($ > 2B), the principal period (0.5 < F < 0.5) of Hy(f) equals SH(f), a scaled version of the true spectrum H(). We may thus relate the analog and digital systems by HP) =tHy(F) or HalNleniany © teHal2)le li < 0.58 (9.7) IFS < 2B, we have aliasing, and this relationship no longer holds. sing ‘The relations = => e%* and s => In(=)/te do not describe a one-to-one mapping between the s-plane and the plane. Since e" is periodic with period 2z, all frequencies Q% + 2kx (corresponding to wy + hws, where , = 2n$) are mapped to the same point in the z-plane. A one-to-one mapping is thus possible only if ties in the principal range ~x <0 < x (or 0 < © < 2x), corresponding to the analog frequency range ~.5w. Sw 0.5us (or 0 < w < wa). Figure 9.1 illustrates how the mapping = = e* translates points in the «domain to corresponding points in the =-domain. ‘The origin: ‘The origin 5 = 0 is mapped to z = 1, as are all other points corresponding to 8 = which 22 edbeots = gikoe 9.2.2 The Effects of Ali + jew, for ‘The jw-axis: For points on the ju-axis, o =o, and [2] = 1. As w increases from wa to wo + ws, the frequency ® increases from M9 to M+ 2x, and segments of the jw-axis of length w, = 2x5 thus map to the unit eirele, over and over. Ashok Arardae, September 1, 2005 364 Chapter 9 Design of IIR Filters solane the splane origin is mapped to : spl ae Segments ofthe eax of ength “Se mapped othe unit cele. Rel] Strip of width inthe LHP are mapped oa, iho ine ma ‘nit circle Figure 9.1. Characteristics of the mapping = > exp(st.) ‘The left half-plane: In the left half-plane, o <0. Thus, = €"!e!" or |2| = e* <1, This describes the interior of the unit circle in the 2-plane. In other words, strips of width w, in the left half of the s-plane are ‘mapped to the interior of the unit circle, over and over. ‘The right half-plane: In the right half-plane, ¢ > 0, and we sce that |2| = e% > 1. Thu «sy in the right half of the s-plane are repeatedly mapped to the exterior of the unit circle. strips of width, REVIEW PANEL 9.1 ‘The Mapping = = e*- Is Not a Unique One-to-One Mapping Strips of width w, = 2x8 (along the ju-axis) in the left half of the plane map to the interior of the unit circle, over and over 9.2.3 Practical Mappings ‘The transcendental nature of the transformation # + In(2)/t, does not permit direct conversion of a rational transfer function H(s) to a rational transfer function H(z). Nor does it permit a one-to-one correspondence for frequencies higher than 0.55 Hz. A unique representation in the 2-plane is possible only for band-limited signals sampled above the Nyquist rate. Praetieal mappings are based on one of the following methods: 1. Mate 2, Matching terms in a factored H(s) (the matched >transform) ng, the time response (the response-invariant transformation) 3. Conversion of system differential equations to difference equations 4. Rational approximations for 2 = e+ or s = In(z)/ts In general, each method results in different mapping rules, and leads to different forms for the digital filter H(=) from a given analog filter H(s), and not all methods preserve stability. When comparing, the frequency response, it is helpful to remember that the analog frequency range 0 < f < 0.58 for the freque response of H(s) corresponds to the digital frequeney range 0 < F < 0.5 for the frequeney response of H ‘The time-domain response ean be compared only at the sampling instants ¢ = nt. 9.3 Response Matching The idea behind response matching is to match the time-domain analog and digital response for a given input, typially the impulse response or step response. Given the analog fier H(), and the input 2(0) whose invariance we sock, we first find the analog response y(¢) as the inverso transform of H(s)X(e). We Ashok Amaedae, September 1, 2005 9.3 Response Matching 365, then sample 2(f) and y(t) at intervals t, to obtain their sampled versions x{n] and y{n). Finally, we compute H(z) = ¥(2)/X(z) to obtain the digital filter. The process is illustrated in Figure 9.2, Sample C—O ET Ss 6 se Figure 9.2 The concept of response invariance Response-invariant matching yields a transfer function that is a good match only for the time-clomain response to the input for which it was designed. It may not provide « good match for the response to other inputs. The quality of the approximation depends on the choice of the sampling interval f,, and a unique correspondence is possible only ifthe sampling rate S = 1/t, is above the Nyquist rate (to avoid aliasing). ‘This mapping is thus useful only for analog systems such as lowpass and bandpass filters, whose frequency response is essentially band-Limited. This also implies that the analog transfer function H1(s) must be strictly proper (with mumerator degree less than the denominator degree), REVIEW PANEL 0.2 Response-Invariant Mappings Match the Time Response of the Analog and Digital Filter The response y(é) of H(s) matches the response y[n] of H(z) at the sampling instants EXAMPLE 9.1 (Response-Invariant Mappings) (a) Convert H(s) = : i” a digital filter H(z), using impulse invariance, with t, = 1 s. + For impulse invariance, we select the input as 2(t) = 6(¢). We then find X(s) ¥(s) = M9) X19) = Sa y(t) = e~tu(t) ‘The sampled versions of the input and output are x(n] = 6 ln] =e" un ‘Taking the ratio of their >transforms and using t, = 1, we obtain ¥( 203079 X@) ‘The frequency response of H(s) and H(z) is compared in Figure E9.1(a) Ashok Arardae, September 1, 2005 366 Chapter 9 Design of IIR Filters i | few 3S Sa : Pigure B9.1 Frequency response of H(s) and H(2) for Example 9.1(a) ‘The de gain of H(s) (at 4 = 0) is unity, but that of H(z) (at z = 1) is 1.582. Even if we normalize the de gain of H(z) to unity, as in Figure B9.1(b), we see that the frequency response of the analog and digital filters is different. However, the analog impulse response h(t) = e~* matches hn] = e~uln] at the sampling instants t = nt, =n. A perfect match for the time-domain response, for which the filter ‘was designed, lies at the heart of response invariant mappings. The time-domain response to any other inputs will be different. For example, the step response of the analog filter is 1 i (sti) s S47 S(s) a(t) = (1 e-)u(e) To find the step response S(z) of the digital filter whose input is uln] + 2/(z — 1), we use partial fractions on S(2)/z to obtain S(2)= = ‘The sampled version of s(¢) is quite different from s[r]. Figure E9.1A reveals that, at the sampling instants ¢ = nt., the impulse response of the two filters shows a perfect match, but the step response does not, and neither will the time-domain response to any other input. (a) Impulse respons of analog and digital iter () Step response of analog and digital fier ' 2 2 gis eos a1 2 2 os ° 0 2 + 6 0 2 4 6 DV index» and sine mt, DD index» and ime mt, Figure E9.1A Impulse response and step response of H(s) and H() for Example 9.1(a) (b) Convert H(s) = to H(z), using various response-invariant transformations. 4 BFDGHH 1 mp invariance eos) =: Ten (0) =a re) = myx wap wate) tet) Ashok Amaedae, September 1, 2005 9.3 Response Matching 367 ‘The sampled input and output are then 4e-™ ul] — dem?" =n) ub ‘The ratio of their =transforms yields the transfer function of the digital filter as Y@) _ 4a 4z Ms) = $3 =¥) 2. Step invariance: We choose x(¢) = u(t). Then, X(s) = 1/s, and ‘ 5 WE = tert +202) ¥() = HOX() = ayes See ea ‘The sampled input and output are then |r) = uf] ln] = (2 — de“ + 2e-2""* uf] ‘Their =transforms give X(2) er ‘The ratio of their =transforms yields the transfer function of the digital filter as 3. Ramp invariance: We choose 2(#) = r(0) =tu(t). Then, X(s) = 1/s2, and SS PF Ie+2) ¥() = Y(t) = (342 +4 ‘The sampled input and output are then an] = ntsuln] ln) = (-8-+ nt, + denM — 2" juh ‘Their =transforms give aa GaP * re ate z 1? ¥() X(2) i = Te ‘The ratio of their =transforms yields the transfer function of the digital filter as A(e—1? (2-1)? enemy -se-1) | lute Ashok Arardae, September 1, 2005 368 Chapter 9 Design of IIR Filters 9.3.1 The Impulse-Invariant ‘Transformation ‘The impulse-invariant mapping yields some useful design relations, We start with a first-order analog filter described by H(s) = 1/(s +p). The impulse response h(#), and its sampled version hn], are A(t) = e*u(t) fn] = eum] = (€-%)” ul] (9.8) ‘The stransform of hln] (which has the form au(n), where a = eM), yields the transfer function (2) of the digital filter as (2) = [2] >? (9.9) ‘This relation suggests that we ean go direetly from H(s) to #2), using the mapping 1 : moo (0.10) We can now extend this result to fiters of higher order. If H(s) isin partial fraction form, we can obtain simple expressions for impulse-invariant mapping. If H(s) has no repeated roots, it can be described as a sum of first-order terms, using partial fraction expansion, and each term ean be converted by the impulse-invariant rapping to give A) = Hi) = AE, ROG [a] > een co.) Here, the region of convergence of H(=) is in terms of the largest pole magnitude [plus of H(s). REVIEW PANEL 9.3 Impulse-Invariant Design Requires /1(s) in Partial Fraction Form 1 atm (for each term in the partial fraction expansion) If the denominator of H(s) also contains repeated roots, we start with a typi root of multiplicity M, and find kth term Hy(s) with a His) = M-1ePety(t) (9.12) ‘The sampled version hyn), and its >transform, can then be found by the times-n property of the transform. Similarly, quadratie terms corresponding to complex conjugate poles in H1(s) may also be simplified to obtai areal form. These results are listed in Table 9.1. Note that impulse-invariant design requires H(s) in partial fraction form and yields digital filter H(=) in the same form. Tt must be reassembled if we need a composite rational function form. The left half-plane poles of H(s) (corresponding to px > 0) map into poles of H(=) that lie inside the unit circle (corresponding to = = eM" < 1). Thus, a stable analog filter H(s) is transformed into a stable digital filter H(2). REVIEW PANEL 9.4 Impulse-Invariant Mappings Are Prone to Aliasing but Preserve Stabi ‘The analog impulse response h(t) matches h{n] at the sampling instants, Impulse-invariant mappings are not suitable for highpass or bandstop filter design, ity Ashok Amaedae, September 1, 2005 9.3 Response Matching 369 ‘Table 9.1 Impulse-Invariant: Transformations Term Form of H1(s) H(2) (with « = 6") Distinct = oy a) can | ee Ae ‘A.cos(M) ~ 2Aaz cos(+ at) stpeia’ stp ia = Bas costal) +0 Repeated twice as oF Repeated thrice | _4__ eae EXAMPLE 0.2 (Impulse-Invariant Mappings) : ist (2) Convert (6) = BEES First, by partial fractions, we obtain to H(z), using impulse invariance at $= 2 Hz. As+7 4s+7 HO)= Fyase4 ~ GEG TA The impulse-invariant transformation, with t, = 1/S = 0.5 s, gives 4:3 — 1.9549. O.7A19= + 0.0821 4 ADE TET ‘The partial fraction form for H(s) is (b) Convert H(s) = to H(z), using impulse invariance, with f, = 0.5». For the second term, we write K = (-1 ~ j) = VBe~#*/* = Ac!®, Thus, A= v3 and 9 = We also have p= 2, q=1, and a =e" = 1/e. With these values, Table 9.1 gives _g 2VB=* con(— BF) — 2V2(=/e)oos( 0.5 B= 2(eJe}oosi z H(2) ‘This result simplifies to 0.214624 + 0.09302 1.25225? + 0.5270= — 0.0821 ‘Comment: The first step involved partial fractions. Note that we cannot compute H(=) as the cascade 1 ofthe ipa ga en fr #0) = 22 and 3 SEaes5 Ashok Arardae, September 1, 2005 370 Chapter 9 Design of IIR Filters 9.3.2 Modifications to Impulse-Invariant Design Gain Matehing ‘The mapping H(s) = 1/(s+ px) > H(2) = 2/(2— e-®*») reveals that the de gain of the analog term H(s) (with s = 0) equals 1/p, but the de gain of the digital term H(2) (with z = 1) is 1/(1—e-P*). If the sampling interval f, is small enough such that pat, <1, we ean use the approximation ePte = 1 — put, to give the de gain of H(2) as 1/p4t,. This suggests that the transfer funetion H(z) must be multiplied by 1, in order for its de gain to closely match the de gain of the analog filter H(s). This scaling is not needed if we normalize (divide) the analog frequency specifications by the sampling frequency $ before designing the digital filter, because normalization is equivalent to choosing t, = 1 during the mapping. In practice, regaciless of normalization, it is customary to scale H(s) to KH(2), where the constant 1 is chosen to imatch the gain of H(s) and KH(2) at a convenient frequency (typically, de). Since the scale factor also changes the impulse response of the digital filter from h[n] to Kh[n), the design is now no longer strietly impulse invariant. REVIEW PANEL 9.5 Gain Matching at de in Impulse-Invariant Design Design H(2) from H(s), compute K = H(s)|o=0/H and multiply H(2) by K. pulse-invariant method suffers from errors in sampling h(t) if i shows a jump at t= 0. If A(O) is not zero, the sampled value at the origin should be chosen as 0.5h(0). As a result, the impulse response of the digital filter must be modified to hay[n] = h{n] — 0.54(0)é[n}. ‘This leads to the modified transfer function Hyy(z) = H(z) — 0.5h(0). The simplest way to find (0) is to use the initial value theorem (0) = lim, $H(s). Since h(0) is nonzero only if the degree 'V of the denominator of H(s) exceeds the degree AF of its numerator by 1, we need this modification only EXAMPLE 9.3 (Modified Impulse-Inv: (a) (Impulse-Invariant Design) Convert the analog filter H(s) = ——, with a cutoff frequency of 1 rad/s, to a digital filter with a cutoff frequency of fe = 10 Ha and'S = 60 He, using impulse invariance and gain matching. ‘There are actually two ways to do this: 1. We normalize by the sampling frequency $, which allows us to use f, = 1 in all subsequent computations. Normalization gives Qc = 2xfe/S = $. We denormalize H(s) to Qe to get mi =H(G-) z s+5 Finally, with t = impulse invariance gives 1.04722 ~ 20.8509 Ashok Amaedae, September 1, 2005 9.3 Response Matching 371 2. We first denormalize H(s) to fo to get ths) = (5 aye)" a 5+ 205 Wo use impulse invariance and multiply the resulting digital filter transfer funetion by f, to get 2 af Loar: Mal=) = amis = Fea = F080 Comment: Both approaches yield identical results, The first method automatically accounts for the gain matching. For a perfect gain match at de, we should multiply H(z) by the gain factor 1 _ 1-0.3509 *= Fa) ~ oie (b) (Modified Impulse-Invariant Design) 1 Convert (a) = <5 10 a digital filter, with ty = 1s, using modified impulse invariance to account for sampling errors and gain matching at de. Using impulse invariance, the transfer funetion of the digital filter is HG) = est = 205075 Since h(t) = e~'u(t), h(t) has a jump of 1 unit at t= 0, and thus h(0) = 1. ‘The modified impulse- invariant mapping thus gives Hy(2) = H(2) ~0.54(0) O.5(s + 0.3079) == 0079 ‘The de gain of H(s) is unity. We compute the de gain of H() and Hay(2) (with : = 1) as eal 8 Hy? = 0st 5 = 1.082 For unit de gain, the transfer functions of the original and modified digital filter become 2 0.6321: S822 0.3679, 0.5(2 +e") _ 0.4621(2 + 0.3679) oe 1.3679 Figure E9.3B compares the response of H(s), H| the improvement due to each modification, H(z), Has(2), and Hyn(z). It clearly reveals Ashok Arardae, September 1, 2005 372 Chapter 9 Design of IIR Filters Impulse-invariant design for Hts) = 11) (ashe) 1s fo 10s; i SS? | os —— , | ° v1 32 35 0a Os Digital hequency F Figure E9.8B Response of the various filters for Example 9.3(b) (c) (Modified Impulse-Invariant Design) Convert the analog filter H(s) = ote invariance to account for sampling errors. toa digital filter, with t, = 0.5 s, using modified impulse Since the numerator degree is M = 1 and the denominator degree is J ‘8 modification is needed. The initial value theorem gives 2, we have NM =1, and 4s? Fast 44 7/0 (0) = Jim s#1(3) = i =e ‘The transfer function of the digital filter using impulsc-invariant mapping was found in part (a) as ‘The modified transfer function is thus 0.1642 + 0.0821 Hu(2) H(z) — 0.5h(0) (a) (Modified Impulse-Invariant Design) 4 GFE FE+5) © (if required) to account for sampling errors. Convert H(s) = to a digital filter, with f, = 0.5 s, using modified impulse invari- Since the nnmerator degree is M = 0 and the denominator degree is N= 3, we have NM = 3, Since this does not equal 1, the initial value is zero, and no modification is required. The transfer function of the digital filter using impulse-invariant mapping is thus 0.0821 382 Chapter 9 Design of HR Filters (©) For the forward difference operator, the DTFT yields ¥(F) = Xp(P)e*F — X,(P) = X,(Pyle** — 1] ‘The ratio Hp(F)/Hp(F) may be expanded as He(B) Ho(F) +idone)— Laney + Again, we observe correspondence only at low digital frequencies (or high sampling rates). The high frequencies are amplified, making the algorithm susceptible to high-frequency noise. The phase response also deviates from the true phase, especially at high frequencies. (A) For the central difference algorith . we find Ho(F)/Hp(F) as Hel) _ sin(2nF) Ao(F) 1 deenky + Eonr)'+ We see a perfect match only for the phase at all frequencies. 9.5.7 Mappings from Rational Approximations Some of the mappings that we have derived from numerical algorithms may also be viewed as rational approximations of the transformations z ~+e"** and s— In(2)/ty. The forward-difference mapping is based on a first-order approximation for = = e* and yields zae™ w+ ste, Ste <1 ee (9.25) The backward-difference mapping is based on a first-order approximation for ete and yields : ty tee om (020) ‘The trapezoidal mapping is based on a first-order rational function approximation of s = In(z)/t,, with In(z) described by a power series, and yields (927) 9.6 The Bilinear Transformation If we generalize the mapping based on the trapezoidal rule by letting C transformation, defined by ts, we obtain the bilinear (9.28) 9.6 The Bilinear Transformation 383 I we let ¢ = 0, we obtain the complex variable = in the form C+ jw _ 2 een (9.29) Since z = &, where = 2nF is the digital frequency, we find /C) w= Ctan(0.50) (9.30) ‘This isa nonlinear elation between the analog frequency we and the digital frequency ®. When w = 0,0 = 0. and as « + 00, +7. It is thus @ one-to-one mapping that nonlinearly compresses the analog, frequency range —90 < f < 20 to the digital frequency range —7

You might also like