PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

Analog and Digital Filters 631


disp(Pz2)
disp(‘The denominator coefficients are:’); disp(Qz2)
disp(‘********************************************’)
[mag1, phase1] = freqz (Pz1,Qz1,Wz);
[mag2, phase2] = freqz (Pz2,Qz2,Wz);
subplot (2,2,1)
plot (Wz, mag1)
title (‘Mag of Cheby. type/1, HPF’);
axis([0 5 0 1.1]);
xlabel (‘ W in rad’)
ylabel (‘Magnitude’)
subplot (2,2,2)
plot (Wz, phase1* 180/pi)
title (‘Phase of Cheby. type/1,HPF ‘)
ylabel (‘Angle in degrees’)
xlabel (‘ W in rad’)
subplot (2,2,3)
plot (Wz, mag2)
title (‘Mag.of Cheby. type/2, HPF’); axis([0 1 0 1.5]);
xlabel (‘W in rad’); ylabel (‘Magnitude’)
subplot (2,2,4)
plot (Wz, phase2 * 180/ pi);
xlabel (‘W in rad’)
ylabel (‘Angle in degrees’)
title(‘Phase. of Cheby. type/2, HPF’)
disp(‘****** FILTERS TRANSFER FUNCTIONS*******’)
disp(‘********************************************’)
disp(‘Chebyshev type 1’)
tf(Pz2,Qz2,T)
disp(‘^^^^^^^^^^^^^^^^^^^’)
disp(‘Chebyshev type 2’)
tf(Pz1,Qz1,T)
disp(‘****************************************************’)

The script fi le cheby_HPF is executed and the results are shown as follows (Figure 6.59):

>> cheby _ HPF

********************************************
************* R E S U L T S ***************
********************************************
For the transfer function H(z) of the Cheby/type1 HPF
the numerators coefficients are:
0.8006 -2.4019 2.4019 -0.8006

The denominator coefficients are:
1.0000 -2.5767 2.2067 -0.6217

For the transfer function H(z) of the Cheby/type2 HPF
The numerators coefficients are:
0.9564 -2.8530 2.8530 -0.9564

The denominator coefficients are:
1.0000 -2.8943 2.8098 -0.9147
Free download pdf