Professional Documents
Culture Documents
CONVOLUTION IN MATLAB
LAB OBJECTIVE:
To generate a MATLAB program to find the convolution of two sequences.
CONVOLUTION:
The response y(n) of the LTI system as a function of the input signal x(n) and the unit sample
(impulse) response h(n) is a convolution sum between x(n) & h(n). The input x(n) is convolved
with the impulse response h(n) to yield the output y(n).
y ( n) x ( k ) h( n k )
k
y ( n ) h ( n) x ( n )
INLABTASK#01:
Clear all
Code:
u=[1 2 3 4];
v=[10 20 30];
c=conv(u,v)
Output:
c=
10 40 100 160 170 120
INLABTASK#02:
For example, given the following two sequences:
x(n) = [3,1l,7, 0,-1,4,2], -3£n£3; h(n) = [2,3,0,-5,2,1], -1£n£4
Output
y=
6 31 47 6 -51 -5 41 18 -22 -3 8 2
INLABTASK#03:
INSTRUCTIONS:
Please complete your lab reports neatly.
All code must be commented appropriately and included in the file submitted.
Handouts are required to be submitted by the next lab.
Make sure your handout contains all the required information and that the file is named
correctly.