0% found this document useful (0 votes)
19 views6 pages

DSP Lab Report # 3: Submitted by

The document reports on two tasks completed for a digital signal processing lab, where convolution was evaluated for different sequences using the MATLAB conv function. In the first task, convolution was demonstrated for arbitrary infinite sequences and finite sequences using conv. The second task involved convolving two sets of sequences using conv and plotting the input, impulse response, and output on the same figure.

Uploaded by

marryam nawaz
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)
19 views6 pages

DSP Lab Report # 3: Submitted by

The document reports on two tasks completed for a digital signal processing lab, where convolution was evaluated for different sequences using the MATLAB conv function. In the first task, convolution was demonstrated for arbitrary infinite sequences and finite sequences using conv. The second task involved convolving two sets of sequences using conv and plotting the input, impulse response, and output on the same figure.

Uploaded by

marryam nawaz
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/ 6

DSP

LAB REPORT # 3
Submitted By:
Marryam Nawaz
SP-12-BET-043
Hifza Sajid
SP-12-BET-029
Submitted To:
Sir Mubeen Sabir
Class Instructor:
Sumayya Haroon
Class:
BET-5A
Dated:
07/03/2014
In-Lab Tasks

Task1:

Convolution can be evaluated in many different ways.

If arbitrary sequences are of infinite duration, then MATLAB cannot be used directly to compute
the convolution.

As you already know, there are 3 conditions (cases) for evaluation:

 No overlap
 Partially overlap
 Complete overlap
A built in function to compute convolution of 2 finite duration is called “conv”.It assumes that
the two sequences begin at n = 0:

y = conv(x,h)

MFile code:

clear all;
close all;
clc
nx=-3:3;
nh=-1:4;
x=[3 11 7 0 -1 4 2];
h=[2 3 0 -5 2 1];
subplot(3,1,1)
stem(nx,x,'r')
xlabel('n');
ylabel('x[n]');
legend('x[n]');

subplot(3,1,2)
stem(nh,h,'g')
xlabel('n');
ylabel('h[n]');
legend('h[n]');

subplot(3,1,3)
y=conv(x,h);
ny=-4:7;
stem(ny,y)
xlabel('n');
ylabel('y[n]');
legend('y[n]');

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]

MFile code:
nx=0:2;
nh=0:2;
x=[1 2 1];
h=[1 1 1];
subplot(3,1,1)
stem(nx,x)
xlabel('n');
ylabel('x[n]');
legend('x[n]');
subplot(3,1,2)
stem(nh,h)
xlabel('n');
ylabel('h[n]');
legend('h[n]');
subplot(3,1,3)
y=conv(x,h);
ny=0:4;
stem(ny,y)
xlabel('n');
ylabel('y[n]');
legend('y[n]');

 x[n] = [-1 4 -3 -2 1 0 2], n=[-2:4] h[n] = [1 1 1], n= [-1 0 1]

MFile code:
nx=-2:4;
x=[-1 4 -3 -2 1 0 2];
nh=-1:1;
h=[1 1 1];
subplot(3,1,1)
stem(nx,x)
xlabel('n');
ylabel('x[n]');
legend('x[n]');

subplot(3,1,2)
stem(nh,h)
xlabel('n');
ylabel('h[n]');
legend('h[n]');

subplot(3,1,3)
y=conv(x,h);
ny=-3:5;
stem(ny,y)
xlabel('n');
ylabel('y[n]');
legend('y[n]');

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy