0% found this document useful (0 votes)
21 views

Conv Prog

This document uses MATLAB to perform discrete convolution on two sequences, x[n] and h[n]. It defines the sequences, calculates the convolution y[n]=x[n]*h[n] using the conv command, and plots the resulting sequence y[n] with labels.

Uploaded by

venkateswarlu84
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Conv Prog

This document uses MATLAB to perform discrete convolution on two sequences, x[n] and h[n]. It defines the sequences, calculates the convolution y[n]=x[n]*h[n] using the conv command, and plots the resulting sequence y[n] with labels.

Uploaded by

venkateswarlu84
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Discrete convolution using MATLAB tool clear all; close all; clc; x = [5 11 9 0 -3 -4 5]; nx = -3:3; %define sequence x[n]

and its range h = [3 5 2 -4 -5 -2]; nh = -1:4; %define sequence h[n] and its range nmin = min(nx)+min(nh); %specify the lower bound of convolved sequences nmax = max(nx)+max(nh); %specify the upper bound of convolved sequences y = conv(x,h); n = nmin:nmax; %compute convolution and specify its range stem(n,y); grid %plot the resulting sequence y[n] title('convolution of two sequences'); %add title to the plot ylabel('y[n]=x[n]*h[n]') %label the y-axis xlabel('index, [n]') %label the horizontal axis Ans : n: -4 -3 58 -2 92 -1 47 0 1 2 -78 3 11 4 41 5 6 6 7

y(n): 15

-60 -128

-17 -10

Plot of y(n) is :
convolution of two sequences 100

50

y[n]=x[n]*h[n]

-50

-100

-150 -4

-2

2 index, [n]

You might also like