3015_Homework_4_Matlab

3015_Homework_4_Matlab - t with proper limits so that all...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Matlab problem Using Matlab, calculate numerically the convolution integral: ) 2 ( 2 * )) 1 ( ) 1 ( ( 2 ) ( 2 + + = t u t u t u t t y (Exercise 2.39(f) of Haykin and Van Veen) You are required to turn in the following (recommendation: use of Matlab command subplot to show multiple plots on the same window): Matlab plot of signals )) 1 ( ) 1 ( ( 2 ) ( 2 + = t u t u t t x and ) 2 ( 2 ) ( + = t u t h . Matlab plot of the signal y ( t ) obtained numerically. Matlab plot of the signal y ( t ) obtained analytically. Please comment on any difference you found with the numerical result. Matlab code. The submitted work should be your own. You can (and indeed you are encouraged to) discuss this assignment with other students, but the Matlab code you turn in should represent your own individual effort. Next, you have an outline of the steps you should follow. Recall that you can type help <command> in Matlab Command Window to get detailed information on a specific Matlab command. CT convolution using Matlab: a) Generate an array
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: t with proper limits so that all non-zero values of the signals are included. Make sure you use a stepsize small enough to accurately represent your signals (like 0.01 or so). b) Generate arrays x and h for different values of t . You may find the Matlab commands zeros and find useful. For example, if we want to generate a vector u that represents the unit step function u ( t ) for t between -5 and 5, we can do the following: t=-5:0.01:5; u=zeros(1,length(t)); index_u=find(t>=0); u(index_u)=1; c) Convolve vectors x and h using the Matlab conv command. Notice that the resulting vector y will be of length length(y)= length(x)+length(h)-1 so you need to generate a new time array t2 to represent this additional length when you plot y. Notice that the limits of t2 depend on how you originally generated t. d) Compensate for the fact that you are using a stepsize other than one....
View Full Document

Ask a homework question - tutors are online