%lab3
%#3
clc
clear
b=[1];
a=[1,-.6];
w=[0:pi/1024:pi];
H=freqz(b,a,w);
magH=abs(H);
phaseH=angle(H);

X=1./(1+(-.6)*exp(-j*w));
magX=abs(X);
phaseX=angle(X);

subplot(2,2,1);
plot(w,magH);
xlabel('\omega');
ylabel('Amplitude');
title('Lab3, #3a-Magnitude Spectrum of x(n), using FREQZ command');
grid on
axis([0,pi,0,3]);

subplot(2,2,2);
plot(w,phaseH);
xlabel('\omega');
ylabel('Radians');
title('Lab3, #3a-Phase Spectrum of x(n), using FREQZ command');
grid on
axis([0,pi,-1,0]);

subplot(2,2,3);
plot(w,magX);
xlabel('\omega');
ylabel('Amplitude');
title('Lab3, #3b-Magnitude Spectrum of x(n)');
grid on
axis([0,pi,0,3]);

subplot(2,2,4);
plot(w,phaseX);
xlabel('\omega');
ylabel('Radians');
title('Lab3, #3b-Phase Spectrum of x(n)');
grid on
axis([0,pi,-1,0]);

