%ATTIQUE REHMAN.(28395921)
%PROJECT 1, DSP.(EE-416)
%DR.FAM.
%*********************************************

%syms n,z;
B=[0.025 -0.07 0.05 -0.02 0];   %Numerator Poly Coeff. as a vector set.
A=[1 1.5 1.75 1.02 0.4];        %Here Denominator Coeff as a vector set.
dt_sys=tf([0.025 -0.07 0.05 -0.02 0],[1 1.5 1.75 1.02 0.4],0.02)
[z,p,k]=residuez(B,A);          %Residues, Poles & direct terms are found here.

figure(1);
z=roots(B);
p=roots(A);
zplane(z,p);                    %z zeros and p poles are plotted.
title('Freq respoonce Plot');   %For reference purposes; Unit Circle
[h,w]=freqz(B,A,256,1000);      %freq responce utilizing 256 samples & 1000 units
figure (2);
plot(w,h);
title('Freq Responce Plot');
xlabel('Time');
ylabel('h(w)');
[H,T]= impz(B,A,25);            %impulse responce of the filter is computed here.
figure(3);
plot(T,H);                      %plots impulse responce wrt time.
figure(3);
plot(T,H);
title('Impulse responce');
xlabel('Time');
ylabel('Impulse Responce h(n)');

