• Software
  • mp3 bit depth of 24 (effective of 20) and floating point?
2015/04/20 13:42:29
mettelus
I was always curious why Adobe Audition shows opened mp3s (it has rendered) as 32-bit (float), and assumed it was a bug in the program. I went on a search this morning and this post left me scratching my head. http://taperssection.com/index.php?PHPSESSID=72d25e1e94dd723a7e42258fbb4bb5f8&topic=136471.msg1779929#msg1779929
 
A couple comments he makes stand out big time (but he also posted a truckload of supporting info):
 
"From what I understand, mp3's are floating point representations..."
 
[and last paragraph] "As to the original question, according to the IEC standard, mp3's can input/output at 24bits, and have 20bits of effective dynamic range.  Based on this, it seems that you would get better sound from converting 24bit pcm files directly to mp3, rather than dithering to 16bits first and then encoding...."
 
I always assumed mp3s were 16-bit (and fixed), but this guy is making the assertion that they are effectively 20-bit (and floats). Is this true?
 
2015/04/20 16:28:07
drewfx1
You can't equate an mp3's bit depth with the audio bit depth that we are familiar with.
 
Internally they do use a 32bit floating point data type, but we aren't talking about anything like a stream of samples at that bit depth (except perhaps near the input of an encoder or near the output of a decoder). If we want to try to think about the equivalent bit depth, the problem is that once the compression happens it is constantly changing with both time and frequency.
 
The decoder converts the compressed data back to a conventional stream of PCM samples and outputs it in fixed point. And an encoder will likely accept the 32 bit floating point audio that Sonar and most DAWs use internally.
2015/04/20 16:50:56
Sycraft
So MP3s can indeed represent more than 16-bits of dynamic range. You can test it, if you've a good enough setup, my encoding a sine wave below -96dB and then playing it back (provided your decoder decodes to 24-bit). It'll work, I've done it.
 
Now as to how much difference higher bit input makes, I dunno. Probably very little, if any, since part of what MP3s do is use knowledge about psychoacoustics where louder sounds mask quieter ones.
 
Internally they aren't really based on bits at all, at least not in the PCM sense. The way they deal with sound is complex, but it is more or less breaking it down in to a bunch of cosine waves and analyzing/storing information on that. So it isn't storing sample data as you might think of it, rather it stores information on how to do a mathematical approximation of the original data.
 
That math is generally done floating point, since computers these days loves them some floating point math, and it eliminates quantization errors in the reconstruction.
2015/04/21 07:54:09
mettelus
Thanks got that explanation Drew. I guess I have always simply associated it with the encoder window, since most give "bit depth" options. In Audition, regardless of what you choose it just "does its own thing" and the only user controlled parameters are really bit rate and CBR/VBR options.
 
Leaving everything else the same, choosing a bit depth in Audition when creating an mp3 has no effect on the render whatsoever, so realizing its algorithm doesn't correlate apples-to-apples helps a lot.
2015/04/21 10:38:50
bitflipper
This was a great question, mettelus, because it made me stop and think.
 
I'd always assumed that of all the things MP3 encoding messes with, dynamics wasn't one of them. At least, not directly. The process takes advantage of the masking effect, which I've long believed was the extent of its magic. Masking has nothing to do with dynamic range.
 
But after I thought about it, I realized that I did not know this to be a fact. After all, perceptual coding is all about tossing away stuff you can't hear, and surely that would include tiny fluctuations down near the noise floor. 
 
So I read up on it, looking for anything that would tell me if dynamics are ever sacrificed by lossy encoding. I found nothing that would suggest that it does, but also found nothing that explicitly assured me that it doesn't. So, as is often the case, I turned to experimentation to find out.
 
Long story short, I tested it and confirmed that MP3 encoding does not alter dynamic range, regardless of quality settings. The only thing it does do is lose a small amount of accuracy, small-enough of an error that it would not be audible.
 
2015/04/21 13:50:55
drewfx1
bitflipper
So I read up on it, looking for anything that would tell me if dynamics are ever sacrificed by lossy encoding. I found nothing that would suggest that it does, but also found nothing that explicitly assured me that it doesn't. So, as is often the case, I turned to experimentation to find out.

 
I believe every little piece gets non-linearly scaled a few times so you end up sacrificing some SNR on a piece by piece basis but maintain the overall dynamic range. But I'm not sure what the outer limits are.


2015/04/21 15:05:48
John
I thought I knew about MP3s. After reading this I know nothing about MP3s. 
2015/04/21 22:47:53
bitflipper
drewfx1
I believe every little piece gets non-linearly scaled a few times so you end up sacrificing some SNR on a piece by piece basis but maintain the overall dynamic range. But I'm not sure what the outer limits are.



This lines up with what I observed: a slight increase in noise, which I guess you could call quantization noise for lack of a better word. Certainly not a noticeable amount, a fraction of a decibel.
2015/04/22 03:37:47
mudgel
It sounds like you're all saying that MP3 doesn't sound any worse but I know that's not true.

Surely the loss of data and quality must be different for MP3 files created at lower bitrate say 64 as compared to 320. Vs the sound of a 16 bit 44.1khz PCM wav file.
2015/04/22 11:15:13
bitflipper
No, Mike, we're just saying that MP3s preserve dynamic range. Obviously, lots of other things get lost in translation, in particular short-term events and high frequencies. But they'll still be just as loud!
© 2025 APG vNext Commercial Version 5.1

Use My Existing Forum Account

Use My Social Media Account