PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

600 Practical MATLAB® Applications for Engineers


g. Repeat H(f) versus f
∠H(w) versus f
H(f)dB versus f (semilog scale)
∠H(f ) versus f (semilog scale)
using standard circuit techniques.

ANALYTICAL Solution

Part (a)

Hw Vw
Vw

jwC

jwC

R

RC
jw
RC

o
i

() ()
()

*
* *







1

1

1

1

Part (b)

Hw RC
w
RC

()


1

2 1 2

*

*







∠H(w) = tan−^1 (w * R * C)

MATLAB Solution
% Script File: LP _ filter _ analysis
R=1e3/(2*pi);
C=.1e-6;
a=1/(R*C);
w =-5*a:10000:5*a;
num=a;
den=[1 a];
Hlp = freqs(num,den,w);
figure(1);
subplot(2,1,1);
plot(w/(2*pi),abs(Hlp));
xlabel (‘frequency in Hrz’);
ylabel (‘magnitude’);
title(‘Magnitude of H(f) vs. frequency’);

FIGURE 6.25
Circuit diagram of Example 6.1.


R = 1/(2*π) KΩ

Vi(w) C = 1 μF Vo(w)
Free download pdf