Digital Signal Processing Reference
In-Depth Information
Enter the # of numerator coefficients (30 = Max, 0 = Exit) --> 3
Enter a(0)s^2 --> 1
Enter a(1)s^1 --> 0
Enter a(2)s^0 --> 0.5271
Enter the # of denominator coefficients --> 3
Enter b(0)s^2 --> 1
Enter b(1)s^1 --> 0.096
Enter b(2)s^0 --> 0.5271
Are the above coefficients correct ? (y/n) y
(
a
)
a(0)z^-0 = 0.94085 b(0)z^-0 = 1.00000
a(1)z^-1 = -0.58271 b(1)z^-1 = -0.58271
a(2)z^-2 = 0.94085 b(2)z^-2 = 0.88171
(
b
)
FIGURE D.9.
Use of
BLT.BAS
program for bilinear transformations: (
a
) coefficients in the
s
-plane; (
b
) coefficients in the
z
-plane.
-
1
-
2
bbz bz
az
+
+
+◊◊◊
()
=
0
1
2
Hz
1
+
-
1
+
az
-
2
+◊◊◊
1
2
which shows that MATLAB's
a
and
b
coefficients are the reverse of the notation
used in (5.1).
Exercise D.6: Utility Program
BLT.BAS
to Find
H
(
z
) from
H
(
s
)
The utility program
BLT.BAS
(on the CD), written in BASIC, converts an analog
transfer function
H
(
s
) into an equivalent transfer function
H
(
z
) using the bilinear
equation
s
1). To verify the results in (D.1) found in Exercise D.3 for
the second-order bandstop filter, run
GWBASIC,
then load and run
BLT.BAS.
The
prompts and the associated data for the
a
and
b
coefficients associated with
H
(
s
)
are shown in Figure D.9
a
, and the
a
and
b
coefficients associated with the transfer
function
H
(
z
) are shown in Figure D.9
b
, which verifies (D.1). Run
BLT.BAS
again
to verify (D.5) using the data in (D.4).
=
(
z
-
l)/(
z
+
Exercise D.7: Utility Program
AMPLIT.CPP
to Find Magnitude and Phase
, can be used to plot
the magnitude and phase responses of a filter for a given transfer function
H
(
z
) with
a maximum order of 10. Compile (using Borland's C
The utility program
AMPLIT.CPP
(on the CD), written in C
++
compiler) and run this
program. Enter the coefficients of the transfer function associated with the second-
order IIR bandstop filter (D.2) in Exercise D.3, as shown in Figure D.10
a
. Figures
D.10
b
and D.10
c
show the magnitude and phase of the second-order bandstop filter.
++
Search WWH ::
Custom Search