0% found this document useful (0 votes)
8 views3 pages

Lecture 5

The document provides examples of convolution using MATLAB code, demonstrating how to compute the convolution of two sequences and plot the results. It includes two specific examples with defined sequences and their indices, as well as instructions for hand calculations of convolution. Additionally, it presents a task to find the linear convolution of two given sequences.

Uploaded by

mumtahena
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

Lecture 5

The document provides examples of convolution using MATLAB code, demonstrating how to compute the convolution of two sequences and plot the results. It includes two specific examples with defined sequences and their indices, as well as instructions for hand calculations of convolution. Additionally, it presents a task to find the linear convolution of two given sequences.

Uploaded by

mumtahena
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Convolution:

Example 1:
x1 = [3 1 -2 5];
n1 = -1:2; % generating index
x2 = [2 1 3 6];
n2 = -2:1;
% Convolution
y1 = conv(x1, x2)

% Calculate index for convolution result


kmin = n1(1) + n2(1) % left edge of convolved result
kmax = n1(end) + n2(end) % right edge of convolved result
k1 = kmin:kmax % generating index of the result

% Plotting
subplot(3,1,1)
stem(n1, x1)
subplot(3,1,2)
stem(n2, x2)
subplot(3,1,3)
stem(k1,y1)
Example 2:
x1 = [4 2 6 3 8 1 5];
n1 = -2:4; % generating index
x2 = [3 8 6 9 6 7];
n2 = -4:1;

% Convolution
y1 = conv(x1, x2)

% Calculate index for convolution result


kmin = n1(1) + n2(1) % left edge of convolved result
kmax = n1(end) + n2(end) % right edge of convolved result
k1 = kmin:kmax % generating index of the result

% Plotting
subplot(3,1,1)
stem(n1, x1)
subplot(3,1,2)
stem(n2, x2)
subplot(3,1,3)
stem(k1,y1)
Task:
1.Solve the problem of example 2 by hand calculation
2. Find out the linear convolution of x(n)=[1 -2 0 2 1] and h(n)=[2 0 -3 -2 1 1].

You might also like