You are here
The "float/fixed" debate and more digital myths
41 posts
• Page 2 of 3 • 1, 2, 3
Re: The "float/fixed" debate and more digital myths
I stand corrected, I'm well out of date :thumbup:

Rich Hanson  Frequent Poster (Level2)
 Posts: 2137
 Joined: Sat Sep 06, 2003 12:00 am
 Location: UK
Re: The "float/fixed" debate and more digital myths
I have to be corrected so often that I find it more comfortable to sit :lol:Rich Hanson wrote:I stand corrected, I'm well out of date :thumbup:

Folderol  Jedi Poster
 Posts: 11480
 Joined: Sat Nov 15, 2008 1:00 am
 Location: The Mudway Towns, UK
Yes. I am that Linux nut.
Onwards and... err... sideways!
Onwards and... err... sideways!
Re: The "float/fixed" debate and more digital myths
@Rich Thanks for your input. This is how myths get busted!
The idea that 32 bit float contains unaltered 24 bit audio data scaled by an eight bit exponent is ... a myth. I don't know where this originated but it's all around the internet  I've never seen it explained any other way.
It may have been put together to reassure neurotic musicians who want to dither 24 bit audio ... twice.
What I said above about an exponent of 2^0 = 1 is wrong. With an exponent of 1 the numbers that can be represented are +1 to +2 and 1 to 2. That isn't a lot of use for audio.
The two's complement integers must be converted to a float between 1 and +1.
As far as I can see this doesn't introduce errors. Take 1 as an integer. To convert it to a float between 0 and 1 you would divide by 2^23 and that can be done exactly in a float with an exponent 0f 2^23.
1 > 1/(2^23) = 2^23
2 > 2/(2^23) = 1/(2^22) = 2^22
3 > 3/(2^23) (also exact)
4 > 4/(2^23) = 2^21
... and so on. This means the exponent is being used all the time.
The principle that no information is being lost or gained holds, but the details are more involved than the myth suggests.
The idea that 32 bit float contains unaltered 24 bit audio data scaled by an eight bit exponent is ... a myth. I don't know where this originated but it's all around the internet  I've never seen it explained any other way.
It may have been put together to reassure neurotic musicians who want to dither 24 bit audio ... twice.
What I said above about an exponent of 2^0 = 1 is wrong. With an exponent of 1 the numbers that can be represented are +1 to +2 and 1 to 2. That isn't a lot of use for audio.
The two's complement integers must be converted to a float between 1 and +1.
As far as I can see this doesn't introduce errors. Take 1 as an integer. To convert it to a float between 0 and 1 you would divide by 2^23 and that can be done exactly in a float with an exponent 0f 2^23.
1 > 1/(2^23) = 2^23
2 > 2/(2^23) = 1/(2^22) = 2^22
3 > 3/(2^23) (also exact)
4 > 4/(2^23) = 2^21
... and so on. This means the exponent is being used all the time.
The principle that no information is being lost or gained holds, but the details are more involved than the myth suggests.
 merlyn
 Regular
 Posts: 144
 Joined: Thu Nov 07, 2019 3:15 am
Re: The "float/fixed" debate and more digital myths
merlyn wrote:...the details are more involved than the myth suggests.
Isn't that always the way? :D :ugeek:

Hugh Robjohns  Moderator
 Posts: 28666
 Joined: Fri Jul 25, 2003 12:00 am
 Location: Worcestershire, UK
Technical Editor, Sound On Sound
Re: The "float/fixed" debate and more digital myths
merlyn wrote:The idea that 32 bit float contains unaltered 24 bit audio data scaled by an eight bit exponent is ... a myth.
I'm not sure if you were referring to me or not, but I'll say if it wasn't clear is that I didn't think that was the case. When I say that 32floating audio format contains 24bit audio data, it doesn't mean I think it's a naive mapping of 24bits of fixed point stuck in the lower bits of the floating point number  but I can see that it can be interpreted (incorrectly) as that's what's going on.
One thing I do say is that float numbers are "mathsy" and not at all intuitive to "regular" folk compared to fixed point files which are reasonably straighforward, and the times when I've looked into it just makes me realise that the full details are over rather over my head and I have needed to get into it deeply enough for a complete understanding. I understand just enough of it to be useful (and not *too* dangerous!) ;)
merlyn wrote:I don't know where this originated but it's all around the internet  I've never seen it explained any other way.
Indeed. Like many things about digital audio, often they are explained by people who don't know the full details, because the full details have complexities that are problematic to explain to us more naive folk.
merlyn wrote:The two's complement integers must be converted to a float between 1 and +1.
Indeed.
merlyn wrote:The principle that no information is being lost or gained holds, but the details are more involved than the myth suggests.
Yes.
Also, I vaguely recall (but don't have the full details offhand) something about the floating range when you get high up is that the resolution isn't quite linear like integers  the gaps between numbers on the scale get bigger as you go. Maybe you can explain that to us laymen...

desmond  Jedi Poster
 Posts: 10301
 Joined: Tue Jan 10, 2006 1:00 am
mu:zines  music magazine archive  difficultAudio
Re: The "float/fixed" debate and more digital myths
Most users don't realise that digital audio typically uses of two's complement binary, or the fundamental reasons for that, and will probably never grasp the important subtleties of IEEE floating point formats...
And most explanations are (over) simplified to try and get a concept across, rather than the detail... which is absolutely fine in my book. Most people aren't interested in, and don't need the technical detail, and the few who are interested will be quite capable of moving beyond the simplified analogies.
H
And most explanations are (over) simplified to try and get a concept across, rather than the detail... which is absolutely fine in my book. Most people aren't interested in, and don't need the technical detail, and the few who are interested will be quite capable of moving beyond the simplified analogies.
H

Hugh Robjohns  Moderator
 Posts: 28666
 Joined: Fri Jul 25, 2003 12:00 am
 Location: Worcestershire, UK
Technical Editor, Sound On Sound
Re: The "float/fixed" debate and more digital myths
Back in the dim and distant past (i.e. pre IEEE standardisation) there was a floating point format that was effectively a 2's complement with an exponent, so that's probably where the myth originated. My experience was on an old GEC minicomputer with 14 bit word length, so that gives you some idea of how long ago :bouncy: (Needless to say that in 14 bits, the accuracy was less than stellar, we tended to use our own fixed point libraries instead)
Anyway, back to the subject in hand!
Anyway, back to the subject in hand!

Rich Hanson  Frequent Poster (Level2)
 Posts: 2137
 Joined: Sat Sep 06, 2003 12:00 am
 Location: UK
Re: The "float/fixed" debate and more digital myths
desmond wrote:Also, I vaguely recall (but don't have the full details offhand) something about the floating range when you get high up is that the resolution isn't quite linear like integers  the gaps between numbers on the scale get bigger as you go. Maybe you can explain that to us laymen...
That's not so difficult to see, without even considering radix complements and IEEE 754. it's just a general consequence of the fact that the representation uses a nonlinear function and that you have only so many bits available to represent the function parameters (for a format say as "1.decimals x 10 power exponent" you will have a onlya given number of bits for "decimals" and for "exponent").
For fixed point representation (in the form "number dot decimals"), the "fixed number" of bits for "number" and "decimals" means that you have constant gaps between the real numbers that can be represented and numbers that cannot (and will be approximated, typically to the nearest lower representable number).
Say you allocate 2 bits for the decimals, you can represent only .0, .1, .2 and .3 as decimal parts, so that the real numbers 1.15 and 1.16 will end up both as,say 1.1  the gap between the numbers you can represent will be a constant .1 . In other words, the mapping between reals and representation  so long there is one  is linear because the mapping function is linear.
With a representation that uses a power 10 function (or whatever nonlinear mapping), you still have the same "constant spacing" for the decimal part, but the multiplier will vary nonlinearly, leading to an nonlinear spacing between the representable numbers.
Say you use 2 bits for decimal part and 2 bits the exponent: you will have 0,1,2 and 3 as possible decimal parts (leading to 1.0, 1.1, 1.2 and 1.3 as left multiplier) and 1, 10, 100 and 1000 as possible right multipliers. Therefore, the numbers you can represent are therefore 1, 1.1, 1.2, 1.3, then 10, 11, 12, 13, then again 100, 110, 120, 130 and finally 1000, 1200, 1300, 1400. So the gaps between numbers that can be represented (or equivalently, the approximation error when you map real numbers) varies nonlinearly (and gets bigger for bigger numbers that you want to represent).
The same will happen with any representation using a nonlinear function, with the "gaps" between numbers varying according to the specific nonlinear function used.

CS70  Jedi Poster
 Posts: 6243
 Joined: Mon Nov 26, 2012 1:00 am
 Location: Oslo, Norway
Silver Spoon  Check out our latest video and the FB page
Re: The "float/fixed" debate and more digital myths
If I have a go at explaining that ...
23 bits is 8,388,608 different values. If the exponent is 2^0 = 1 there are 8,388,608 steps between 1 and 2. If the exponent is 2^1 = 2 there are the same number of steps but now these steps span the interval between 2 and 4. This is the same number of steps covering twice the range. If the exponent is 2^2 = 4 there are the same number of steps to cover the interval between 4 and 8. The distance between steps is getting bigger as the exponent goes up.
The exponent can go up to 2^127 = 170 141 183 460 469 231 731 687 303 715 884 105 728.
Those ~8 million steps don't seem like so many now :D
23 bits is 8,388,608 different values. If the exponent is 2^0 = 1 there are 8,388,608 steps between 1 and 2. If the exponent is 2^1 = 2 there are the same number of steps but now these steps span the interval between 2 and 4. This is the same number of steps covering twice the range. If the exponent is 2^2 = 4 there are the same number of steps to cover the interval between 4 and 8. The distance between steps is getting bigger as the exponent goes up.
The exponent can go up to 2^127 = 170 141 183 460 469 231 731 687 303 715 884 105 728.
Those ~8 million steps don't seem like so many now :D
 merlyn
 Regular
 Posts: 144
 Joined: Thu Nov 07, 2019 3:15 am
Re: The "float/fixed" debate and more digital myths
Yes indeed. By the way there is a nice blog here...
https://blogs.mathworks.com/cleve/2014/07/07/floatingpointnumbers/
In some fields people are looking at using less bits to represent numbers than the standard 32/64 and also proposing other floatingpont representations with different distributions. Specialist hardware (GPUs) now support shorter number formats which means that multiple operations can run faster and also you get an advantage because it takes less memory and memory bandwidth to compute on numbers represented by less bits.
For audio (and I doubt we care anyway) it could even turn out that the distribution you note is actually a good thing as we use log scales as more relevant to hearing response in any case
https://blogs.mathworks.com/cleve/2014/07/07/floatingpointnumbers/
In some fields people are looking at using less bits to represent numbers than the standard 32/64 and also proposing other floatingpont representations with different distributions. Specialist hardware (GPUs) now support shorter number formats which means that multiple operations can run faster and also you get an advantage because it takes less memory and memory bandwidth to compute on numbers represented by less bits.
For audio (and I doubt we care anyway) it could even turn out that the distribution you note is actually a good thing as we use log scales as more relevant to hearing response in any case
 wireman
 Frequent Poster
 Posts: 549
 Joined: Fri Dec 17, 2004 1:00 am
Re: The "float/fixed" debate and more digital myths
We never actually hear a 32 bit float. A to Ds and D to As are 24 bit.
This ties into your question earlier about what happens to a 32 bit float signal at +20dBFS. That can only happen inside a DAW.
Sampled data (24 bit) > internal processing (32 bit float) > reconstruction (24 bit)
By applying a gain of 20dB to a track the internal bus could have a level of +20dBFS but if you send that to the master bus with the master fader at 0dB it's going to be a distorted mess. The master fader would have to be at 20dB.
The master fader is dividing by a constant, in this case 10. It brings the 32 bit float back into the 1 to +1 range. Tracks can go over, but the master bus can't because it is outputting to 24 bit.
This ties into your question earlier about what happens to a 32 bit float signal at +20dBFS. That can only happen inside a DAW.
Sampled data (24 bit) > internal processing (32 bit float) > reconstruction (24 bit)
By applying a gain of 20dB to a track the internal bus could have a level of +20dBFS but if you send that to the master bus with the master fader at 0dB it's going to be a distorted mess. The master fader would have to be at 20dB.
The master fader is dividing by a constant, in this case 10. It brings the 32 bit float back into the 1 to +1 range. Tracks can go over, but the master bus can't because it is outputting to 24 bit.
 merlyn
 Regular
 Posts: 144
 Joined: Thu Nov 07, 2019 3:15 am
Re: The "float/fixed" debate and more digital myths
merlyn wrote:We never actually hear a 32 bit float. A to Ds and D to As are 24 bit.
That was the case... but we now have Zoom and Sound Devices promoting their 32bit floatingpoint AD converters in their premium portable recorders. So I suspect it won't be that long before we have other interface and preamp manufacturers offering and boasting about the same capability... not because it's really needed (in most conventional recording situations) but just because it's a bigger number that will please the marketing team. :crazy:
And DAs that directly accept 32bit float via a USB connection can only be a trade show or two away, too... :beamup:

Hugh Robjohns  Moderator
 Posts: 28666
 Joined: Fri Jul 25, 2003 12:00 am
 Location: Worcestershire, UK
Technical Editor, Sound On Sound
 merlyn
 Regular
 Posts: 144
 Joined: Thu Nov 07, 2019 3:15 am
Re: The "float/fixed" debate and more digital myths
They've dropped hints that their practical implementation involves more than three separate preamp and AD paths, too. And yes, lots of numbercrunching required to blend the various output data together sensibly! Seems to work very well, though...
H
H

Hugh Robjohns  Moderator
 Posts: 28666
 Joined: Fri Jul 25, 2003 12:00 am
 Location: Worcestershire, UK
Technical Editor, Sound On Sound
Re: The "float/fixed" debate and more digital myths
I think sanity will prevail and 32 bit float recording will remain a niche activity. For a field recorder it makes sense  it can't clip.
But for a USB interface I can't see it taking off. The DSP must introduce latency. Early adopters would report that their 32 bit float interface was more expensive, sounds the same and has more latency. Hardly a glowing recommendation. :D
Of course we'll see and sanity has had a habit of not prevailing recently. :D
But for a USB interface I can't see it taking off. The DSP must introduce latency. Early adopters would report that their 32 bit float interface was more expensive, sounds the same and has more latency. Hardly a glowing recommendation. :D
Of course we'll see and sanity has had a habit of not prevailing recently. :D
 merlyn
 Regular
 Posts: 144
 Joined: Thu Nov 07, 2019 3:15 am