Professional Documents
Culture Documents
Digital Signal Processing Lab#3 Convolution of Discrete-Time Sequences
Digital Signal Processing Lab#3 Convolution of Discrete-Time Sequences
Lab#3
Objective:
By the end of this lab students will be able to get output from LTI systems by
convolving input with impulse responses.
Pre-Lab Tasks
Useful Commands:
conv: Convolution and polynomial multiplication.
filter: filters the data in vector X with the filter described by vectors A and B
to create the filtered data.
subplot: breaks the Figure window into an m-by-n matrix of small axes,
selects the pth axes for the current plot, and returns the axis handle.
if xe ( n) xe (n) if xo ( n) xo (n)
then xe ( n) is called even( symmetric ) then xo (n) is called odd (antisymmetric )
Any arbitrary real-valued sequence x(n) can be decomposed into its even and odd
component
x( n) xe (n) xo ( n)
xe ( n) 1 [ x (n) x ( n)], xo (n) 1 [ x( n) x( n)]
2 2
Codes for even and odd decomposition of signals
Convolution
Convolution is a weighted moving average with one signal flipped back to front.
10
0
x(m )
y(n)
5
-50
0
-100 -5
0 5 10 15 0 2 4 6 8
n m
Sequence y(o)
4
0
y(o)
-2
-4
-6
0 2 4 6
o
Is This Correct???
Based on the plots, “conv” function neither provides nor accepts any timing information.
We need the beginning and the end point of y(n).
A simple extension of the “conv” function, called “conv_m”, can be written to perform
the convolution of arbitrary support sequences:
Task-2:
Convolve following sequences using MATLAB Function “conv” and plot the
input, impulse response and output in one figure using “subplot”:
x[n] = [1 2 1], n=[0 1 2] h[n] = [1 1 1], n= [0 1 2]
x[n] = [-1 4 -3 -2 1 0 2], n=[-2:4] h[n] = [1 1 1], n= [-1 0 1]