% Jacob Bowen
% A script to compute y[n] using a convolution for verification.

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

subplot(2,1,1);
stem(y);

% Analytical solution (by hand) for comparison
yn = 1 + 1.08*sin(pi*n/4 + 0.371) + 1.41*sin(pi*n/2 + 0.733);

subplot(2,1,2);
stem(yn);