Digital Controls & Digital Filters Lectures 2 & 22, Professor Department of Electrical and Computer Engineering Colorado State University Spring 205
Review of Analog Filters-Cont. Types of Analog Filters: Butterworth 2 Chebyshev 3 Elliptic (Cauer) 4 Bessel Narrower Transition: () Elliptic, (2) Chebyshev, (3) Butterworth, (4) Bessel More linear phase over PB: () Bessel, (2) Butterworth, (3) Chebyshev, (4) Elliptic The first three filters have a common form of magnitude-squared function: A N ( ω 2 ) = +F ( ω 2 ) ω = ω ω c : Normalized frequency (ω c: Cutoff frequency ). Low-pass Butterworth Filters Maximally flat passband region All-pole filter For sharp cutoff, order must be large
Butterworth Filters Here F ( ω 2 ) = ω 2n and n: order or A N (ω 2 ) = ( ) + ωωc 2n ω = 0 = A N (0) = ω = ω c = A N (ω 2 c ) = 2 ω large = A N (ω 2 ) 0 Changing jω s in A N (ω 2 ) gives, A N ( s 2 ) = ) +( s 2n jωc Now, to find pole locations of this filter ( ) 2n s + jω c = 0 = sk = ( ) /2n jω c But, using ( ) /N = e j(2k )π/n, k [0, N ], we get s k = e j(2k )π/2n jω c = {sin (2k )π + j cos (2k )π }jω 2n 2n c, k [0, 2n ] There are n LH poles and n RH poles. The LH poles are the ones chosen according to the spectral factorization (or use tables).
Butterworth Filters-Cont. Disadvantages: Wide transition region (for low order filters). 2 Accuracy of approximation cannot be uniformly distributed in PB and SB regions. Example: Design a Butterworth LPF, H A(s), that has attenuation of at least 0dB at ω = 2ω c where ω c = 2.5 0 3 A N ( ω 2 ) = + ω 2n A N (2 2 ) = +2 2n 0 log 0 A N (2 2 ) 0 = ( + 2 2n ) 0 = n =.58 = n = 2 From table: H N (s) = Denormalize, s s/ω c H A(s) = H N ( s ω c ) = s 2 +.44s+.6 0 7 s 2 +5.657 0 4 s+
Butterworth Filters-Cont. Short-Cut Method: The required filter order for providing a magnitude of /A (not in db) at frequency ω can be obtained using, n = log 0 (A2 ) 2 log 0 ( ω ωc ) For previous example, 20 log 0 /A = 0 db = A = 3.3 n = log 0 (3.32 ) 2 log 0 2 =.653 = n = 2
Review of Analog Filters-Cont. 2. Lowpass Chebyshev Filters Sharper cutoff or narrower transition region. Magnitude of error is equiripple over the passband (Type I) or over the stopband (Type II). Type I Chebyshev: Magnitude-squared function is given by A N ( ω 2 ) = H N (j ω) 2 = +F ( ω 2 ) where F ( ω 2 ) = ɛ 2 C 2 n( ω) ɛ: Ripple factor (determines ripple in passband) C n( ω): n th order Chebyshev polynomial C n( ω) = cos (n cos ω) for 0 ω (passband) C n( ω) = cosh (n cosh ω) for ω > (stopband) For any n, 0 C N ( ω) for 0 ω C N ( ω) > for ω > n = = C ( ω) = ω n = 2 = C 2( ω) = 2 ω 2 n = 3 = C 3( ω) = 4 ω 3 3 ω. i.e. C n( ω) is an odd/even polynomial when n is odd/even.
Chebyshev Filters-Cont. Chebyshev polynomials can be generated recursively using, C n+( ω) + C n ( ω) = 2 ωc n( ω) For n : even, C 2 n(0) = = A(0) = +ɛ 2 For n : odd, C 2 n(0) = 0 = A(0) = max H N (jω) = A max = : Max gain in passband min H N (jω) = A min = +ɛ : Min gain in passband 2 Define: A r db = 20 log max 0 A min = 0 log 0 ( + ɛ 2 ) : Loss in passband r(peak-to-peak) = A max A min = +ɛ 2
Chebyshev Filters-Cont. To find pole locations of the Chebyshev filter, change ω = s/j and set the denominator to zero, + ɛ 2 C 2 n(s/j) = 0 = cos (n cos ( s j )) = ± j ɛ But, using s k = σ k + jω k, we get σ k = sinh ϕ sin[ (2k )π 2n ] k [0, 2n ] ω k = cosh ϕ cos[ (2k )π 2n ] k [0, 2n ] where sinh ϕ = γ γ, cosh ϕ = γ+γ, and 2 2 γ = ( + +ɛ 2 ) /n. ɛ It is interesting to note that from equations for σ k and ω k, we have, σ 2 k sinh 2 ϕ + ω2 k cosh 2 ϕ = i.e. the poles are located on an ellipse in the s-plane.
Chebyshev Filters-Cont. Example: Design a Chebyshev Type I filter with db ripple in passband and attenuation of at least 20dB at ω = 2ω c, f c = 3kHz. r = 0 log 0 ( + ɛ 2 ) = = ɛ =.05088 0 log 0 20 +ɛ 2 Cn 2 (2) Since in stopband, ɛ 2 C 2 n(2) Thus, 0 log 0 ɛ 2 + 0 log 0 C 2 n(2) 20 log 0 [cosh(n cosh 2)] log 0 ɛ =.2935 = n cosh 2 3.67 or n 2.8 = n = 3 Use Table.4 (for r = db) H N (s) = 0.493 s 3 +0.9883s 2 +.2384s+0.493 Denormalize: ω c = 2π 3 0 3 = 6π 0 3 Rad/Sec s s ω c H A(s) = 0.493.493 0 3 s 3 +2.78 0 9 s 2 +6.569 0 5 s+0.493
Review of Analog Filters-Cont. Short-Cut Method: If the magnitude of minimum stopband loss is /A at frequency ω r, then the order can be found using n = log 0 (g+ g 2 ) log 0 (ω r+ ωr 2 ) where g = A 2 ɛ 2 3. Elliptic Filters: Characteristics are: Equiripple both in passband and stopband. 2 Excellent transition region. The magnitude-squared function for elliptic filters is: A( ω 2 ) = +ɛ 2 R 2 n ( ω,κ ) R n( ω, κ ) : Chebyshev rational function with roots that are related to Jacobi elliptic functions hence called elliptic filters. κ ɛ/ A 2 : selectivity factor
Elliptic Filters Define transition ratio p = ωc ω r. Then the order of the elliptic filter to meet ɛ, A (as defined before) and ω c, ω r specs is: n = K(p)K( κ 2 ) K(κ )K( p 2 ) K(.): Complete elliptic integral of the st kind, K(x) = 0 Remarks: ( t 2 ) /2 ( xt 2 ) /2 dt In this filter, ɛ (ripple factor) determines the passband ripple, while the combination of ɛ and κ specify the stopband ripple. 2 To obtain equiripple in both passband and stopband elliptic filters must have poles on jω axis. 3 When κ the elliptic rational function becomes a Chebyshev polynomial, and therefore the filter becomes a Chebyshev Type I filter, with ripple factor ɛ. Disadvantages: Nonlinear phase characteristics. 2 Delay varies with frequency.
Review of Analog Filters-Cont. 4. Bessel Filters: Excellent phase characteristic (nearly linear). Wide transition region (disadvantage). Cutoff Frequency changes as function of n (disadvantage). All-pole filter with transfer function, H A (s) = d0 B n(s) where B n (s): n th order Bessel Polynomial B n (s) = n d i s i d i = i=0 (2n i)! 2 n i i!(n i)!, i [0, n] Bessel polynomials satisfy, B n (s) = (2n )B n (s) + s 2 B n 2 (s) with B 0 (s) = 0, B (s) = s + Cutoff Frequency varies as function of order n, ω c d /n 0
Recursive Using Bilinear z-mapping Idea: Analog systems are implemented using integrators, multipliers, and adders. Map every integrator H I(s) = /s (or h I(t) = u s(t)) to the digital domain. Convolution integral: y(t) = Let 0 < t < t 2, then t 2 y(t 2) = x(τ)h I(t τ)dτ y(t ) = 0 t 0 x(τ)h I(t τ)dτ y(t 2) y(t ) = x(τ)dτ =Area t (t 2 t ) t 2 t 0 x(τ)h I(t τ)dτ [x(t 2 ) + x(t 2)] Trapezoidal rule of integration. Let t = (n )T, t 2 = nt y(nt ) y((n )T ) = T [x((n )T ) + x(nt )] 2
Bilinear z-mapping-cont. Take z-transform: Y (z) z Y (z) = T 2 [z X(z) + X(z)] H I(z) = Y (z) = T (+z ) = T z+ X(z) 2 z 2 z Thus the mapping from s-domain to z-domain is: /s T 2 (z+) (z ) s 2 T ( z ) (+z ) : Bilinear z-mapping Once H A(s) prototype is described: H D(z) = H A(s) s= 2 T ( z ) (+z ) Properties of Bilinear z-mapping: Recall: s = 2 T (z ) 2/T +s or z = z+) 2/T s Also z = re jω, and s = σ + jω which gives
Bilinear z-mapping-properties re jω = (2/T +σ)+jω (2/T σ) jω Then equations for r and Ω become, [ ] r = (2/T +σ) 2 +ω 2 /2 (2/T σ) 2 +ω 2 Ω = tan ω 2 T +σ + tan ω 2 T σ Right half of s-plane: σ > 0 = r > : outside unit circle On jω axis: σ = 0 = r = : on unit circle Left half of s-plane: σ < 0 = r < : inside the unit circle = Stable H A (s) is mapped to stable H D (z). Additionally, it is obvious that H D (z) will have real coefficients. However, there is an issue with this mapping called warping.
Bilinear z-mapping-warping Effects For simplicity, let σ = 0 in equation of Ω, Ω = 2 tan ω 2/T = 2 tan ωt 2 or ω = 2 T tan Ω 2 : Nonlinear relation between Ω, ω Let Ω = Ω T (Normalized Ω) ω = 2 T When ΩT 2 tan ΩT 2 < 0.5, tan ΩT 2 ΩT 2 = ω Ω i.e. approximately linear portion of tangent curve. Thus, If all essential frequencies (ω c, ω r ) are below Ω = 0.3 T, no prewarping is needed since minimal warping effects and ω Ω. If not, prewarp the analog filter before bilinear z-mapping.
Bilinear z-mapping-warping Effects Note: Warping affects both magnitude and phase responses. Although, the amplitude distortion caused by warping can be remedied by prewarping, little can be done to linearize the phase except maybe using equalization methods.
Bilinear z-mapping-prewarping Procedure: If all essential frequencies are above Ω = 0.3 T, then Map all essential digital frequencies Ω i to corresponding analog frequencies using ω i = 2 T tan Ω i T 2 2 Design H A(s) using these analog frequencies ω i s. 3 Map H A(s) to H D(z) using Bilinear z-mapping. Example: Design a digital Butterworth filter that meets: T = 50 µ sec. 2 fc = 4 khz or Ω c = 25.3 0 3 Rad/sec 3 At 2 Ω c attenuation is 5dB Since Ω c 0.3 T 6000 = Prewaring is needed We prewarp both Ω c and 2 Ω c, using
Bilinear z-mapping-cont. ω c = 2 T tan Ω ct 2 29. 0 3 Rad/sec ω 5dB = 2 T tan 2 Ω ct 2 = 23. 0 3 Rad/sec We now use these frequencies to design H A(s) H A(jω) 2 = ( ) + ωωc 2n 0 log 0 +( 23. From Table.2: H N (s) = 29. ) 2n s 2 +.442s+ Denormalize s s/ω c 5dB = n.2 = n = 2 H A(s) = (29 0 3 ) 2 s 2 +4.5 0 3 s+(29 0 3 ) 2 H D(z) = H A(s) s= 2 T z = 2.7+4.234z +2.7z 2 +z 0.232 3.766z +2.002z 2