NomanHamza13021 Lab7 of DSP
NomanHamza13021 Lab7 of DSP
Title:
Computation of impulse Response of LTI system/Discrete Convolution.
Objectives
⚫ To convolve two signals in MATLAB(Phyton) using built-in functions.
Introduction
In this lab, we’ll learn and perform convolution. We’ll convolve two signals in
MATLAB using built-in functions. First, we’ve to know about convoultion. The output
signal from a linear system is equal to the input signal convolved with the system’s
impulse response. Convolution is denoted by a star when written in equation:
An input signal, x[n], enters a linear system with an impulse response, h[n], resulting in an
output signal, y[n]. If we express in words, the input signal convolved with the impulse response
is equal to the output signal. Convolution is represented by the hysteric ‘*’.
These are four steps for discrete convolution.
i. Folding
ii. Shifting
iii. Multiplication
iv. Summation
For Discrete time convolution, we’ve formula:
Discrete Convolution on MATLAB
h = [1 2 1 -1]; % impulse response
x = [1 2 3 1]; % input sequence
y = conv(h,x);
n = 0:6;
subplot(2,1,1);
stem(n,y);
xlabel('Time index n');
ylabel('Amplitude');
title('Output Obtained by Convolution');
grid;
Output:
Conclusion:
In today’s lab, we’ve learned about Discrete Convolution. We learned to convolve two
signals in MATLAB(Python) using built-in functions. We also performed discrete
convolution mathematically according to the given formula. We’ve come to know that
the input signal convolved with the impulse response is equal to the output signal. This
lab is very helpful to learn and implement discrete convolution. After this lab I am fully
able to do these kinds of experiments on my own.