|
From: Ulrich K. <ul...@ch...> - 2012-03-05 20:05:08
|
Jan Stary <ha...@st...>:
> I still don't get it: on my system, sizeof(float) = 4.
> How can four-byte floats represent larger dynamic range
> than four-bytes integers (which, if I remember right,
> is currently SoX's internal sample format)?
For illustration, consider decimal numbers of four digits. Treated as
unsigned integers, you may express values from 0 ("0000") or 1
("0001") to 9999 ("9999") with them, so you have a dynamic range of
9999:1 = 9999, or approximately 80 dB. Treated as floats however,
"2718" were to be interpreted as 2.71*10^8 = 271000000, so you can
express values from 1 ("1000") to 9990000000 ("9999"), and the dynamic
range is about 200 dB. (It might even be a bit more, if you allow
denormalized numbers like "0010" = 0.001.)
The trade-off involved is, of course, that you can't express the
difference between 9990 and 9994 with our "decimal floats".
Ulrich
|