PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

Analog and Digital Filters 585


R.6.94 The resulting relation between the analog frequency w and the discrete frequency
W is given by

W(2T)tan(W/2) ^ *^ (a nonlinear frequency transformation)
or

W2 arctan(w T/2)^ *^ *^
R.6.95 The MATLAB function unwrap(phase) unwraps the phase angle (in radians) and lim-
its the phase over the range of interest given by −π ≤ W ≤ +π.
R.6.96 The other transformations used in the design of LP, HP, BP, or BS fi lters from the
analog prototypes into the digital ones are given as follows:
a. LP: s = (2/T) * [(z − 1)/(z + 1)], w = (2/T) * tan(W/2)
b. HP: s = (2/T) * [(z + 1)/(z − 1)], w = −(2/T) * cot(W/2)

c. BP: s = (2/T) [(z^2 − (^2) c (^) z + 1)/(z^2 − 1)], w = (2/T) [(c − cos(W))/(sin(W))]
d. BS: s = (2/T) [(z^2 − 1)/(z^2 − (^2) c (^) z + 1)], w = (2/T) [(c − cos(W))/(sin(W))]−^1
R.6.97 An example of a bilinear transformation is provided as follows: Let us transform
the fi rst-order analog (RC) LPF illustrated by the circuit diagram of Figure 6.6 into
a digital fi lter. Recall that the fi lter transfer function is given by
Hw
Vjw
Vjw
jwC
jwC


R


RC


jw
RC

o
i

()


()


()


*


*


*














1


1


1


1


without any loss of generality let R = C = 1 and s = jw, then

Hs
Vs
Vs s

o
i

()


()


()








1


(^1)
Assuming that the sampling period is T = 2 and applying the corresponding
bilinear transformation defi ned in R.6.96 yields
Hs
z
z z
z























1


1


1


1


1


1










then the discrete transform becomes

H(z)0.5 0.5 *^ z

 (^1)
Note that in this simple example the resulting digital fi lter is an FIR. A more
complex analog fi lter transformation could result in an IIR fi lter. Hand computa-
tions can be avoided by using MATLAB as indicated in R.6.98.
R.6.98 The MATLAB function [numz, denz] = bilinear (numa, dena, 1/Ts ) returns the dis-
crete polynomial coeffi cients numz and denz (numerator and denominator of H(z))
arranged in descending powers of z, where numa and dena are the analog numera-
tor and denominator of H(s), where Ts indicates its sampling rate.

Free download pdf