0% found this document useful (0 votes)
72 views2 pages

Mekelle Institute of Technology ECE 306 - Digital Signal Processing LAB Manual. Prepared By: Maarig Aregawi LAB 3: Convolution

This 3-sentence summary provides the high-level information about the document: The document is a lab manual from Mekelle Institute of Technology that discusses convolution and how to implement it using MATLAB, specifically using the conv command to convolve a finite-length input sequence with an impulse response and obtain the output, with tasks that involve changing the order of inputs to the conv command, convolving with an impulse as input, and manually implementing the convolution sum without using conv.

Uploaded by

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

Mekelle Institute of Technology ECE 306 - Digital Signal Processing LAB Manual. Prepared By: Maarig Aregawi LAB 3: Convolution

This 3-sentence summary provides the high-level information about the document: The document is a lab manual from Mekelle Institute of Technology that discusses convolution and how to implement it using MATLAB, specifically using the conv command to convolve a finite-length input sequence with an impulse response and obtain the output, with tasks that involve changing the order of inputs to the conv command, convolving with an impulse as input, and manually implementing the convolution sum without using conv.

Uploaded by

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

Mekelle Institute of Technology

ECE 306 – Digital Signal Processing LAB Manual.


Prepared by: Maarig Aregawi

LAB 3: Convolution

The convolution sum given by

y[n]= ∑∞
𝑘=−∞ 𝑋[𝑘]ℎ[𝑛 − 𝑘] = ℎ[𝑛] ∗ 𝑥[𝑛] ------------(1)

is implemented in MATLAB by the command conv, provided the two sequences to be convolved
are of finite length. The following MATLAB program illustrates this approach.
Before you run the following code study the command: conv.

%%% MIT ECE 306-Digital Signal Processing


%$$$$ LAB 2 - Convolution
close all;
clc;
h = [2 2 2 2 2 2 2 2 2]; % impulse response
x = [1 1 1 1 1 1 1 1 1 1]; % input sequence
l1=length(x);
l2=length(h);
n = l1 + l2-1;
%%% Convolution Using the Conv function
y = conv(h,x);
stem(1:n, y); grid on;
xlabel('n');
ylabel('y[n]');
xlim([-2 n+4])
title('Convolution Using the Conv() function');

The output of the above code is shown below

Figure 1: convolution an input sequence with an impulse response


Tasks:

1. Change the convolution y = conv(h,x) to y = conv(x,h), and notice if there is any


difference in the output. What property of convolution is this?
2. Modify the code to do a convolution with the input sequence x[n] = 𝛿[𝑛], and compare the
output y[n] with impulse response h[n]. What is your observation/conclusion about this?
3. The result in figure 1 has been found using the command conv() to calculate the
convolution output y[n]. In this task you are required to compute convolution without the
conv() command. i.e. implement equation 1 (the convolution sum formula), and you must
come up with the exact result of figure 1. Plot the input data, the impulse response, and the
two outputs (output with conv() function, and output with convolution sum implemented
in MATLAB code) as follows:

Figure 2: plot of Task 3

You might also like