*This preview shows
page 1. Sign up to
view the full content.*

**Unformatted text preview: **UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN Department of Electrical and Computer Engineering ECE 410 Digital Signal Processing Homework 14 Due Wednesday, December 10, 2008 Prof. Bresler / Prof. Jones Problem 1 (25 points) Compute the following cyclic convolutions: (a) {xn}5n=0 = {1, 2, 3, 4, 5, 6} and {yn}5n=0 = {1, 0, 0, 1, 0, 0}. Compute z[n] = ∑ 5 k =0 x[ k ] y[ n − k 6 ] , n=0,1,2,3,4,5. z[n] = {1 + 4,2 + 5,3 + 6,4 + 1,5 + 2,6 + 3} ={5,7,9,5,7,9} (b) {xn}8n=0 ={1, 2, 3, 4, 5, 6,0,0,0}; {yn}8n=0 ={1,0,0,1,0, 0, 0,0,0} Compute p[n] = ∑ 8 k =0 x[ k ] y[ n − k 9 ] n=0,1,2,3,4,5,6,7,8 p[n]={1 + 0, 2 + 0, 3 + 0, 1 + 4, 2 + 5, 3 + 6, 4 + 0, 5 + 0, 6 + 0}={1,2,3,5,7,9,4,5,6} (c) {xn}7n=0 ={1, 2, 3, 4, 5, 6,0,0}; {yn}7n=0 ={1,0,0,1,0, 0, 0,0} Compute w[n] = ∑ 7 k =0 x[ k ] y[ n − k 8 ] n=0,1,2,3,4,5,6,7 w[n]={1 + 6, 2 + 0, 3 + 0, 1 + 4, 2 + 5, 3 + 6, 4 + 0, 5 + 0}={7,2,3,5,7,9,4,5} (d) Compute zlinear[n], the linear convolution of the sequences in (a). Note x[n] is a length-6 sequence and y[n] is a length-4 sequence (4 nonzero values). Therefore, the length of zlinear[n] should be 6+4-1=9 z linear [ n ] = {1,2,3,5,7,9,4,5,6}
(e) What is the relationship between the linear convolution of x[n] and y[n] computed in (d) and the circular convolutions computed in (a), (b) and (c)? The results obtained in (b) and (d) are identical and this confirms that linear convolution can be determined by circular convolution with sufficient zero-padding. The sequences have been zero padded to length 9, which agrees with the theory that requires zero padding to length 6+4-1, where 6 and 4 are the lengths of the nonzero parts of the sequences. 1 In (a) there is no zero padding, so the circular convolution is obtained, yielding a result different from the linear convolution. However, because y[n] has two nonzero values at the end, some of the terms (you should be able to determine which!) in the circular convolution coincide with those in the linear convolution. Finally, in (c) the zero padding is only to length 7, which is too short, so again there is disagreement with the linear convolution, but more terms (you should be able to determine which!) in the circular convolution coincide with those in the linear convolution. Problem 2 (15 points) The nonzero part of the impulse response of a particular lowpass filter is given by h[n]4n=0 = {0.1, 0.5, 1, 0.5, 0.1} Your goal is to convolve h[n] with the following signal: x[n]24n=0 = {1, 2,−1,−4,−2, 1, 3, 4, 5, 3,−1, 1, 2,−3,−6,−2,−3, 1, 1,−2,−3,−4,−5, 5, 3} (a) Suppose that you decide to use the overlap-add method. You will need to divide the input into frames xm[n], where m is the frame index, and each frame xm[n] is a signal (possibly zero-padded, that’s up to you) of length K = 8. Specify the contents of the first two frames, x0[n]7n=0 and x1[n]7n=0 Since the length of h[n] is 5, having 4 nonzero elements in each frame xm[n] will make ym[n](the linear convolution of h[n] and xm[n]) a length-8 sequence. If we pad h[n] with 3 zeros and xm[n] with 4 zeros, then we can use the FFT to compute each ym[n]. Therefore, each xm[n] will have 4 nonzero elements from x[n] with 4 zeros padded to give a length-8 sequence. 1 2 −1 − 4 − 2 1 3 4 5 3 −1 1 1 2 −1 − 4 0 0 0 0 −2 1 3 4 0 0 0 0 5 3 −1 1 0 0 0 0 ← {x0 [n]}7 0 7 ← {x1[n]}0 ← {x2 [n]}7 0 (b) Suppose that you have, in your workbench, a pair of chips, each of which will compute the DFT of a length-4 input sequence(K=4). Show how you would wire the inputs and outputs of these two chips in order to compute a length-8 (K=8) decimation-in-time FFT. 2 We remember that / . Problem 3 (30 points) This problem focuses on the design and implementation of a digital processor for analog signals.
xa(t) A/D x[n] Hd(ω) y[n] Ideal D/A ya(t) (a) Consider the system shown in the figure above. It is to be used to lowpass filter to cutoff frequency of 5 kHz a real analog signal bandlimited to 8 kHz. Pick an appropriate sampling period of the A/D converter and explain your choice. You are expected to exercise engineering judgment here, rather than simply plugging into a formula! Since the analog signal is bandlimited to 8 kHz, we would need to have a sampling frequency of 16 kHz to avoid aliasing at the A/D. This corresponds to a sampling period sec 62.5 μs. However, for this problem, because we’re going to be getting rid of any frequency components beyond 5 kHz, we can allow a little aliasing, and then get rid of it using the digital filter. This allows a lower sampling rate to be used. Since the signal is bandlimited to 8 kHz, we have Ω 8000 2 3 Due to the lowpass filter, we also know Ω Then, we have 2 Ω 2 2 Ω Ω 2 sec 76.9231 μs. Ω Ω 13000 2 2 13 Ω 5000 2 Thus, the overall system works with a sampling rate as low as 13 kHz. Thus, the correct answer is (b) Design the digital filter in the system as a length 81 lowpass FIR filter using the frequency sampling method. Provide a closed-form expression for the impulse response of your filter and simplify it as much as possible. Since the analog cutoff frequency is 5 kHz, the corresponding digital frequency is 0.769 . Since it’s a lowpass filter and it has odd length, it has to be a Type I GLP. The desired filter response for 0,2 is given by: 0 0 0 0 10 ,2 13 10 13 10 13 2 2 10 ,2 13 In order to use the frequency sampling method, we need to find the inverse DFT of the sequence for 0,1,2, … ,80. 0 0 31, 50 80 4 Thus, 1 81 1 81 1 81 1 81 63 81 1 81 Simplifying for 1 81 1 81 1 81 1 81 1 81 81 81 sin π n 40 63 81 π sin n 40 81 π 1 sin 81 n 40 63 81 sin π n 40 81 40 63 40 0,1,2, … ,80; 1 81 1 81 40, we have 1 81 1 1 1 81 40 40 π 40 63 sinc 81 n 40 63 π 40 sinc n 40 81 63 sinc 81 81 sinc 81 where the sinc function is defined as follows sin 5 (c) Plot the magnitude frequency responses of both the digital filter and of the entire digital processor for analog signals (label the axes appropriately) in dB scale to make sure they make sense. What are the stopband attenuations obtained for the digital filter and for the entire processor? Below is the magnitude frequency response of the digital filter: As shown by the magnitude of the frequency response of the digital filter, the stopband attenuation of the digital filter is 16.43 dB. 6 Below is the approximate magnitude analog response of the entire digital processor. It is only approximate, because with a nonideal digital LPF, the aliasing is not completely rejected by the imperfect stop band. Recall that the entire processor corresponds to an LSI system only when there is no aliased signal in the output. Because this is violated here, the system is not LSI, and the computed analog frequency response is only an approximation. The expression for this approximate analog frequency response is found by determining the response to an analog input signal with a Fourier transform that is a rectangle of bandwidth 8KHz: | for Ω / and zero else. Ω| | Ω 2 Ω | Note that with an ideal LPF, the second term in the sum would not make a difference: As shown by the magnitude of the frequency response of the digital filter, the stopband attenuation of the digital filter is approximately 16.47 dB. The stopband attenuation of the entire processor is very similar, Ω are apparently out of and in fact slightly better. This is because the two terms in the expression for phase at the frequency where the magnitude frequency response reaches its peak in the stopband. Notice that due to the ideal D/A the response above 6.5KHz is exactly zero, but for graphical purposes, any frequency component beyond 6.5 kHz is clipped to -60 dB. will be implemented in a real-time digital signal processor using the (d) The digital processing in overlap-and-add method with radix-2 FFT’s. What is the optimum block length of the data x[n] and the optimum length of the FFT to be used, to minimize the computation, and how many real multiply and add operations per second are needed? 7 To obtain the ideal radix-2 FFT length, we need to find the length, K, that minimizes the number of computations per sample. We know that with a filter length of M=81 and assuming FFT’s with a nonreduced butterfly, there are approximately 2 log 80 complex MA computations per sample, since each block has 80 samples. 1 Plugging in power-of-2 numbers for K, we see that K=512 yields the minimum number of computations. 512 As data is coming in, it is processed in segments of length L, where 1 Thus the optimum block length is, 80 432 80 multiplication-add operations. Multiplications of FFT’s Each length-K FFT and IFFT needs requires K MA’s. Thus, computation for each input block of length L takes 2 2 log 1 MA’s Since there are 13000 samples to process per second, there are 30.0926 blocks to process per second. The total number of complex MA computations per second is 13000 Problem 4 (30 points) In this problem, you will be implementing the overlap-add method of block convolution. (a) Implement the overlap-add method using radix-2 FFT to get a fast overlap-add block convolution routine. (Hint: Notice that the block length should be a power of 2 and does not need to be input as an argument.) The header line should be as follows: function [y] = overlap_add_fft(x,h) NOTE: Your function should work properly even when the length of the input vector x is not a multiple of the filter length. This is left as an exercise for the students. (b) Test your function from part (a) on the following signal and impulse response: cos 8
/ 512 2 log 512 512 80 1 3.7638 10 376380.95 376381 cos 3 8 / , for 0, … ,9999 1 sinc 5 sin 5 5 0 , for 10, … ,10 A way to test your implementation is to compute the mean-square error (sum of squared-differences divided by the number of samples) using your implementation from part (a) and the regular convolution result (use conv in MATLAB). Please provide this mean square error. Also, compare the two results by plotting them for n = 100, 101, ... 119, and for n= 8850, 8851, ... 8880. Explain any disagreement. FFT block length = 256 MSE = 7.0396e-032 9 1 0 ...

View Full
Document