02.convolve 2 Signals
02.convolve 2 Signals
clear all;
close all;
x = [0,2.5,4.7,6.5,7.6];
N1=length(x);
N=0:1:N1-1;
subplot(2,2,1);
stem(N,x);
xlabel('x(n)');
ylabel('x(n)');
title('input signal x(n)');
h = [8,7.6,6.5,4.7,2.5];
N2 = length(h);
n1 = 0:1:N2-1;
subplot(2,2,2);
stem(n1,h);
xlabel('x(n)');
ylabel('h(n)');
title('impulse signal h(n)');
y=conv(x,h);
n2 = 0:1:N1+N2-2;
subplot(2,2,3);
stem(n2,y);
xlabel('n');
ylabel('y(n)');
title('convolve of two seq x(h) and h(n)')