Deign of Digital Filter
Paley-Wiener Theorem [ ] ( ) If h n i a caual energy ignal, then ln H e dω< B where B i a finite upper bound. One implication of the Paley-Wiener theorem i that a tranfer function can be zero at iolated point but it cannot be zero over a frequency range of finite width becaue, if it were, the integral would be infinite ( ε) (ln a ε 0).
Implication of Cauality [ n] [ n] e [ n] [ ] [ ] [ n] If a ytem' impule repone h i caual, then it i poible to determine h from it even part h where [ n] [ ] = [ n] + [ n] [ ] [ ] h n + h n h n h n h e[ n] = and h o =, 2 2 h i the odd part and h n h h. o e o [ n] hen [ ] = [ ] [ ] = e[ ] + o[ ] = e + o h[ n] u[ n] + h[ n] u[ n] h[ n] + h[ 0] δ [ n] h [ n] u[ n] = = If h i caual t ( ) [ ] [ ] [ ] [ ] [ ] h n h n u n h n h n u n h n u n h n u n and e 2 2 [ n] = [ n] [ n] [ ] δ [ n] h 2h u h 0 e
Implication of Cauality [ n] [ ] = [ ] = [ ] [ n] = [ n] [ n] [ ] δ [ n] [ n] e [ n] [ n] [ n] [ ] δ[ n] ( [ n] [ n] [ ] δ[ n] ) Since h 0 0, h 0 h 0 and h 2 h u h 0. Therefore a caual h can be found from h alone and h o = o e e e 2h u h 0 2h u h 0 e e e e [ n] [ n] e[ n] [ n] [ n] [ n] [ n] = h u h u e proving that both h and h can be found from h. o 2 e
Implication of Cauality The Fourier tranform of any even function i purely real and the Fourier tranform of any odd function i purely imaginary. Therefore ( ) ( ) the real part H e of H e R for a caual ytem i completely [ ] ( ) I j determined by h n, o i the imaginary part H e Ω and therefore e the real and imaginary part are interrelated and cannot be pecified eparately. It alo follow that the magnitude and phae cannot be pecified eparately either.
Implication of Cauality F [ ] ( h n H e ) F [ ] [ ] [ ] [ ] ( ) ( ) ( n n δ n π e e ) [ ] 2h u h 0 2 1/2 H U h 0 e e R e ( ) ( ) [ ] ( ) ( jλ ) j( Ω λ) = e + π R H e h 0 1/ H e U e dλ 1 where u U 2 1 e F [ ] ( n e ) = + π δ( Ω πk) π π k=
Implication of Cauality ( x) ( x) ( e e ) ( Ω) ( ) x in Ω in cot = cot = 2 1 co 2 1 co Ω e e j Ω j2 e e cot = = j 2 e + e 2 e e 1 2 1 j Ω 1 1 e e cot = 2 2 2 2 2 2 e e Ω 2 e e e + e 1 e = = 22 2 e e 1 j Ω 1 e 1 cot = = 2 2 2 1 e ( 1 )( e 1 e )
Implication of Cauality π jλ 1 j Ω λ H( e ) = he[ 0] + ( 1/ π) HR( e ) cot + π δ( Ω λ 2πk) dλ 2 2 2 π k= π jλ 1 j Ω λ H( e ) = he[ 0] + ( 1/ π) HR( e ) cot + πδ( Ω λ) dλ, π <Ω< π 2 2 2 π π jλ jλ Ω λ H( e ) = he[ 0] + ( 1/ 2π) H R( e ) dλ ( j/ 2π) HR( e ) cot dλ+ H R( e ), 2 π ( e ) = ( j π ) π π -π < Ω< π π π π π 1 1 1 h0 [ ] = H( e ) d HR( e ) jhi ( e ) d HR( e ) d jhi ( e ) d 2π Ω= 2π + Ω= 2π Ω+ Ω π π π π even odd H / 2 H 1 h[ 0] = he[ 0] = HR( e ) dω 2π π π R π π Ω λ cot λ+ H, -π <Ω< π 2 jλ j ( e ) d R( e Ω )
From the previou lide, Implication of Cauality ( ) ( ) ( jλ H / 2 H ) Ω λ cot H ( e = j π ) R e dλ+ R e, -π <Ω< π 2 Subtract the real part from both ide. ( ) ( ) ( jλ ) R ( ) ( ) jh e = j/ 2π H e cot Ω λ / 2 dλ, -π <Ω< π I π π π π π ( ) 1 H H ( jλ ) Ω λ I e = R e cot dλ 2π 2 π, -π <Ω< π Thi integral i called the dicrete Hilbert tranform. It how how the real part and imaginary part of the tranfer function of a caual ytem are interrelated.
Filter Specification For dicrete-time ytem decribed by difference equation the tranfer function i a ratio of polynomial in z. H Filter of thi type are caual and cannot be ideal. Ideal filter are pecifed by their paband and topband. k= 0 ( z) = 1+ N N k= 1 bz k k k az k
Filter Specification A typical practical-filter pecification uually include everal element, 1. one or more pa band, 2. one or more top band, 3. tranition band between pa and top band, 4. allowable ripple in the pa band(), and 5. minimum required attenuation in the top band().
Filter Specification The actual filter mut have a magnitude repone that lie totally within the white area of the pecification.
Filter Specification Ripple refer to the variation of a filter tranfer function magnitude in it paband. Stopband Attenuation refer to the number of db by which the filter tranfer function magnitude in the topband i reduced compared with the paband.
FIR Filter Deign If an FIR filter ha a ymmetric impule repone [ n] = [ M n] h h 1 or an antiymmetric impule repone it ha a linear phae. [ n] = [ M n] h h 1
FIR Filter Deign If a filter ha an antiymmetric impule repone ( M ) M 1 3/3 M 1 ( ) [ ] ( ) [ ] H e = h n = h M 1 /2 + h n + h n Ω= 0 Let m= M 1 n. Then ( M ) ( ) [ ] ( ) ( e ) = [ n] + [ M n] { } [ ] ( ) n= 0 n= 0 n= M+ 1 /2 = 0 Ω= 0 Ω= 0 3/2 0 H e = h n + h M 1 m n= 0 m= M 3 /2 ( M ) H h h 1 ( M ) 3/2 3/2 n= 0 n= 0 [ ] [ n] [ n] { } = h h = 0 Therefore, it frequency repone at zero frequency i zero and it could not be ued a a lowpa filter. It can alo be hown that if M i odd, it cannot be a highpa filter either.
FIR Filter Deign A traightforward deign proce i to firt find the impule repone of an ideal filter (which i non-caual), then truncate the impule repone o that all it value for time n< 0 and n> M 1 are zero. Then modify the hape of the impule repone by multiplying it by a window choen to reduce paband ripple and increae topband attenuation. Conider a lowpa filter or H j2π Fn e j F ( 2π e ) H ( e ) = 0, 0 < F < F c A 0, Fc < F < 1/ 2 n0 e, 0 <Ω<Ω c = A 0, Ω c < Ω < π
FIR Filter Deign It impule repone i [ n] = AF F ( n n ) h 2 inc 2 c ( ) AΩ Ω AΩ = inc ( n n ) = π π π c c c 0 truncate the impule repone below n c 0 in The center point of the inc function i at n= n we get an FIR filter with 2n + 1 coefficient. 0 c ( n n0 ) ( n n ) ( Ω ) Ω c 0 0. If we 0 and above 2n = 0
FIR Filter Deign For example, let F = 0.1 Ω = 0.2 π, A= 1 and n = 15. c c 0
FIR Filter Deign We can reduce paband ripple and increae topband attenuation by multiplying the truncated impule repone by a von Hann window 1 2π n w[ n] = 1 co 2 N 1 0 n< N
FIR Filter Deign Some common window are 1 2π n von Hann w[ n] = 1 co, 0 2 n N N 1 < 2π n Hamming w[ n] = 0.54 0.46co, 0 n< N N 1 2πn 4πn Blackman w[ n] = 0.42 0.5co + 0.08co, 0 n< N N 1 N 1 2 2 N 1 N 1 I 0 ωa n 2 2 Kaier w[ n] = N 1 I0 ωa 2 where I i the modified zeroth order Beel function of the firt kind and ω a 0 i a parameter adjuted to trade off between tranition bandwidth and ide-lobe amplitude.
FIR Filter Deign
FIR Filter Deign
Approximating Standard Analog Filter There are multiple method for approximating analog filter with digital filter. We will conider ix, approximation of derivative, impule invariance, tep invariance, direct ubtitution, the matched z-tranform and the bilinear z tranform.
Approximation of Derivative ( t+ t) x( t) d x A derivative i defined by x () t = lim. If we dt t 0 t jut make t mall, but not zero, we approximate the derivative with a finite difference ( t+ t) ( t) [ n+ ] [ n] d x x x 1 x x () t = dt t T Thi i called a forward difference. We can alo approximate a derivative with a backward difference. () t ( t t) [ n] [ n ] d x x x x 1 x () t = dt t T Becaue a backward difference i caual and i the invere of the n m = [ ] accumulation operation x m, it i uually ued.
Approximation of Derivative In the Laplace domain, multiplication by i equivalent to a time derivative. The firt backward difference in dicrete time 1 1 z z 1 i equivalent to a multiplication by = in the z domain. T zt So the 1 1 z ubtitution convert -domain expreion into T 1 1 z 1 z-domain expreion. The relationhip = or z = i T 1 T a mapping between the and z plane.
Approximation of Derivative Letting = σ + jω, 1 1 σt jωt z = = + 1 + 1 + 1 + 2 2 2 2 ( σ jω) T ( σt ) ( ωt ) ( σt ) ( ωt ) 1 jωt For the pecial cae of σ = 0, z = + and the ω 2 2 1+ 1+ ( ωt ) ( ωt ) axi map into a circle of radiu 1/ 2, centered at z = 1/ 2. For the 1 pecial cae ω = 0, z = and for any negative value of σ, z lie 1 σ T on the real axi between z = 0 and z = 1. Overall, the left half of the plane map into the interior of the circle decribed above. Therefore table -domain filter map into table z-domain filter. But a highpa analog filter doe not become a highpa digital filter.
Approximation of Derivative ( z) Example Simulate H ( ) = uing a ampling rate of 1 khz. 2 5 + 400+ 2 10 1 1 z T H z ( z) = 2 5 = 1 2 + 400+ 2 10 1 z 1 1 1 z 1 z T 5 400 2 10 T + + T H z For f = 1000 ( T = 1/1000), = T ( z) ( 1) z z ( 5 2) 2 ( ) 1+ 400T + 2 10 T z 2 + 400T z+ 1 H = 6.25 10 z 4 z 2 ( 1) z z 1.5z + 0.625
Approximation of Derivative Example [ ] 4 [ ] [ ] ( ) [ ] [ ] y n = 6.25 10 x n x n 1 + 1.5 y n 1 0.625y n 2
Impule and Step Invariant Deign Impule invariant deign make the impule repone of the digital filter be a ampled verion of the impule repone of the analog filter. Step invariant deign make the tep repone of the digital filter be a ampled verion of the tep repone of the analog filter.
Impule and Step Invariant Impule Invariant Deign: Deign 1 L ( ) () Sampling [ ] ( ) Z H h t h n H z z -Domain Continuou- Dicrete- z-domain tranfer time impule time impule tranfer function repone repone function Step Invariant Deign: ( ) 1 ( ) ( ) L Sampling H H-1, h 1 t -Domain tranfer function Sampling Laplace tranform of tep repone [ n] Z h 1 Continuoutime tep repone Dicretetime tep repone H 1, z z Tranform of tep repone z 1 z ( z) H ( z) z z-domain tranfer function
Impule Invariant Example Simulate H ( ) = uing a ampling rate of 1 khz. 2 5 + 400+ 2 10 The continuou-time impule repone i 200t 1 h () t = e co( 400t) in ( 400t) u ( t). 2 The dicrete-time impule repone i n 1 h[ n] = ( 0.8187) co( 0.4n) in ( 0.4n) u [ n]. 2 The z-domain tranfer function i ( z) ( ) ( ) Y z z 0.9135 H z ( z) = =. 2 X z z 1.508z+ 0.6703
Impule Invariant Example A comparion of frequency repone reveal that the impule invariant digital filter ha a peak gain that i a factor of about 1200 too large. Alo, the gain at zero frequency i not zero a it i in the analog filter. Thi i undeirable for a filter that i intended to be bandpa. Alo, the gain fall from the peak but doe not go to zero at high frequencie a in the analog cae. The peak gain can be eaily compenated for but the non-zero, zero-frequency gain cannot. The gain error near half the ampling rate will alway be wrong due to aliaing, therefore an increae in ampling rate will improve the deign.
Step Invariant Example Simulate H ( ) = uing a ampling rate of 1 khz. 2 5 + 400+ 2 10 The continuou-time tep repone i 200t ( ) e ( t) 1 H in 400 h 1 () t = L = 400 The dicrete-time tep repone i ( nt ) 200nT e in 400 h 1[ n] = 400 The z-domain tranfer function i u [ n] u () t ( z 1) z 1 ( ) ( [ ]) 4 H z z = Z h 1 n = 7.97 10 2 z z 1.509z+ 0.6708
Step Invariant Example The peak gain i correct and the gain at zero frequency i zero a it hould be. The aliaing effect near half the ampling rate i there a in the impule-invariant cae and can only be minimized by increaing the ampling rate.
Direct Subtitution and Matched z Tranform A popular approach to the deign of digital filter i to find a tranformation from to z which map the plane into the z plane, convert the pole and zero of the -domain tranfer function into appropriate correponding location in the z plane and convert table -domain ytem into table z-domain ytem. The mot common technique that ue thi idea are the matched z tranform, direct ubtitution and the bilinear tranformation.
Direct Subtitution and Matched z Tranform To directly tranform -domain tranfer function into z-domain tranfer function we need a relationhip between and z. The relation between dicrete- and continuou-time frequencie i Ω= ωτ. If we map ω to Ω thi way it i equivalent to mapping ω value in the plane to to z value on the unit circle through jωt z = e. If we generalize to value anywhere in the complex T plane, we get z = e. Thi mapping can be ued to map pole and zero in the plane into pole and zero in the z plane.
Direct Subtitution and Matched z Tranform Suppoe we have a pole or zero at T 0 in the z plane i z e. = = 0. It correponding location
Direct Subtitution and Matched z Tranform There are two cloely-related method for mapping pole and zero from the to the z plane. If there i a factor in the numerator or denominator of the tranfer function of the form a, we can replace it with z e or with at Direct Subtitution at -1 1 e z Matched z Tranform The only difference i an extra delay in the matched z tranform.
( z) Matched z Tranform Example Simulate H ( ) = uing the matched z 2 5 + 400+ 2 10 tranform and a ampling rate of 1 khz. H ha a zero at = 0 and pole at = 200 ± j400. H z ( ) = = z e e 200± j400 T 0.2± j0.4 = 0.7541± j0.3188 1 1 z = 1 1. 509z + 0.6708z z( z 1) = 2 z 1.509z + 0.6708 1 2 ( )
Bilinear Tranformation ( z) = ( ) 1 ln ( ) ( ) ( ) ( ) ( ) T A natural idea i to ue the mapping z = e or = 1/ T ln z to form H H. But thi tranform a rational z z T function of into a rational function of 1/ T ln z. Thi function i trancendental and ha infinitely many pole and/or zero. One way to avoid thi problem i to ue an approximation to the exponential function. Start with the infinite-erie expreion e x 2 x 3 x = 1+ x+ + 2! k x + = 3! k! and truncate the erie after two term. k= 0
Bilinear Tranformation Truncating the infinite-erie after two term yield 1+ T z ( ) ( ) or z 1 / T. For mall T therefore high ampling rate thi i a good approximation. Thi i identical to approximating a derivative with a forward difference. Thi mapping map the entire left half of the plane into the interior of the z plane infinitely many time. Alo, for ome ampling rate, thi mapping can convert a table ytem in to an untable ytem in z. A very clever modification olve both problem. Write the tranformation T /2 T e a e = z and then approximate the numerator and T e /2 denominator eparately by truncating the erie to two term.
Bilinear Tranformation 1 + T /2 2 z 1 Thi lat approximation yield z or. 1 T /2 T z + 1 Thi i called the bilinear (not bilateral) tranformation. Thi mapping ha the favorable quality that the left half of the plane map into the interior of the unit circle in the z plane only one time and table -domain filter are tranformed into table z-domain filter.
Bilinear Tranformation The bilinear tranformation ha a "warping" effect becaue of the way the = jω axi i mapped into the unit circle in the z plane. Letting z = e with Ω real determine the unit circle in the z plane. The correponding contour in the plane i Ω= ( ωt ) 1 or 2 tan / 2. 2 e 1 2 Ω = = j tan T e + 1 T 2