iirfirEECS 451 DESIGN OF IIR DIGITAL FILTERSGoal: Design IIR (Infinite Impulse Response) digital filtersFrom: Butterworth, Chebyschev and elliptic analog filters.Why? #coefficients→ ∞, so too hard to do directly.Given: Analog lowpass (or whatever) filter Ha(s).Want: Digital lowpass (or whatever) filter H(z).Mapping: Clearly need to substitute mapping s → zso that: (1) s = jΩ → z = ejω; (2) R e[s] < 0 → |z| < 1 (stability preserved).1. Backward difference: s ⇔ddt≈x(nT )−x((n−1)T )T. Need T << 1.Mapping: s = (1 − z−1)/T → H(z) = Ha(s = (1 − z−1)/T ). Example: p. 670.Props: (1) Imag axis NOT mapped to unit circle; (2) stability preserved.Imag axis→circle |z −12| =12; tangent to |z| = 1 f or z ≈ 1 (DC).2. Impulse invariance: h(n) = ha(t = nT ). Sample impulse response.Cont: Ha(s) =Ppk=1cks−pk⇔ ha(t) =Ppk=1ckepktu(t). Substitute t = nT :Disc: H(z) =Ppk=1ck1−epkTz−1⇔ h(n) =Ppk=1ckepkT nu(n) = ha(t = nT ).Sampling: Can also interpret as sampling h(t) (see p. 671-673; not worth it).”Mapping”: z = esTmaps poles, not zeros! Apply to partial fraction of Ha(s).Example: Ha(s) =s+0.1(s+0.1)2+9=1/2s−(−0.1+j3)+1/2s−(−0.1−j3)⇔ ha(t) = e−0.1tcos(3t)u(t).(p. 675) H(z) =1/21−e(−0.1+j3)Tz−1+1/21−e(−0.1−j3)Tz−1⇔ h(n) = e−0.1nTcos(3nT )u(n).3. Bilinear Transform: s =2T1−z−11+z−1. ”Bilinear”=ratio of linears.On the imaginary axis: s = jΩ and z = ejω→ Ω =2Ttanω2.Why? Can be derived from trapezoidal rule for integr ation (previous HO).Props: (1) Imag axis mapped to unit circle; (2) stability preserved (p. 678).Example: Ha(s) =s+0.1(s+0.1)2+16. Want resonant freq. Ω = 4 to map to ω =π2.(p. 679) Ω =2Ttanω2→ 4 =2Ttanπ4→ T =12.Insert s = 41−z−11+z−1in Ha(s) → H(z) =0.128+0.006z−1−0.122z−21+0.0006z−1+0.975z−2. Poles: 0.987e±jπ/2.Frequency Warping: Need to prewarp Ω due to Ω =2Ttanω2:Example: Design one-pole lowpass filter with 3 dB bandwidth of 0.2π.(p. 680) Ω =2Ttan(0.1π) =0.65T→ Ha(s) =0.65/Ts+0.65/T(one-po le analog LPF).Insert s =2T1−z−11+z−1→ H(z) =0.245(1+z−1)1−0.509z−1. T cancels! |H(ej0.2π)| = 0.707.EECS 451 IIR DIGITAL FILTERS DESIGN EXAMPLEGiven: Ha(s) = 1000/(s + 1000) ⇔ ha(t) = 1000e−1000tu(t) (1-pole filter).Goal: Map this analog filter to 3 digital IIR filters using the following:Backward differences, impulse invariance, bilinear transformation.Analog: |H(jΩ)| = 1000/√Ω2+ 106. 3 dB freq=1000 radians/sec≈160 Hz.Sample: Suggests sampling rate of 1000 Hz→ T = 0.001 seconds=1 m s.Backward s =1−z−1T= 1000(1 − z−1) → H(z) =10001000(1−z−1)+1000= 1/(2 − z−1).difference H(ej0) = 1/(2 −1) = 1. H(ejπ) = 1/(2 − (−1)) = 1/3. Lowpass.Impulse h(n) = T ha(nT ) = (0.001)(1000)e−(1000)(0.001)n= e−n, n ≥ 0.invariance H(z) = 1/(1 − e−1z−1) since pole at −1000 → e−1000(0.001)= e−1.H(ej0) = 1/(1 −e−1) ≈ 1.58. H(ejπ) = 1/(1 + e−1) ≈ 0.73. Lowpass.Bilinear s =2Tz−1z+1→ H(z) = 1000/[2000z−1z+1+ 1000] = (z + 1)/(3z − 1).transform H(ej0) = 1. H(ejπ) = 0. Lowpass; now has zero at −1.s=jΩ s =2Tz−1z+1⇔ z = (1 + sT /2)/(1 − sT/2). Now set s = jΩ:maps to z = (1 + jΩT/2)/(1 −jΩT/2) = (1 + jΩT/2)/(1 + jΩT/2 )∗→ |z| = 1.z=ejωImaginary axis (cont. time) mapped to unit circle (discrete time).Prewarp s =2T(z − 1)/(z + 1)|z=ejω=2T(ejω− 1)/(ejω+ 1). Now set s = jΩ:formula jΩ =2T[ejω/2(ejω/2− e−jω/2)]/[ejω/2(ejω/2+ e−jω/2)] = j2Ttanω2.Matlab: [BD,AD]=bilinear(BC,AC,F); substitutes s = 2Fz−1z+1in Ha(s).Ha(s) has numerator coefficients BC and denominator AC.H(z) has numerator coefficients BD and denominator AD.F=1/T (not T–watch this!). N eed row vectors of coefficients.Matlab: [B,A]=butter(N,W); designs digital Butterworthfilter of order N with cutoff f requency W= ωo/π.Use [B,A]=butter(N,W,’s’); to get analog filter.EECS 451 IIR FILTER DESIGN EXAMPLEGoal: Design a digital IIR lowpass filter with sampling rate 3600 Hz.using: Bilinear transformation (T=2) of Butterworth low-pass filter.Specs: DC gain: 0 dB. Cutoff: 600 Hz. Gain: -86 dB at 1200 Hz.Cutoff: Sampling: ωc= 2π6003600=π3. Bilinear: Ωc=2Ttanωc2=1√3.Gain: Sampling: ωg= 2π12003600=2π3. Bilinear: Ωg=2Ttanωg2=√3.Specs: Analog Butterworth filter drops 86 dB in frequency ra tio√31/√3= 3.Order: Analog Butterworth filter order=(86 dB)/(20 log103) = 9 (rounded).Poles: Analog Butterworth poles: ωcexp[j(π2+(2k+1)π2N)] for k = 0 . . . N −1.Here: 9 poles at1√3ejθfor θ=100,120,140,160,180,200,220,240,260 degrees.Transfer: Ha(s) = 1/[(s −p1)(s − p2) . . . (s − p9)] for 9 poles pk, to scale factor.Then: Bilinear transform ation: Set s =2Tz−1z+1=z−1z+1in the above Ha(s):Get: H(z) = 1/[(z−1z+1− p1)(z−1z+1− p2) . . . (z−1z+1− p9)] which simplifies toH(z) = (z + 1)9/[((z −1) −p1(z + 1)) . . . ((z −1) −p9(z + 1))] becomesH(z) = (z + 1)9/[a0z9+ a1z8+ . . . + a9] → ARMA difference equationa0y(n)+a1y(n-1)+. . . + a9y(n-9)=x(n)+9x(n-1)+36x(n-2)+84x(n-3)+126x(n-4)+126x(n-5)+84x(n-6)+36x(n-7)+9x(n-8)+x(n-9).Note: Using analog filter to design digital filter to implement analog filter.Problem #2 of Problem Set #9: Single-Pole FiltersGiven: Ha(s) =as+a. DC gain=a0+a=1. 3 dB freq.=a. Gain=0 at ω → ∞.Bilinear:(T=2) H(z) = a/[z−1z+1+ a] =a(z+1)(z−1)+a(z+1)=a(z+1)(a+1)z+(a−1).DC gain=a(1+1)(a+1)(1)+(a−1)= 1 at ω = 0 after setting z = ej0= +1.Gain=0=a(−1+1)(a+1)(−1)+(a−1)= 0 at ω = π after setting z = ejπ= −1.3 dB: |a/[ejω−1ejω+1+ a]|=1√2→ ja=ejω−1ejω+1=j tanω2→ ω = 2 tan−1a.Prewarp a: Ω = a ⇔ ω = 2 ta n−1a. Then have Ω = tana2⇔ ω = a.Then: Ha(s) =tan(a/2)s+tan(a/2)and s =z−1z+1→ H(z) = tan(a/2)/[z−1z+1+ tan(a/2)].H(ejω) = tan(a/2)/[ejω−1ejω+1+tan(a/2)] = tan(a/2)/[j tan(ω/2)+tan(a/2)].3 dB: ω = a → |H(eja)| = |tan(a/2)/[j tan(a/2) + tan(a/2)]|
View Full Document