from Signal Processing & Linear Systems Companion Software by B. P. Lathi
Companion software for Signal Processing & Linear Systems

c122alt.m
a=0.83

num=[1 0 -1]; den=[1 -sqrt(2)*a a^2];
W=-pi:pi/100:pi;
H=freqz(num,den,W);
mag1=abs(H);
phase1=180/pi*unwrap(angle(H));

a=0.9
num=[1 0 -1]; den=[1 -sqrt(2)*a a^2];
H=freqz(num,den,W);
mag2=abs(H);
phase2=180/pi*unwrap(angle(H));

a=0.96
num=[1 0 -1]; den=[1 -sqrt(2)*a a^2];
H=freqz(num,den,W);
mag3=abs(H);
phase3=180/pi*unwrap(angle(H));

subplot(2,1,1);
plot(W,mag1,W,mag2,W,mag3);
subplot(2,1,2);
plot(W,phase1,W,phase2,W,phase3);

Contact us at files@mathworks.com