Lab 5 Final
Lab 5 Final
Course Instructor:
Lab Engineer:
Semester
LAB EXPERIMENT # 05
OBJECTIVE:
CONVOLUTION OF SIGNALS:
The convolution of f and g is written f g. It is defined as the integral of the product of the two
functions after one is reversed and shifted. As such, it is a particular kind of integral transform:
For complex-valued functions f, g defined on the set Z of integers, the discrete convolution of f and
g is given by:
The convolution of f and g is written f g. It is defined as the integral of the product of the two
functions after one is reversed and shifted. As such, it is a particular kind of integral transform:
For complex-valued functions f, g defined on the set Z of integers, the discrete convolution of f and
g is given by:
The convolution defines a product on the linear space of integrable functions. This product satisfies
the following algebraic properties, which formally mean that the space of integrable functions with
the product given by convolution is a commutative algebra without identity. Other linear spaces of
functions, such as the space of continuous functions of compact support, are closed under the
convolution, and so also form commutative algebras.
▪ Commutative:
▪ Associative:
▪ Distributive:
1. Convolution implementation.
%% x*h x=[1
2 3]; h=[1 1 1]; y1=conv(x,h);
subplot(2,1,1); stem(y1,'k');
xlabel('Index Number');
ylabel('Amplitude'); axis([0
10 0 10]);
%% h*x
y2=conv(h,x);
subplot(2,1,2);
stem(y2,'k'); xlabel('Index
Number'); ylabel('Amplitude');
axis([0 10 0 10]);
0
0 1 2 3 4 5 6 7 8 9 10
Index Number
PRACTICE QUESTIONS
Q1. Proof the Commutative associative and distributive property for a system having input x[n]
=[ 1 -2 3 4 -3 -2 4] and impulse response h1=[3 2 1 2 2 1 -1] and h2=[-1 2 3 -2 -3 1 5].
Output:
CPEN221101023
Commutative Property Check:
Result of input * impulse_1:
3 -4 6 18 0 -5 16 13 -5 -3 9 6 -4
Result of impulse_1 * input:
3 -4 6 18 0 -5 16 13 -5 -3 9 6 -4
Are both results identical? 1
Associative Property Check:
Result of input * (impulse_1 * impulse_2):
-3 10 -5 -24 53 62 -69 -64 137 105 -109 -35 157 61 -79 -16 63 26 -20
Result of (input * impulse_1) * impulse_2:
-3 10 -5 -24 53 62 -69 -64 137 105 -109 -35 157 61 -79 -16 63 26 -20
Are both results identical? 1
Distributive Property Check:
Result of input * (impulse_1 + impulse_2):
2 0 2 12 21 4 -15 2 39 12 -20 0 16
Result of (input * impulse_1) + (input * impulse_2):
2 0 2 12 21 4 -15 2 39 12 -20 0 16
Are both results identical? 1
Q2. Write the Matlab code to draw the following signal and then convolve it with h2 mentioned
in question 1.
x[n]
0 2
n
-2
-4
Code: Output:
Rubrics: