HW_Set_3_solutions

# HW_Set_3_solutions - Introduction to Signal Processing...

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

Introduction to Signal Processing Hayder Radha - 1 - ECE 366 Homework Set #3 Solutions Wednesday, February 11, 2009 ECE 366 – Introduction to Signal Processing Spring 2009 Michigan State University Department of Electrical and Computer Engineering [1] Study MatLab Section M2.4 in the book ( Graphical Understanding of Convolution ). Do the following items that relate to this convolution integral problem: (a) See the book for the solution of this part of the problem . (b) The program in the book is implemented based on time-inversion and time shifting of the input signal, ( ) x t τ while keeping the impulse response stationary ( ) h τ . Modify your program such that the impulse response is time- inverted and time-shifted ( ) h t τ while keeping the input signal stationary ( ) x τ . Re-plot M2.3, M2.4, and M.25. Is the output at these time instances the same as the output of the corresponding time instances from part Error! Reference source not found. ? % ECE 366 Spring 2009 - HW 3 - Problem 1 (b) % MS2P4 figure(1) x = inline( '1.5*sin(pi*t).*(t>=0&t<1)' ); h = inline( '1.5*(t>=0&t<1.5)-(t>=2&t<2.5)' ); dtau = 0.005; tau = -1:dtau:4; dt=0.1; tmin=-1; tmax=4.0; ti = 0; tvec = tmin:dt:tmax; y= NaN*zeros(1,length(tvec)); %Pre-Allocate Memory for t = tvec, ti = ti+1; xh =x(tau).*h(t - tau); lxh = length(xh); y(ti) = sum(xh.*dtau); %Trapeziodal approximation of integral subplot(2,1,1), plot(tau,h(t-tau), 'k-' ,tau,x(tau), 'b--' ,t,0, 'or' ); axis([tau(1) tau(end) -2.0 2.5]); xlabel( '\tau' ); legend( 'h(t-\tau)' , 'x(\tau)' , 't' , 'Location' , 'NorthEast' ); subplot(2,1,2), plot(tvec,y, 'r' ,tvec(ti),y(ti), 'or' ); axis([tau(1) tau(end) -1.0 2.0]); grid; drawnow; end

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

View Full Document