clear all; clc;

%% PART A
n = 0:100;
a = [1 -0.5 0.25];
b = [1 2 1];

h = filter(b, a, [1, zeros(1, length(n)-1)]); %impulse response

subplot 211; stem(n,h); 
title('Impulse Response');

%% PART B
y = sum(abs(h))

%stable

%% PART C

n1 = 0:100;

x = 5 + 3*cos(0.2*pi*n) + 4*sin(0.6*pi*n);

h1 = filter(b, a, x);

subplot 212; stem(n1,h1);
title('Impulse Response to input x(n)');
