You are on page 1of 1

%Convolution of 2 sequences

clc;
close all;
clear all;
x=[2 3 4];
h=[5 6 7];
y=conv2(x,h);
subplot(3,1,1);
stem(x);
grid;
xlabel('n');
ylabel('x(n)');
title('input sequence');
subplot(3,1,2);
stem(h);
grid;
xlabel('n');
ylabel('h(n)');
title('impulse sequence ');
subplot(3,1,3);
stem(y);
grid;
xlabel('n');
ylabel('y(n)');
title('convolution sequence');
display('the convolution sequence is:');
display(y);

You might also like