[linux-audio-dev] Fixed vs. floating point

cpolymeris at gmx.net cpolymeris at gmx.net
Fri Oct 14 19:00:37 UTC 2005


> For example if you divide a sample by a large enough value the result 
> will be zero (total loss of precision). Equally well if you multiply it by
> a large number there will be an overflow. This means that a programmer 
> using fixed point needs to keep thinking about precision and overflows 
> all the time. This may require much more hacking energy than developing 
> the algorithms. In particular debugging will be pain.
> 
> Floating point in turn has 24 bits of precision which is enough for audio.
> The exponent part takes care of scaling while the mantissa stays always 
> normalized to the full 24 bit precision. In fact 64 bit precision is used 
> for computations and intermediate results inside the FPU (x86 at least). 
> In this way the programmer doesn't need to think about the precision (in 
> most cases).
> 

First of all, thank you all very much for you comments, the picture is much
clearer now.

I just don't fully understand the floating-point precission part. If numbers
from binary 0.1 to 1.0 are represented using 24 bits (sign bit + mantissa, I
think the implicit 1 does not count), and the numbers from binary 0.01 to
0.1 also have 24 bits of precision, and so on for 0.001..0.01, etc. wouldn't
that mean we have a higher resolution?
We are using 7 of 8 exponent bits too. Just wasting the cases where the
exponent is larger than 0, or has some special meaning.)
That would give you 31 bits, minus a couple useless and redundant cases.
(when the exponent is -128, and denormalizing ocurrs)

Then I also fail to see why it's bad for overflows to ocurr in fixed point.
Those signals (above 0dB FS) would clip on the hardware anyway, and are
expected to do so, since they were either badly recorded or amplified.

Greetings, Dimitri

-- 
Highspeed-Freiheit. Bei GMX supergünstig, z.B. GMX DSL_Cityflat,
DSL-Flatrate für nur 4,99 Euro/Monat*  http://www.gmx.net/de/go/dsl



More information about the Linux-audio-dev mailing list