Experiment No. 6: % Program For Convolution
Experiment No. 6: % Program For Convolution
19
Experiment No. 6
Aim: Write a program to find the convolution of two sequences using inbuilt convolution
function.
Objective: Plot an output signal for convolution function of two sequences on a single window.
System Requirement: PC having MATLAB 7.0.4.365 software.
Theory: The linear convolution of two sequencesx(n) and h(n) with length n1 and n2
respectively will give a sequence with a length of
N=N1+N2-1
When x(n) and h(n) have a duration less than N for implementing the linear convolution using
circular convolution N2-1 and N1-1 zeros are added at the end of x(n) and h(n) respectively to
increase the length to N.
Program:
clc;
% Program for Convolution
x1=input('enter 1st sequence');
x2=input('enter 2nd sequence');
c1=Conv(x1,x2);
subplot(1,3,1);
stem(x1);
xlabel('n');
ylabel('Amplitude');
title('1st input sequence(1810606)');
subplot(1,3,2);
stem(x2);
xlabel('n');
ylabel('Amplitude');
title('2nd input sequence(1810606)');
subplot(1,3,3);
stem(c1);
xlabel('n');
ylabel('Amplitude');
title('Convolution of two input sequences(1810606)');
Date: Roll No:1810636
20
Output Graph:
Result: Implementation of convolution of two sequences using inbuilt convolution function has
been done.
Conclusion: convolution of two sequences using inbuilt convolution function using MATLAB
software has been done.