**Unformatted text preview: **UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN Department of Electrical and Computer Engineering ECE 410 Digital Signal Processing Homework 11 Solutions Due Wednesday, November 12, 2008 Prof. Bresler / Prof. Jones 1. (20 points) A linear-phase FIR filter has the following form: 1 Show that its amplitude response is
/ , 0 , where 1, and cos Give an expression for the coefficients 1 2 . in terms of the impulse response Consider the DTFT: Now, we can do a change of variables in the second summation by letting ′ 1 to get: 1 1 2 cos Performing another change of variables by letting
′ 1 2 , we have: 2 where 1 2 and 2 2 cos . 1 2 cos 1 2 , 2 Thus, we conclude that
/ cos 1 2 2 2. (20 points) Prove the following properties of generalized linear-phase FIR filters: (a) If then (b) If (c) If has four zeros at , , and , and r is a real number, is a generalized linear-phase FIR filter. has two zeros at and , then has two zeros at , is a generalized linear-phase FIR filter. is a generalized linear- , and r is a real number, then 1, then phase FIR filter. (d) If has a zero at 1 or a zero at is a generalized linear-phase FIR filter. (a) We can write the z-transform of the system as follows: 1 1 12 1 2 cos 1 1 1 1 1 1 1 2 cos 4 cos 1 1 2 cos θ Thus, the impulse response of the system is given by: 1, 2 cos , 4 cos , 2 cos θ ,1 By inspection, the impulse response is of finite duration and is even symmetric. Thus, it is a generalized linear-phase FIR filter. (b) Following a similar approach as in part (a), we have: 1 1 1 1 1 2 cos Thus, the impulse response is given by: 1, 2 cos ,1 Obviously, this is a finite duration even symmetric impulse response. Thus, this filter is a generalized linear-phase FIR filter. (c) Writing the system’s z-transform function: 1 1 1 1 1 1 Thus, the impulse response is given by: 1, ,1 This is a finite symmetric impulse response. Thus, it is a generalized linear-phase FIR filter. 3 (d) Writing : 1 1 The corresponding impulse responses are as follows: 1,1 1, 1 The first impulse response is symmetric, while the second impulse response is anti-symmetric. Thus, no matter where the zero really is, the filter is still a generalized linear phase FIR filter. 4 3. (40 points) Consider a length-40 FIR lowpass filter with cutoff frequency ωc = π/3, using the window design method. (a) Please find an expression for the coefficients {hn }n=0 using a truncation (rectangular) window. (b) Please find an expression for the coefficients {hn }n=0 using a Hamming window. (c) Will the filters you designed have generalized linear phase? If so, of what type (I or II)? Prove your claim by proving that the impulse responses of the filters you designed satisfy certain symmetry properties. (d) Determine the number of multiply and add operations per output sample that will be needed in an efficient implementation of the filter. (e) Use the MATLAB command freqz to plot the magnitude and phase of the frequency responses of the two filters you designed. For each filter, plot the magnitude twice, once using a linear magnitude scale, and once using a dB scale. (f) Determine for each of the filters: (i) the peak deviation from unit gain in the passband (ii) the stopband attenuation (both in linear units, and in dB) (iii) the width of the transition band NOTE: You may need to zoom-in on parts of the plot to determine these various quantities. (g) Determine the slope of the phase response in the passband. (h) Compare your results in (f) and (g) to what you would predict from the theory and explain any discrepancies.
n =39 n =39 Consider a length-40 FIR lowpass filter with cutoff frequency ωc = π/3, using the window design method. (a) Please find an expression for the coefficients {hn }n =39 using truncation (rectangular window) n =0 ⎧ − j (39 ) ω 2 ⎪ Gd (ω ) = ⎨e ⎪0 ⎩
g [n]= | ω |≤ ω c otherwise 1 2π ωc −ωc ∫e
ωc −j ( 39 ) ω 2 e jωn dω
( 39 ) )ω 2 1 g [n]= 2π −ωc ∫e j ( n− dω 5 g[n]= 1 π (n −
g [n]= 39 ) 2 sin ((n − 39 )ω c ) 2 ωc 39 sinc((n − )ω c ) π 2
0 ≤ n ≤ 39 otherwise 39 π ⎧1 ⎪ sinc((n − ) ) hrect [n] = ⎨ 3 23 ⎪ 0 ⎩ (b) Please find an expression for the coefficients {hn }n =39 using a Hamming window. n =0 ⎧⎛ ⎛π ⎛ 39 ⎞ ⎞ ⎛ 2πn ⎞ ⎞ 1 ⎪⎜ .54 − .46 cos⎜ ⎟ ⎟ sinc⎜ ⎜ n − ⎟ ⎟ ⎜3 ⎜ ⎟3 hham min g [n] = ⎨⎝ 2 ⎠⎟ ⎝ 39 ⎠ ⎠ ⎝⎝ ⎠ ⎪ 0 ⎩ 0 ≤ n ≤ 39 otherwise (c) Will the filters you designed have generalized linear phase? If so, of what type (I or II)? Prove your claim by proving that the impulse responses of the filters you designed satisfy certain symmetry properties. For the rectangular case we can examine n and the 39-n terms hrect [n] = 1 π (n − 39 ) 2 sin ((n − 39 )ω c ) 2 39 )ω c ) 2 hrect [39 − n] = 1 39 π ((39 − n) − ) 2 sin (((39 − n) − hrect [39 − n] = hrect [39 − n] =
or by using sinc 1 sin ((39 / 2 − n)ω c ) π (39 / 2 − n) 1 sin ((n − 39 / 2)ω c ) π (n − 39 / 2) 39 π 1 hrect [n] = sinc((n − ) ) 3 23 6 1 39 π hrect [39 − n] = sinc((39 − n − ) ) 3 23 1 39 π hrect [39 − n] = sinc((−n + ) ) 3 23 1 39 π hrect [39 − n] = sinc((n − ) ) 3 23
Both the h[39-n] and h[n] terms are the same so the function is type I. For the Hamming case we can examine n and the 39-n terms ⎛ ⎛π ⎛ 39 ⎞ ⎞ ⎛ 2πn ⎞ ⎞ 1 hHamming [n] = ⎜ .54 − .46 cos⎜ ⎟ ⎟ sinc⎜ ⎜ n − ⎟ ⎟ ⎜ ⎟3 ⎜3 2 ⎠⎟ ⎝ 39 ⎠ ⎠ ⎝ ⎝⎝ ⎠ ⎛ ⎛π ⎛ 39 ⎞ ⎞ ⎛ 2π (39 − n) ⎞ ⎞ 1 hHamming [39 − n] = ⎜ .54 − .46 cos⎜ ⎟ ⎟ sinc⎜ ⎜ (39 − n) − ⎟ ⎟ ⎜ ⎟3 ⎜3 2 ⎠⎟ 39 ⎝ ⎠⎠ ⎝ ⎝⎝ ⎠ ⎛ ⎛ π ⎛ 39 ⎛ 2π (39 − n) ⎞ ⎞ 1 ⎞⎞ hHamming [39 − n] = ⎜ .54 − .46 cos⎜ ⎟ ⎟ sinc⎜ ⎜ − n ⎟ ⎟ ⎜ ⎟3 ⎜3 2 ⎟ 39 ⎠⎠ ⎝ ⎠⎠ ⎝ ⎝⎝ ⎛ ⎛π ⎛ 39 ⎞ ⎞ ⎛ 2π (39) 2πn ⎞ ⎞ 1 − hHamming [39 − n] = ⎜ .54 − .46 cos⎜ ⎟ ⎟ sinc⎜ ⎜ n − ⎟ ⎟ ⎜ ⎟3 ⎜3 39 ⎠ ⎠ 2 ⎠⎟ ⎝ 39 ⎝ ⎝⎝ ⎠ ⎛ ⎛π ⎛ 39 ⎞ ⎞ ⎞⎞ 1 ⎛ 2πn + 2π ⎟ ⎟ sinc⎜ ⎜ n − ⎟ ⎟ hHamming [39 − n] = ⎜ .54 − .46 cos⎜ ⎜ ⎟3 ⎜3 2 ⎠⎟ ⎠⎠ ⎝ 39 ⎝ ⎝⎝ ⎠
The filter designed using the hamming window is also type I. (d) Determine the number of multiply and add operations per output sample that will be needed in an efficient implementation of the filter. An efficient implementation uses the coefficient symmetry h[n] = h[39-n] to first add x[m] and x[m-39] and then multiply by the common weight, so the number of multiplies is only 40/2=20 and number of additions is 20+ (20-1) = 39. (e) Use the MATLAB command freqz to plot the magnitude and phase of the frequency responses of the two filters you designed. For each filter, plot the magnitude twice, once using a linear magnitude scale, and once using a dB scale. 7 8 9 (f) Determine for each of the filters: (i) the peak deviation from unit gain in the passband Rectangular .085 Hamming or 20log10(1+.085) = 0.70859dB .0027 or 20log10(1+.0027)= 0.02342 dB 10 Figure 1 Passband peak of the rectangular window filter 11 12 Figure 2. Hamming window passband peak. Above is the zoomed in plot (ii) the stopband attenuation (both in linear units, and in dB) Rectangular 20.5dB or 10^(20.5/20)= 10.593 Hamming 53.52 dB or 10^(53.52 /20)= 474.24 13 Figure 3. Rectangular window filter stopband peak 14 Figure 4 . Hamming window filter stopband peak (iii) the width of the transition band Hamming .17318 *pi Rectangular 0.0448*pi 15 16 NOTE: You may need to zoom-in on parts of the plot to determine these various quantities. (g) Determine the slope of the phase response in the passband. Rectangular= (-1050/180)/(.3)=-19.5 Hamming= (-1050/180)/(.3)=-19.5 (h) Compare your results in (f) and (g) to what you would predict from the theory and explain any discrepancies. The slope is the same as predicted 39/2=19.5 The filter’s response can also be determined using convolution H d (ω ) = Wd (ω ) * Gd (ω )
17 For the rectangular filter: H (ω ) = 1 2π ∫e π
/3 π /3 − jθ ( 39 / 2 ) ⎛ jw39 / 2 sin((ω − θ )40 / 2) ⎞ ⎟dω ⎜e ⎜ sin((ω − θ ) / 2) ⎟ ⎠ ⎝ The results obtained and plottedusing the Matlab command.
ezplot((1/(2*pi))*abs(int(exp(th*39/2*-j)*exp(-j*(39/2)*(w-th))*sin(N*(w-th)/2)/(sin((w-th)/2)),th,-pi/3,pi/3)),[0:.01:pi]) Stopband attenuation =10.526 Passband ribble = .085 The peak deviation from unit gain in the passband= .142 = .0452π The results are nearly the same. 18 ...

View
Full
Document