86 5. FIXED-POINT VS. FLOATING-POINT
frac
31 30
s exp
0 31
frac
01920
Even registerOdd r
egister
Figure 5.7: Double precision floating point representation.
e floating-point sum c has the following exponent and fractional parts:
c D a C b
D
a
frac
C
b
frac
2
.
a
exp
b
exp
/

2
a
exp
if a
exp
b
exp
(5.6)
D

a
frac
2
.
b
exp
a
exp
/
C b
frac
2
b
exp
if a
exp
< b
exp
:
ese parts are computed by the floating-point hardware. is shows that, although possible, it
is inefficient to perform floating-point arithmetic on fixed-point processors, since all the oper-
ations involved, such as those in the above equations, need to be performed by software.
5.3 OVERFLOW AND SCALING
As stated before, fixed-point processors have a much smaller dynamic range than their floating-
point processors. e ARM core is a fixed-point engine, mostly 32-bit. When available or used
on an ARM architecture, the ARM floating-point hardware VFP enables floating-point opera-
tions. e audio data received from a smartphone microphone are normally 16-bit wide. at is
why the Q15 representation of numbers needs to be considered. An ARM processor multiplier
can multiply two Q15 numbers and produce a 32-bit product. e product can then be stored in
32 bits and used in subsequent computations, or shifted back to 16 bits for outputting through
a smartphone speaker.
When multiplying two Q15 numbers, which are in the range of 1 and 1, the resulting
number will always be in the same range. However, when two Q15 numbers are added, the
sum may fall outside this range, leading to an overflow. Overflows can cause major problems by
generating erroneous results. When using a fixed-point processor, the range of numbers must
be closely monitored and adjusted to compensate for overflows. e simplest correction method
for overflows is scaling.
Scaling can be applied to most filtering and transform operations, where the input is scaled
down for processing and the output is then scaled back up to the original size. An easy way to
do scaling is by shifting. Since a right shift of 1 is equivalent to a division by 2, one can scale
the input repeatedly by 0.5 until all overflows disappear. e output can then be rescaled back
by the total scaling amount.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.26.176