02.10.2019 Views

UploadFile_6417

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Characteristics of Prototype Analog Filters 409<br />

% db = Relative magnitude in db over [0 to wmax]<br />

% mag = Absolute magnitude over [0 to wmax]<br />

% pha = Phase response in radians over [0 to wmax]<br />

% w = array of 500 frequency samples between [0 to wmax]<br />

% b = Numerator polynomial coefficents of Ha(s)<br />

% a = Denominator polynomial coefficents of Ha(s)<br />

% wmax = Maximum frequency in rad/sec over which response is desired<br />

%<br />

w = [0:1:500]*wmax/500; H = freqs(b,a,w);<br />

mag = abs(H); db = 20*log10((mag+eps)/max(mag)); pha = angle(H);<br />

The impulse response h a (t) of the analog filter is computed using<br />

MATLAB’s impulse function.<br />

□ EXAMPLE 8.4 Design the analog Butterworth lowpass filter specified in Example 8.3 using<br />

MATLAB.<br />

Solution<br />

MATLAB script:<br />

>> Wp = 0.2*pi; Ws = 0.3*pi; Rp = 7; As = 16;<br />

>> Ripple = 10 ^ (-Rp/20); Attn = 10 ^ (-As/20);<br />

>> % Analog filter design:<br />

>> [b,a] = afd_butt(Wp,Ws,Rp,As);<br />

*** Butterworth Filter Order = 3<br />

>> % Calculation of second-order sections:<br />

>> [C,B,A] = sdir2cas(b,a)<br />

C = 0.1238<br />

B = 0 0 1<br />

A = 1.0000 0.4985 0.2485<br />

0 1.0000 0.4985<br />

>> % Calculation of Frequency Response:<br />

>> [db,mag,pha,w] = freqs_m(b,a,0.5*pi);<br />

>> % Calculation of Impulse response:<br />

>> [ha,x,t] = impulse(b,a);<br />

The system function is given by<br />

H a(s) =<br />

0.1238<br />

(s 2 +0.4985s +0.2485) (s +0.4985)<br />

This H a(s) isslightly different from the one in Example 8.3 because in that<br />

example we used Ω c = 0.5, while in the afd butt function Ω c is chosen to<br />

satisfy the specifications at Ω p. The filter plots are shown in Figure 8.15. □<br />

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).<br />

Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!