Digital Signal Processing Reference
In-Depth Information
Assuming the worst conditions, that is, that all the inputs xðnÞ reach a maximum value of I max and all
the impulse coefficients are positive, the sum of the adder gives the most conservative scale factor, as
shown in Equation (9.2) . Hence, scaling down the input by a factor of S will guarantee that the output
of the adder is in Q-format.
When some of the FIR coefficients are larger than 1, which is beyond the range of Q-format
representation, coefficient scaling is required. The idea is that scaling down the coefficients will make
them less than 1, and later the filtered output will be scaled up by the same amount before it is sent to
DAC. Figure 9.15 describes the modified implementation.
bB
0 /
s yn
()
1/ S
y(n )
x ( )
s xn
()
+
B
S
bB
1 /
1
+
1
bB
K /
1
FIGURE 9.15
Direct-form I implementation of the FIR filter.
In the figure, the scale factor B makes the coefficients b k =B convertible to the Q-format. The scale
factors S and B are usually chosen to be a power of 2, so the simple shift operation can be used in the
coding process. Let us implement an FIR filter containing filter coefficients larger than 1 in the fixed-
point implementation.
EXAMPLE 9.13
Given the FIR filter
yðnÞ¼0:9xðnÞþ3xðn 1Þþ0:9xðn 2Þ
with a passband gain of 4, and assuming that the input range only occupies one quarter of the full range for
a particular application, develop the DSP implementation equations in the Q-15 fixed-point system.
Solution:
The adder may cause overflow if the input data exist for one quarter of the full dynamic range. The scale factor is
determined using the impulse response, which consists of the FIR filter coefficients, as discussed in Chapter 3.
S ¼ 1
4 ðjhð0Þj þ jhð1Þj þ jhð2ÞjÞ ¼ 1
4 ð0:9 þ 3 þ 0:9Þ¼1:2
Overflow may occur. Hence, we select S ¼ 2 (a power of 2). We choose B ¼ 4 to scale all the coefficients to be
less than 1, so the Q-15 format can be used. According to Figure 9.15 , the developed difference equations are
given by
xðnÞ
2
x s ðnÞ¼
y s ðnÞ¼0:225x s ðnÞþ0:75x s ðn 1Þþ0:225x s ðn 2Þ
yðnÞ¼8y s ðnÞ
 
Search WWH ::




Custom Search