Lecture 4: March 13, 2007 Topic: 1. Uniform Frequency-Sampling Methods (cont.) 1 Lecture 4: March 13, 2007 Topics: 1. Nonrecursive FIR Filter Design by DFT Applications (cont.) 2. Nonrecursive FIR Filter Design by Direct Computation of Unit Sample Response 3. Recursive FIR Filter Design 2 4.2.3. Uniform Frequency-Sampling Method B. Nonrecursive FIR Filter Design by DFT Applications 3 4.2.3. Uniform Frequency-Sampling Method B. Nonrecursive FIR Filter Design by DFT Applications • specification of the desired frequency response at a set of equally spaced frequencies, • solving for the unit sample response h(n) of the linear phase FIR filter from these equally spaced specification based on DFT application. M 1 y ( n) h( k ) x ( n k ) k 0 M 1 H (e j ) h(k )e j k k 0 4 Suppose that we specify the frequency response of the filter at the frequencies 2 n n M Then, we obtain: H (e H (e jn jn M 1 H (e j ) h(k )e jk k 0 2 n ) H n H H (n) M M 1 ) H ( n) h( k )e jkn k 0 for n 0,1,2, M 1 h ( k )e jk 2 n M k 0 , M 1 5 It is a simple matter to identify the previous expression as DFT of h(k): M 1 H ( n ) h ( k )e j 2 nk M H (n) DFT h(k ) k 0 Thus, we obtain h(k ) DFT 1 h( k ) M M 1 H ( n)e j 2 nk M 1 H ( n) k 0,1,2, 2 n n M , M 1 n 0 This expression allows to compute h(k) from H(n), where frequency response is specified at the set of equally spaced frequencies. Notice: H(n) has to be specified correctly! 6 Important property of H(n) : H ( n) H ( M n ) H ( M n) H ( n) for n= 1, 2, …, M-1 Proof: M 1 H ( M n ) h ( k )e j 2 k ( M n ) M k 0 M 1 h(k )e j 2 kM M e j M 1 h(k )e j 2 k ( M n ) M k 0 2 k ( n ) M k 0 M 1 h(k )e j 2 k e j 2 kn M k 0 M 1 h(k )e k 0 j 2 kn M H ( n) 7 Frequency response of the linear phase FIR digital filters: M 1 j n 2 H (e jn ) H r ( n )e H (e j n 2 n ) H (n) 1 H r e M n j n M Proof: H (e jn ) H r (n )e jn M 1 2 2 n Hr e M j 2 n M 1 M 2 M 1 nM n j n j j 2 n 2 n M M M Hr e H e e r M M 2 n j n Hr e e M j n M 2 n 1 H r e M n j n M 8 Uniform Frequency-Sampling Method B. : A Review 1. Specification of H(n) by: n j 2 n M H (n) 1 H r e M n H ( M n) H ( n) for n= 1, 2, …, M-1 2. Computation of h(k) by: 1 1 h(k ) DFT H (n) M M 1 H ( n )e j 2 nk M n 0 for k= 0, 1, 2, …, M-1 9 Example: Determine the coefficients h(k) of a linear phase FIR filter of length M=15, frequency response of which satisfies the condition: 2 n 1 n 0,1,2,3 Hr 15 0 n 4,5,6,7 Solution: 2 n H (n) 1 H r e M n H ( M n) H ( n) j n M 2 n 1 H r e 15 n j n 15 for n= 1, 2, …, M-1 10 n j 2 n 15 H (n) 1 H r e 15 n H (0) 1 1.2 H (1) 1 H r 15 1 e j 1 15 e j 15 H ( M n) H ( n) H (14) H (15 1) H (1) e 2.2 H (2) 1 H r 15 2 e j 2 15 e j 3.2 H (3) 1 H r 15 e j 3 15 e 15 2 15 H (13) H (15 2) H (2) e 3 j j j 2 15 3 15 H (12) H (15 3) H (3) e j 3 15 11 H (4) 0 H (11) H (15 4) H (4) 0 H (5) 0 H (10) H (15 5) H (5) 0 H (6) 0 H (9) H (15 6) H (6) 0 H (7) 0 H (8) H (15 7) H (7) 0 H ( M n) H ( n) 2 n H (n) 1 H r e 15 n j n 15 12 151 j 1 1 h(k ) DFT H (n) H (n)e 15 n0 2 nk 15 j 1 14 H ( n)e 15 n0 2 nk 15 for k= 0, 1, 2, …, M-1 13 By using MATLAB (function ifft.m) the following filter coefficients can be obtained: h(0)=h(14)= -0.0498 h(1)=h(13)= 0.0412 h(2)=h(12)= 0.0667 h(3)=h(11)= -0.0365 h(4)=h(10)= -0.1079 h(5)=h(9)= 0.0341 h(6)=h(8)= 0.3189 h(7)= 0.4667 14 Example Solution: Magnitude Response H e j 15 4.2.4. Uniform Frequency-Sampling Method C. Nonrecursive FIR Filter Design by Direct Computation of Unit Sample Response 16 4.2.4. Uniform Frequency-Sampling Method C. Nonrecursive FIR Filter Design by Direct Computation of Unit Sample Response 17 4.2.4. Uniform Frequency-Sampling Method C. Nonrecursive FIR Filter Design by Direct Computation of Unit Sample Response 2 n We have shown that H (n) 1 H r e M n j n M It is more convenient, however, to define the samples H(n) of the frequency response for the FIR filter as H ( n ) G ( n )e j n M where 2 n G (n) 1 H r M n 18 2 n Hr R M G (k ) R H ( M n) H ( n) for n= 1, 2, …, M-1 G (n) G ( M n) for n= 1, 2, …, M-1 M : even M G 2 0 19 Proof: H (n) H ( M n) and H (n) G (n)e H ( n ) G ( M n )e G ( M n )e H ( n ) G ( n )e G ( M n)e j n M j j ( M n ) j M M M e j G ( M n )e n M j j n M ( M n ) G ( M n)e M j n M n M G ( n )e j n M G (n) G ( M n) for n= 1, 2, …, M-1 20 In the view of the symmetry for the real-valued frequency samples G(n), it is a simple matter to determine an expression for h(k) in terms of G(n). If M is even, we have: kn n nk M 1 j j j 1 M 1 1 h( k ) H (n)e M G (n)e M e M M n 0 M n 0 1 M M 1 G(k )e j n (2 k 1) M n 0 21 In the view of the symmetry for the real-valued frequency samples G(n), it is a simple matter to determine an expression for h(k) in terms of G(n). If M is even, we have: kn n nk M 1 j j j 1 M 1 1 h( k ) H (n)e M G (n)e M e M M n 0 M n 0 1 M M 1 G(k )e j n (2 k 1) M n 0 G(n) GM(M n) for n 1,2,..., M 1 1 n (2 k 1) ( M n )(2 k 1) 2 j j 1 M M e G (0) G (n) e M n 1 22 Because: e j ( M n )(2 k 1) M e j e 2 kM M j M e ( M n )2 k ( M n ) j 2 nk M e j M M e j e n M j M ( M n )2 k e j n M e j M ( M n ) 2 k 1 23 We can get: n (2 k 1) n (2 k 1) M j j 1 M M 2 1 e e h( k ) G (0) 2 G (n) M 2 n 1 M 1 2 1 n h( k ) G (0) 2 G (n)cos 2k 1 M M n 1 for k= 0, 1, 2, …, M-1 24 Thus we can compute h(k) directly from the specified frequency samples G(n) or equivalently, H(n) (method 3). This approach eliminates the need for a matrix inversion (method 1) or for direct DFT computation (method 2) for determining the unit sample response of the linear phase FIR filter from its frequency-domain specification. 25 Thus we can compute h(k) directly from the specified frequency samples G(n) or equivalently, H(n) (method 3). This approach eliminates the need for a matrix inversion (method 1) or for direct DFT computation (method 2) for determining the unit sample response of the linear phase FIR filter from its frequency-domain specification. 26 Thus we can compute h(k) directly from the specified frequency samples G(n) or equivalently, H(n) (method 3). This approach eliminates the need for a matrix inversion (method 1) or for direct DFT computation (method 2) for determining the unit sample response of the linear phase FIR filter from its frequency-domain specification. 27 Summary on the Uniform Frequency-Sampling Method 3. 28 1. Unit Sample Response: Symmetrical, 0 H (k ) G(k )e j k / M , k 0,1, , M 1 2 k G (k ) 1 H r M k G (k ) G ( M k ) 1 h( n) M U k G (0) 2 G (k )cos 2n 1 M k 1 M 1 U for M odd 2 M U 1 for M even 2 29 1 2. Unit Sample Response: Symmetrical, 2 1 1 j / 2 j (2 k 1) / 2 M H k G k e e 2 2 2 1 1 k G k 1 H r k 2 2 M 1 1 Gk G M k 2 2 2 h( n) M 1 2 G k sin 2 M k 0 U 1 1 k n 2 2 30 3. Unit Sample Response: Antisymmetrical, 0 H (k ) G(k )e j / 2e j k / M , k 0,1, 2 k G (k ) 1 H r M G (k ) G ( M k ) k 2 h( n) M ( M 1) / 2 k 1 G (k )sin , M 1 k M 2n 1 for M odd ( M / 2) 1 1 k n 1 h( n) 2n 1 1 G ( M / 2) 2 G ( k )sin M M k 1 for M even 31 1 4. Unit Sample Response: Antisymmetrical, 2 1 1 j (2 k 1) / 2 M H k G k e 2 2 2 1 1 k G k 1 H r k 2 2 M 1 1 M G k G M k ; G 0 for M even 2 2 2 2 h( n) M 1 2 G k cos 2 M k 0 V M 1 V for M odd 2 1 1 k n 2 2 M V 1 for M even 32 2 Example: Determine the coefficients h(n) of a linear phase FIR filter of length M=15 with symmetrical impulse response, frequency response of which satisfies the condition: 2 k 1 k 0,1,2,3 Hr 15 0 k 4,5,6,7 33 Solution: Unit Sample Response: Symmetrical, 0 H (k ) G(k )e j k / M , k 0,1, , M 1 2 k G (k ) 1 H r M k G (k ) G ( M k ) 1 h( n) M U k G (0) 2 G (k )cos 2n 1 M k 1 M 1 U for M odd 2 M U 1 for M even 2 34 k 2 k 2 k G (k ) 1 H r 1 H r M 15 k 0.2 G (0) 1 H r 15 1 1.2 G (1) 1 H r 15 1 2.2 G (2) 1 H r 15 3 3.2 1 G (3) 1 H r 15 1 0 2 1 G (4) G (5) G (6) G (7) 0 2 k 1 k 0,1,2,3 Hr 15 0 k 4,5,6,7 35 M 1 15 1 14 U 7 2 2 2 7 1 k h(n) G (0) 2 G (k )cos 2n 1 15 15 k 1 1 h(n) G (0) 2 X (n) 15 X (n) G (1)cos 2n 1 15 2 3 G (2)cos 2n 1 G (3)cos 2n 1 36 15 15 n0 1 2 3 h(0) 1 2 cos cos cos 15 15 15 15 1 1 2 0.9781 0.9135 0.8090 15 1 1 2(0.8736) 0.0498 15 Etc. h(0)=h(14)= -0.0498 h(4)=h(10)= -0.1079 h(1)=h(13)= 0.0412 h(5)=h(9)= 0.0341 h(2)=h(12)= 0.0412 h(6)=h(8)= 0.3189 h(3)=h(11)= -0.0365 h(7)= 0.4667 End. 37 Example Solution: Magnitude Response H e j 38 4.2.5. Uniform Frequency-Sampling Method D. Recursive FIR Filter Design 39 4.2.5. Uniform Frequency-Sampling Method D. Recursive FIR Filter Design 40 4.2.5. Uniform Frequency-Sampling Method D. Recursive FIR Filter Design An FIR filter can be uniquely specified by giving either its impulse response (coefficients h(k)) or, equivalently, by the DFT coefficients H(n). These sequences are related by the following expressions: M 1 H ( n) h( k ) e j 2 nk M k 0 1 h( k ) M M 1 H ( n) e n 0 j DFT h(k ) 2 nk M n=0, 1, …, M-1 DFT 1 H (n) k=0, 1, …, M-1 41 It has also been shown that H(n) can be regarded as Ztransform of h(k), evaluated at N points equally spaced around the unit circle: H (n) DFT h(k ) H ( z ) for z e j 2 / N n and n 0,1,2, , N 1 42 Thus, the transfer function of an FIR filter can easily be expressed in terms of DFT coefficients of h(k): M 1 H ( z ) h( k ) z k k 0 k 1 z k 0 M M 1 M 1 M 1 n 0 k 0 M 1 1 M 1 M H ( n )e H ( n) n 0 2 kn M n 0 H (n) e M 1 j 1 e j 2 n / M j 2 n / M 1 e 1 k z z j 2 n / M 1 M z 1 43 1 e j 2 n z M H ( n) j 2 n / M 1 1 e z n 0 1 M M 1 1 M M 1 1 zM H ( n) j 2 n / M 1 1 e z n 0 1 zM M M 1 H ( n) j 2 n / M 1 1 e z n 0 H1(z) 1 zM H ( z) M H2(z) M 1 H ( n) j 2 n / M 1 1 e z n 0 44 The transfer function H(z) can be expressed in the form: H ( z ) H1 ( z ) H 2 ( z ) zeros where 1 zM H1 ( z ) M H 2 ( z) M 1 poles ! H ( n) j 2 n / M 1 1 e z n 0 45 H ( z) x ( n) H1 ( z ) H 2 ( z) y ( n) H(z) can be interpreted as a cascade of a comb filter and a parallel bank of single-pole filters The zeros of the comb filter cancel the poles of the parallel bank of filters, so that in effect the final transfer function contains no poles, but it is in fact FIR filter. 46 Alternative form to 1 zM H ( z) M M 1 H ( n) j 2 n / M 1 z n 0 1 e can be obtained by combining a pair of complexconjugate poles of H(z) or two real-valued poles to form two-pole filters with real valued coefficients and taking into account H (n) H ( M n) . Then, we can obtain H 2 ( z ) in the forms: 47 M 1 2 1 H (0) A(k ) B(k ) z H 2 ( z) 1 1 2 1 z 1 2cos(2 k / M ) z z k 1 for M odd M 1 2 H (0) H ( M / 2) A(k ) B(k ) z 1 H 2 ( z) 1 1 1 2 1 z 1 z 1 2cos(2 k / M ) z z k 1 for M even A(k) and B(k) are the real-valued coefficients given by A(k ) H (k ) H ( M k ) B(k ) H (k )e j 2 k / M H ( M k )e j 2 k / M 48 Proof: H (k ) H (M k ) j 2 k / M 1 j 2 ( M k ) / M 1 1 e z 1 e z H (k ) H (M k ) j 2 k / M 1 j 2 M / M j 2 k / M 1 1 e z 1 e e z H (k ) H (M k ) j 2 k / M 1 j 2 k / M 1 1 e z 1 e z H (k ) 1 e j 2 k / M z 1 H ( M k ) 1 e j 2 k / M z 1 j 2 k / M 1 j 2 k / M 1 1 e z 1 e z C D 49 H (k ) H (M k ) j 2 k / M 1 j 2 ( M k ) / M 1 1 e z 1 e z H (k ) 1 e j 2 k / M z 1 H ( M k ) 1 e j 2 k / M z 1 j 2 k / M 1 j 2 k / M 1 1 e z 1 e z C D C H (k ) 1 e j 2 k / M z 1 H ( M k ) 1 e j 2 k / M z 1 H (k ) H ( M k ) H (k )e j 2 k / M H ( M k )e j 2 k / M z 1 A(k ) B (k ) z 1 50 H (k ) H (M k ) j 2 k / M 1 j 2 ( M k ) / M 1 1 e z 1 e z H (k ) 1 e j 2 k / M z 1 H ( M k ) 1 e j 2 k / M z 1 j 2 k / M 1 j 2 k / M 1 1 e z 1 e z C D D 1 e j 2 k / M z 1 1 e j 2 k / M z 1 e j 2 k / M e j 2 k / M 1 2 1 2 z z 2 2 k 1 2 1 2cos z z M 51 Then, H (k ) H (M k ) A(k ) B(k ) z 1 j 2 k / M 1 j 2 ( M k ) / M 1 2 k 1 2 1 e z 1 e z 1 2cos z z M 52 Comments on A(k) and B(k) Computation: 1. Because, H (n) H ( M n) it can be found that, A(k ) H (k ) H ( M k ) H (k ) H (k ) 2Re H (k ) R 53 2. Let us assume that k arg H (k ) then, B(k ) H (k )e j 2 k / M H ( M k )e j 2 k / M H (k ) e jk e j 2 k / M H (k ) e j 2 k / M H (k ) e jk e j 2 k / M H (k ) e jk e j 2 k / M 2 H (k ) e jk 2 k / M e 2 jk 2 k / M 2 H (k ) cos k 2 k / M R 54 Summary on A(k) and B(k) Computation: A(k ) 2Re H (k ) B(k ) 2 H (k ) cos k 2 k / M 55 Comments on Quantization Effects: There is a potential problem in the frequency sampling realization of the recursive FIR filters. These realizations introduce poles and zeros at equally spaced points on the unit circle. In the ideal situation, the zeros cancel the poles and, consequently, the actual zeros of H(z) are determined by the selection of the frequency samples H(k). In a practical implementation, however, quantization effects preclude a perfect cancellation of the poles and zeros. In fact, the locations of poles on the unit circle provide no damping of the round-off noise. As result, such noise tends to increase with time and, ultimately, may destroy computations the normal operation of the filter. 56 Comments on Quantization Effects: There is a potential problem in the frequency sampling realization of the recursive FIR filters. These realizations introduce poles and zeros at equally spaced points on the unit circle. In the ideal situation, the zeros cancel the poles and, consequently, the actual zeros of H(z) are determined by the selection of the frequency samples H(k). In a practical implementation, however, quantization effects preclude a perfect cancellation of the poles and zeros. In fact, the locations of poles on the unit circle provide no damping of the round-off noise. As result, such noise tends to increase with time and, ultimately, may destroy computations the normal operation of the filter. 57 Comments on Quantization Effects: There is a potential problem in the frequency sampling realization of the recursive FIR filters. These realizations introduce poles and zeros at equally spaced points on the unit circle. In the ideal situation, the zeros cancel the poles and, consequently, the actual zeros of H(z) are determined by the selection of the frequency samples H(k). In a practical implementation, however, quantization effects preclude a perfect cancellation of the poles and zeros. In fact, the locations of poles on the unit circle provide no damping of the round-off noise. As result, such noise tends to increase with time and, ultimately, may destroy computations the normal operation of the filter. 58 Comments on Quantization Effects: There is a potential problem in the frequency sampling realization of the recursive FIR filters. These realizations introduce poles and zeros at equally spaced points on the unit circle. In the ideal situation, the zeros cancel the poles and, consequently, the actual zeros of H(z) are determined by the selection of the frequency samples H(k). In a practical implementation, however, quantization effects preclude a perfect cancellation of the poles and zeros. In fact, the locations of poles on the unit circle provide no damping of the round-off noise. As result, such noise tends to increase with time and, ultimately, may destroy computations the normal operation of the filter. 59 To mitigate this problem, we can move both the poles and zeros from the unit circle just inside the unit circle, let us say at radius r=1-x, where x is a very small number. Thus the original system function of the linear phase FIR filter M M 1 1 z H ( n) H ( z) M n0 1 e j 2 n / M z 1 becomes 1 r z H ( z) M M M M 1 H ( n) j 2 n / M 1 1 re z n 0 The corresponding two-pole filter realization can be modeled accordingly. The damping provided by selecting r<1 ensures that round-off noise will be 60 bounded and thus instability is avoided. Example: Determine the transfer function of a recursive linear phase FIR filter for M=15. The real-valued frequency response of the filter to be designed has to satisfy the condition: 2 k 1 k 0,1,2,3 Hr 15 0 k 4,5,6,7 Solution: n n j 2 n n M 2 n j 15 H (n) 1 H r e 1 H r e M 15 n 61 Step 1: H(n) computation for n= 0, 1, 2, …, (M-1)/2 i.e. n= 0, 1, 2, 3, 4, 5, 6, 7. 0.2 H (0) 1 H r 15 e 1.2 H (1) 1 H r 15 e 0 1 2.2 H (2) 1 H r 15 2 j j 0. 15 1 15 e j e 2 15 0 0 1 e j j 15 2 15 14 1 15 15 2 2 15 n j 2 n n 15 H (n) 1 H r e 15 62 Step 1 (cont.): 3.2 H (3) 1 H r 15 3 e j 3 15 e j 3 15 12 3 15 For n 4,5,6,7 Because 2 n Hr 0 for n 4,5,6,7 15 H (n) 0 for n 4,5,6,7 n j 2 n n 15 H (n) 1 H r e 15 63 Step 2: A review of basic expressions H ( z ) H1 ( z ) H 2 ( z ) M 1 2 1 zM H1 ( z ) M H 2 ( z ) H 20 ( z ) H 2 k ( z ) H (0) H 20 ( z ) 1 1 z A(k ) B(k ) z 1 H 2k ( z) 1 2cos(2 k / M ) z 1 z 2 k 1 A(k ) 2Re H (k ) B(k ) 2 H (k ) cos k 2 k / M 64 Step 3: A(k) computation A(k ) 2Re H (k ) A(1) 2Re H (1) -1.9563 A(2) 2Re H (2) 1.8271 A(3) 2Re H (3) -1.6180 65 Step 4: B(k) computation B(k ) 2 H (k ) cos k 2 k / M B (1) 2cos 1 2 /15 2cos 14 /15 2 /15 2cos 16 /15 -1.9563 B (2) 2cos 2 4 /15 2cos 2 /15 4 /15 2cos(2 /15) 1.8271 B (3) 2cos 3 6 /15 2cos 12 /15 6 /15 2cos 18 /15 -1.6180 66 Step 5: H1 ( z ) and H 20 ( z ) computation (M=15): 1 zM H1 ( z ) M 1 z 15 H1 ( z ) 15 H (0) H 20 ( z ) 1 z 1 1 H 20 ( z ) 1 z 1 67 Step 6: H 2 k ( z ) computation, (M-1)/2=(15-1)/2=7 A(k ) B(k ) z 1 H 2k ( z) 1 2 1 2cos(2 k / M ) z z -1.9563+1.9563z 1 H 21 ( z ) 1 1.8271z 1 z 2 1.8271-1.8271z 1 H 22 ( z ) 1 1.3383z 1 z 2 -1.6180+-1.6180z 1 H 23 ( z ) 1 0.6180z 1 z 2 H 2 k ( z ) 0 for k= 4, 5, 6, 7. 68 Step 7: result H(z) H 20 ( z ) H 21 ( z ) H1 ( z ) 1 z 15 1 -1.9563+1.9563z 1 H ( z) . 1 1 2 15 1 z 1 1.8271z z H 2 ( z) 1 1 1.8271-1.8271z -1.6180+1.6180z 1 2 1 1.3383z z 1 0.6180z 1 z 2 H 22 ( z ) H 23 ( z ) The different frequency responses and zero-pole plot of the particular transfer functions are given in the next figures. 69 Magnitude Responses H 2 x ( z ) H 20 e j H 21 e j H 22 e j H 23 e j 70 H1 e j Magnitude Responses H 2 e j H1 e j H 2 e j 71 Magnitude Response H 2 e j : zoom H 2 e j 72 Magnitude Response H e j H1 e j H 2 e j Nonrecursive FIR Filter Recursive FIR Filter 73 Zero-Pole Plot Poles Zeros Unit Circle 74
© Copyright 2026 Paperzz