%Damon Praefke
%25080241
%Project 2

function[]=dpraefke1();

T=ones(1,49);						%A vector of 1's, length 5
X=[1 1.5 1.75 1.02 0.4];		
Y=[0.025 -0.07 0.05 -0.02 0];
F=-7:0.001:7;

disp('Zeros of H(z)');			%Displays message on command window
Zeros=roots(Y)						%Calculates zeros of H(z)

disp('Poles of H(z)');			%Displays message on command window
Poles=roots(X)						%Calculates poles of H(z)

figure(1);
zplane(Y,X)							%plots the location of zeros and poles
										%on the unit circle in complex plane
title('Plot of pole-zero patterns');

% An examination of the poles and zeros locations on the complex plane
% reveals that the filter h(n) is stable, i.e. no poles are located outside
% of the unit circle




H=freqz(Y,X,F);					%Computes frequency response vector H

figure(2);
freqzplot(H,F);					%Plots frequency response vector H
title('Plot of frequency response of H(z)');

disp('Coefficients of h(n)');
hn =filter(Y,X,T)					%Calculates h(n)

figure(3);
plot(hn)
title('Plot of h(n)');







