Digital Signal Processing Reference
In-Depth Information
Next, the direct-form I implementation of the IIR filter is illustrated in
Figure 9.16
.
As shown in the figure, the
purpose of the scale factor C is to scale down the original filter coefficients to the Q-format. The factor C is usually
chosen to be a power of 2 for using a simple shift operation in DSP.
x
()
C
1/
S
b
C
0
/
s
yn
()
()
f
yn
S
s
xn
()
yn
()
+
bC
1
/
−1
−
aC
1
/
−1
+
−1
−
aC
2
/
−1
−1
b
C
M
/
−
aC
N
/
−1
FIGURE 9.16
Direct-form I implementation of the IIR filter.
EXAMPLE 9.14
The IIR filter
yðnÞ¼2xðnÞþ0:5yðn 1Þ
uses
the
direct-form I
realization,
and
for
a
particular
application,
the maximum input
is
I
max
¼ 0:010.:0
2
¼ 0:25. Develop the DSP implementation equations in the Q-15 fixed-point system.
Solution:
This is an IIR filter whose transfer function is
2
1 0:5z
1
¼
2z
z 0:5
HðzÞ¼
Applying the inverse z-transform, we obtain the impulse response
hðnÞ¼2 ð0:5Þ
n
uðnÞ
To prevent overflow in the adder, we can compute the S factor with the help of the Maclaurin series or approximate
Equation
(9.2)
numerically. We get
2ð0:5Þ
0
þ 2ð0:5Þ
1
þ 2ð0:5Þ
2
þ/
¼
0:25 2 1
1 0:5
S ¼ 0:25
¼ 1
The MATLAB function
impz()
can also be applied to find the impulse response and the S factor:
>> h
¼
impz(2,[1
0.5]); % Find the impulse response
>> sf
¼
0.25*sum(abs(h)) % Determine the sum of absolute values of h(k)
sf
¼
1
Hence, we do not need to perform input scaling. However, we need scale down all the coefficients to use the
Q-15 format. A factor of C ¼ 4 is selected. From
Figure 9.16
, we get the difference equations as
x
s
ðnÞ¼xðnÞ
y
s
ðnÞ¼0:5
s
xðnÞþ0:125y
f
ðn 1Þ
Search WWH ::
Custom Search