% EE 483
% Matlab project-1
% Peter Agliata
% 2856-4504

num=[0.025,-0.07,0.05,-0.02];
den=[1,1.5,1.75,1.02,0.4];
[z,p,k]=tf2zp(num,den);
subplot(311)
zplane(z,p);
[h,w]=freqz(num,den,50,'whole');
subplot(312)
plot(w,h);
title('Frequency Response')
xlabel('Frequency (w)')
ylabel('H(w)')
[H,T]=impz(num,den,30);
subplot(313)
stem(T,H);
title('Impulse Response')
xlabel('Time (t)')
ylabel('h(t)')


[R,P,K]=residuez(num,den)

syms z
p1=iztrans((-0.0514 - 0.0332i)/(1-(-0.2228 + 0.8300i)*z^(-1)));
p2=iztrans((-0.0514 + 0.0332i)/(1-(-0.2228 - 0.8300i)*z^(-1)));
p3=iztrans((-0.0639 + 0.1149i)/(1-(-0.5272 + 0.5136i)*z^(-1)));
p4=iztrans((-0.0639 - 0.1149i)/(1-(-0.5272 - 0.5136i)*z^(-1)));
p=p1+p2+p3+p4
