clc;
clear;

n = 0:1000;
x = 1 + sin(pi*n/4) + sin(pi*n/2);
h = (1.9*(-0.9).^n);
y = conv(x,h);

subplot(2,1,1);
plot(1+1.08*sin(pi*n/4+.371)+1.41*sin(pi*n/2+.733), 'b');
axis([0 100 -2 4]);
title('Theoretical Result');

subplot(2,1,2);
plot(y(1:length(y)/2), 'r')
axis([0 100 -2 4]);
title('Matlab Result');
