PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

Analog and Digital Filters 581


R.6.69 The following example illustrates the case where the desired transfer function of
an LP Butterworth fi lter is given by a denominator polynomial of order 6, whereas
the numerator polynomial is of order 4, and wp = 0.3.

MATLAB Solution
>> [num,den] = maxflat (4,6,0.3)
num =
0.0086 0.0344 0.0515 0.0344 0.0086
den =
1.0000 -2.4633 3.0480 -2.1861 0.9427 -0.2278 0.0239

R.6.70 Once the poles, zeros, and gain of the desired fi lter transfer function are known (indi-
cated by the variables p, z, and k), the numerator and denominator polynomial coef-
fi cients of the transfer function can be obtained by using the MATLAB function

[num, den]zp2tf(z, p, k)

R.6.71 The following function fi les can be used in the analysis and synthesis of analog
Chebyshev type-1 fi lters:
a. [z, p, k] = cheblap(n, Rp ) returns the zeros (z), poles (p), and gain factor (k) of the
normalized analog type-1 Chebyshev LPF transfer function of order n with a
pass-band ripple Rp expressed in decibels.
b. [num, den] = cheby1(n, Rp, wn, ‘s’) returns the num and den of the LPF transfer
function of order n (numerator and denominator) as vectors consisting of the
polynomial coeffi cients of the transfer function in descending powers of s, given
Rp (pass-band ripple in decibel) and wn (pass-band edge in radians/second).
If wn is specifi ed as a two-element vector such as wn = [wl, wu], where wl < wu,
the function returns the transfer function of a second-order BPF with pass-band
edges given by wl and wu.
c. [num, den] = cheb1(n, Rp, wn, ‘fi ltertype’, ‘s’) returns the num and den of the transfer
function of order n (numerator and denominator) as vectors consisting of the
polynomial coeffi cients arranged in descending powers of s. When ‘fi ltertype’ is
specifi ed as ‘high’ for an HPF, or ‘stop’ for a BSF, then wn = [wu, wl] is given by two
values, for wu > wl, given the band-pass ripple Rp (in decibels).
d. [n, wn] = cheb1ord(wp, ws, Rp, Rs, ‘s’) returns the lowest LPF order (n) of the
Chebyshev type-1 analog fi lter, where wn indicates the cutoff frequency (radians
per second), given the following input variables:
wp = Pass-band edge (rad/s)
ws = Stop-band edge (rad/s)
Rp = Maximum pass-band attenuation (dB)
Rs = Minimum stop-band attenuation (dB)
R.6.72 The function fi les used for the analysis and synthesis of analog type-2 Chebyshev
fi lters are summarized as follows:
a. [z, p, k] = cheb2ap (n, Rs)
b. [num, den] = cheby2 (n, Rs, wn, ‘s’)
c. [num, den] = cheby2 (n, Rs, ‘fi ltertype’, ‘s’)
d. [n, wn] = cheb2ord (wp, ws, Rp, Rs, ‘s’)
Free download pdf