{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# HW12sol_FA08 - UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN...

This preview shows pages 1–4. Sign up to view the full content.

UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN Department of Electrical and Computer Engineering ECE 410 Digital Signal Processing Homework 12 Solutions Wednesday, November 12, 2008 Prof. Bresler, Prof. Jones Due by November 19, 2008 Problem 1 (20 points) Design a length-7, symmetric ramp FIR filter h [ n ] , n = 0 , 1 , . . . , 6 with desired frequency re- sponse D ( ω ) = | ω | (before the linear phase shift) by hand. Use the window design method with a simple truncation ( i.e. , rectangular/boxcar) window and give the filter coefficients as your answer. Using Matlab, plot separately the magnitude and phase of H ( ω ), using at least 1000 points between - π and π . Also plot the ideal desired magnitude response | D ( ω ) | on the same plot as the actual response. Solution: Introducing the required linear phase-shift, the desired frequency response is G d ( ω ) = | ω | e - j 3 ω and the ideal (IIR) filter coefficients are its inverse DTFT, i.e. , g [ n ] = 1 2 π Z π - π | ω | e - j 3 ω e jωn = 1 2 π - Z 0 - π ωe j ( n - 3) ω + Z 0 - π ωe j ( n - 3) ω = 1 2 π •Z π 0 ωe - j ( n - 3) ω + Z 0 - π ωe j ( n - 3) ω = 1 π Z π 0 ω cos( n - 3) ω dω = ω π ( n - 3) sin( n - 3) ω fl fl fl π 0 + 1 π ( n - 3) 2 cos( n - 3) ω fl fl fl π 0 , n 6 = 3 π 2 , n = 3 = ( 1 π ( n - 3) 2 [cos( n - 3) π - 1] , n 6 = 3 π 2 , n = 3 = ( 1 π ( n - 3) 2 £ ( - 1) n - 3 - 1 / , n 6 = 3 π 2 , n = 3 With a length 7 rectangular window, h [ n ] = 1 π ( n - 3) 2 £ ( - 1) n - 3 - 1 / , 0 n 6 , n 6 = 3 π 2 , n = 3 0 , otherwise 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
The magnitude and phase response for the ideal and FIR filter are computed in Matlab using the following code and shown in figure 1. % Problem 1 N = 7; M = (N-1)/2; n = 0:(N-1); h = zeros(1,N); fftlen = 1024; w =[-fftlen/2: fftlen/2-1]/fftlen*2*pi; % Filter coefficients for G_d(w) = |w|, using rectangular window h = 1./(pi*(n-3).^2).*( (-1).^(n-3) -1); h(4) = pi/2; % Estimated filter response H = fftshift(fft(h,fftlen)); mag = abs(H); ang = angle(H); % Ideal (desired) filter response mag_g = abs(w); ang_g = angle(exp(-j*3*w)); figure(1); plot(w, mag, w, mag_g,’r:’, ’LineWidth’, 2); title(’Magnitude Responses’); xlabel(’\omega (radian)’); legend(’|H_d(\omega)|’, ’|G_d(\omega)|’,-1); xlim([-pi pi]); ylim([0 pi]); grid on print -depsc P1_mag figure(2); plot(w, ang, w, ang_g,’r:’, ’LineWidth’, 2); title(’Phase Responses’); xlabel(’\omega (radian)’); legend(’\angle H_d(\omega)’, ’\angle G_d(\omega)’, -1); xlim([-pi pi]); ylim([-pi pi]); grid on print -depsc P1_phase 2
Problem 2 (20 points) Use the frequency sampling method respectively to design a length-101 type-1 GLP FIR high- pass filter having cutoff frequency ω c = 3 π/ 4 and generalized linear phase. (a) Find an expression for the filter coefficients { h n } 100 n =0 . (b) Use Matlab to evaluate H d ( 512 ), for n = - 512 , - 511 , . . . , 511. Plot the magnitude and phase responses, respectively, and analyze the plots to see if they are what you expected. Solution: (a) Since the filter is high-pass and odd-length, it needs to be a type-1 GLP filter with even symmetry. The desired filter response G d ( ω ) for ω [0 , 2 π ] is therefore given by: G d ( ω ) = ( e - (101 - 1) 2 , ω [ 3 π 4 , 5 π 4 ] 0 , else In order to use the frequency sampling method, we need to find inverse DFT of the sequence H [ m ] = G d ( 2 πm 101 ) , m = 0 , 1 , . . . , 100, i.e.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 17

HW12sol_FA08 - UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online