mp3, dithering and bit depth

How to do this, that and the other. Share, learn, teach. How did X do that? How can I sound like Y?
Post Reply New Topic
RELATED
PRODUCTS

Post

From a while I'm puzzled with the question of what would be best way to prepare audio for mp3. That is concerning dithering and bit depth.

From what I read here and there I figured out that:
- mp3 audio is stored as floating point, so can be rendered out in any bit depth (16,24,32)
- I don't know if decoders apply dithering on output
- encoders (lame at least) accept both 16 bit and 24 bit input

So possible input formats for mp3 could be:
(1) 24 bit, no dithering
(2) 16 bit, dithered
(3) 16 bit, no dithering

And I am wondering which would be best - easiest to encode, best quality output:
- dithering is basically introducing noise to the mix, so why to do that is encoder accepts 24 bit? Also it seems noise is most difficult to compress by mp3. Maybe (1) would be best?
- but reducing bit depth is a sort of compression, also someone wrote somewhere on another forum, that mp3 artifacts are much worse than bit reduction artifacts, so maybe do (3)?
- on the other hand, I guess encoders were written having in mind compressing CD audio, which is (2), so maybe they are optimized primarily for this kind of input? What if they are only tested throughly on (1) and it would result exposing some bugs?
- in the end, maybe mp3 encoding is so devastating that actually these subtle differences are not worth bothering?

I'm pretty ignorant when it comes to such technical stuff, so I may only wonder about it. Maybe someone which knowledge of mp3 encoding could clarify those issues? Or just write what do you do and why.

Before you ask, I did experiment a bit, I was comparing VBR LAME out of same track of (1) and (2). First output file was larger and I couldn't tell the difference by just hearing, however my ears are not so quality sensitive and my gear is rather of mediocre quality. I am doing mp3 of (2), but I wonder maybe it doesn't actually make sense? I'm just curious.

Post

This thread on Hydrogen audio should shed some light : http://www.hydrogenaudio.org/forums/ind ... opic=55336

Post

I have a feeling the encoder reduces it to 16 bit prior to encoding, but I don't know that for sure. Just because it accepts 24 bit, doesn't mean that's what it encodes. At the very least, even if the 24 bit audio signal were preserved in the MP3, not all audio interfaces and MP3 players are able to play 24 bit audio, so you would definitely want to dither. So, I guess my answer would be #2 (16 bit, dither)
Image

Post

24 bit no dithering
Do not lick the fablanky

Post

aetmos wrote:I have a feeling the encoder reduces it to 16 bit prior to encoding
According to this, you're wrong and it's the other way around, encoder converts to 32bits floating point prior to encoding.

aetmos wrote:not all audio interfaces and MP3 players are able to play 24 bit audio, so you would definitely want to dither.
Yes, that's right. But at first, some decoders (MAD and foobar2k at least) apply their own dither, so in such case you would double dither. Also it might be that source dithering may be partly lost during encoding, considering mp3 philosophy (removing what average listener can't hear). Little do I know, I'm as dumb as I was. :?

Post

Okay, rather than wade through a bunch of speculation over at HydrogenAudio, where one guy actually seems to think dithering is always unnecessary, I decided to just test it for myself. I figure if I shouldn't dither, than encoding a very quiet mp3 from a 24bit recording should sound better than a 16bit dithered recording.

So, I took the tail end of a 24bit recording of a bell, and normalized the peak of the recording to -50dB. Listen here

I then encoded it to mp3 (LAME), decoded it in Wavelab, and normalized to -3dB. Listen Here. The quantization noise is pretty noticeable.

I then repeated the same process with a dithered 16 bit recording (UV22 HR), and this is the result.

The 16 bit dithered result sounds better to my ears. It's noisy, but I don't hear as much quantization noise as in the 24 bit recording.

Granted, this is just a test of one mp3 encoder and one mp3 decoder, so your results may vary...I'd be very interested to see this process repeated with other encoders and decoders.
Image

Post

Thank you, what I forgot when listening, was that my mp3 decoder (foobar) outputs in 24 bit, which is not common situation.

I listened to these samples and they sound equally as bad for me and I'm not sure if it's quantization noise, might me just mp3. I will try similar test.

Post

Aetmos, I did similar test. Samples below are "magnified" (normalized) tails.

I made a soft bell sound using Cameleon5000, so the sound is very smooth and noise free. I made three versions:

A - 24 bit, no dither
B - 16 bit, regular dither (comes from dB-L Mastering Limiter)
C - 16 bit, high pass, noise shaped dither (sonoris plugin)

I encoded everything to mp3 using LAME, at 160 kbps. Then I tried decoding those using foobar2000. Foobar has options to decode 16bit or 24bit and can apply it's own dither.

First I decoded to 16 bit, with no decoder dithering:
listen A
listen B
listen C

This I guess is what most listeners do (even if they don't know that). You can hear big metallic quantization noise in first sample. Which is sort of an answer for my hesitations. I had similar results using Nero as decoder.

Then I decoded also to 16 bit, but with foobar internal dither turned on. Mainly to check if dithers multiply in such scenario. Results are:
listen A
listen B
listen C

Finally I decoded to 24 bit (foobar dithering off):
listen A
listen B
listen C

As for me this means that encoding 24 bit wavs to mp3 makes sense, but only if you know that listener is maniac mp3 audiophile type. So it doesn't make sense. I guess I can be proud of such fairly confusing post I made. :-o

Source files are here if anybody would like to examine.

Post

I don't usually normalize the tails when I listen to my music. Does this make me, abnormal?

Post Reply

Return to “Production Techniques”