

%lab3
%4

clear
w=[0:pi/1024:pi];
wo=.25*pi;
N=conv([1, -exp(j*wo)],[1,-exp(-j*wo)]);
D=conv([1,-.8*exp(j*wo)],[1,-.8*exp(-j*wo)]);
H=freqz(N,D,w);
magH=abs(H);
phaseH=angle(H);

mag_zero=H(w==wo);
mag_zero

subplot(2,1,1)
plot(w,magH);
xlabel('\omega');
ylabel('Amplitude');
title('Lab3,#4-Magnitude spectrum');
grid on
axis([0,pi,0,1.4]);

subplot(2,1,2)
plot(w,phaseH);
xlabel('\omega');
ylabel('Radians');
title('Lab3,#4-Phase spectrum');
grid on
axis([0,pi,-2,2]);