PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

Analog and Digital Filters 613


disp(‘Coefficients of the denominator of the transf. function
[butter/wc=2rad/sec]’)
disp(Ql)
tf(Pl,Ql)
disp(‘**************************************************’)

figure(5)
w =0:.1:5;
Hl =freqs(Pl,Ql,w);
mag5=abs(Hl);
phase5=angle(Hl);
subplot(1,2,1)
plot(w,mag5)
xlabel(‘frequency in rad/sec’);
ylabel(‘Magnitude’);
title(‘Magnitude of H(w) vs. w [Butter/wc=2]’);
subplot(1,2,2)
plot(w,phase5*180/pi)
xlabel(‘frequency in rad/sec’);
ylabel(‘Angle in degrees’);
title(‘Phase of H(w) vs. w [Butter/wc=2]’)

Back in the command window, the script fi le shifting_LPF is executed and the results are
shown as follows (Figures 6.38 through 6.42):

>> shifting _ LPF
**************************************************
******* M A T L A B ***** R E S U L T ************
**************************************************

Solution to part (c)
Coefficients of numerator of trans. function [LPF/ with
L=C=1/2,R=1]
1
Coefficients of denominator of trans. function [LPF/lp2lp/wc=2]
0.2500 0.5000 1.0000

Transfer function:
1
--------------------
0.25 s^2 + 0.5 s + 1

**************************************************
**************************************************
Solution to part (e)
Coefficients of the numerator of the trans. function [wc=1]
4

Coefficients of the denominator of the trans. function [wc=1]
1.0000 2.0000 4.0000
Transfer function:
4
-------------
s^2 + 2 s + 4
**************************************************
Free download pdf