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

LAB # 02 Discrete-Time Convolution: Objective

This document provides an overview of discrete-time convolution and describes an experiment to calculate the output of a linear time-invariant system given its impulse response and input signal. The impulse response h(n)={3, 2, 1, -2, 1, 0, -4, 0, 3} and input x(n)={1, -2, 3, -4, 3, 2, 1} are convolved to find the output y(n). The code is then modified to shift the origin of the impulse response to check that the system is causal, meaning the output depends only on past and present input values.

Uploaded by

Zohaib Khan
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)
63 views2 pages

LAB # 02 Discrete-Time Convolution: Objective

This document provides an overview of discrete-time convolution and describes an experiment to calculate the output of a linear time-invariant system given its impulse response and input signal. The impulse response h(n)={3, 2, 1, -2, 1, 0, -4, 0, 3} and input x(n)={1, -2, 3, -4, 3, 2, 1} are convolved to find the output y(n). The code is then modified to shift the origin of the impulse response to check that the system is causal, meaning the output depends only on past and present input values.

Uploaded by

Zohaib Khan
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/ 2

LAB # 02

Discrete-Time convolution
OBJECTIVE:
1. We have the impulse response of a system as h(n)={3, 2, 1, -2, 1, 0, -4, 0, 3}.
2. For x(n)={1, -2, 3, -4, 3, 2, 1} ,find y(n).
3. Modify the code such that h(n)={ 3, 2, 1, -2, 1, 0, -4, 0, 3}-(origin is shifted),and check the

causality property mentioned below (Theory point 3).

THEORY:

1. Convolution is given as: y(n)=x(n)*h(n) =

k=

x ( k ) h ( nk )=

k=

h(k ) x (nk ) , i.e one

can compute the output y(n) to a certain input x(n) when impulse response h(n) of that system
is known. Convolution holds commutative property.

2. The length of the resulting convolution sequence is N+M-1, where, N and M are the lengths
of the two convolved signals respectively.
3. In Causal Systems, the output only depends on the past and/or present values of inputs and
NOT on future values. This means that the impulse response h(n) of a causal system will
always exist only for n 0.

PROCEDURE:
1. Make a folder at desktop and name it as your current directory within MATLAB.
2. Open M-file editor write the below code:
clear all
close all
clc;
h=[3 2 1 -2 1 0 -4 0 3];
org_h=1;
nh=[0:length(h)-1]-org_h+1;
x=[1 -2 3 -4 3 2 1];
org_x=1;
nx=[0:length(x)-1]-org_x+1;
y=conv(h,x);
ny=[nh(1)+nx(1):nh(end)+nx(end)];

figure,
subplot(1,3,1),
stem(nh,h);
xlabel('time index n');ylabel('amplitude');
xlim([nh(1)-1 nh(end)+1]);
title('impulse response');grid;
subplot(1,3,2),
stem(nx,x);
xlabel('time index n');ylabel('amplitude');
xlim([nx(1)-1 nx(end)+1]);
title('input signal x(n)');grid;
subplot(1,3,3)
stem(ny,y)
xlabel('time index n');ylabel('amplitude');
xlim([ny(1)-1 ny(end)+1]);
title('output obtained by convolution');grid;

3.
4.

Try to learn, explore the code and makes notes.


Now modify the above code as mentioned in objectives above and check for causality.

RESULT:

EXERCISE:
1. What will happen if we input x(n)={0,0,1,0,0} into the above system.
2. Can you prove commutative property of the convolution?
3. Perform the convolution without conv command.

You might also like