Wednesday, October 13, 2010

What is Dither and How to Properly Use Dither

I know everyone that produces or works with digital music has seen it. That option in the bounce menu or on a plug-in that says "Dither" or something similar with the word dither in it. Every single digital audio system utilizes dither to add noise to a signal when a higher quality digital audio file needs to be down sampled or re-quantized to a lower bit-rate.

The whole idea behind dither is actually quite simple. My goal with this article is to condense the theroy in a way that I've not yet come across on the internet. The process of dither addition is very important, the problem is people don't know about it. Furthermore, when people go to find out about it they are smacked in the face with very complicated explanations behind the practice. It seems complicated at first but I'm going to do my best to explain this as painlessly as possible.

Lets talk about why we need it first and then I'll explain exactly what it is and how to apply it to your work.  Lets say we have a digital audio sample at a resolution of 24bits @ 44.1kbps. This audio sample is not an actual analog audio signal, it's merely a representation of one that has been digitally created using binary samples.  A 24bit sample has a number space of around 16.7 million spaces. This basically means that there is 16.7 million samples taken from the analog audio signal per binary word to create a digital audio version of it.  A 16bit sample by comparison only has 65,536 spaces in each of it's binary words. Obviously a 24bit sample is a much truer representation of the original analog audio. The higher the bit & sample rate the better quality digital audio you'll have. The problem is that high bit & sample rate files are very large in file size.  A CD is a 16bit 44.1khz digital audio file this is all fine and dandy but, bad things happen when we sample down from 24bits (the sample rate we should work with when recording & mixing) to 16bits for CD and mp3 creation.

When you down sample from 24bits to 16bits you're reducing the amount of digital spaces per binary word (the binary words make up the digital waveform) by a factor of 256 to be precise.  Basically the computer recalculates the digital waveform of each sample from a 24 space binary number down to a 16 space binary number whilst maintaining the same amplitude level.  Can you see how this might create a problem...  Imagine a bus with 30 people, no imagine all 30 of those people being told to get off the bus and get into a van.  Chaos!  The same thing happens when you down sample from 24bits to 16bits, there is audio chaos in the form of binary errors.

What we get in digital audio is harmonic distortion, and when you down sample without dither, harmonic distortion increases all the way up to very high level harmonics.  Fundamental frequencies of the tones show up at irritating levels in the harmonic spectrum.  These aren't pleasant 2nd and 3rd order music friendly harmonics, they are nasty sounding high level harmonics up into the 20th level harmonic and above.  These harmonics are not musically pleasant and will ruin what was otherwise a beautiful sound.  How do we prevent this from happening?  We add Dither, itunes does it, (crapilly) and we can do it on our own inside of our DAW.

Dither works by randomizing all those binary word errors that result in ugly sounding high order harmonics through the addition of low level noise to the digital audio signal.  The noise of dither is created by randomizing the least significant bit of each binary word sample.  The least significant bit is the last number in a binary word sequence.  Adding dither results in a random 1 or 0 being added to the sample (remember digital audio is simply 1's & 0's)  This random addition removes the regularity of errors in the digital audio sample.   If it's not regular digital errors and instead random digital errors (as it is when dither is added) we remove the harmonic distortion.  Basically, the errors are no longer errors we hear as harmonics but, instead random less noticeable sounding errors.  To sum it up after addition of dither the binary errors have been randomized so that we can no longer hear them.   Now the errors are spread out throughout the frequency spectrum, they still exist it's just that they aren't as present and extreme as they were before.  We can further mask these errors after the addition of dither through a technique called shaping.

Noise Shaping is a way of choosing where we would like to focus the dither "noise" in the frequency spectrum.  If we can do this we can eliminate the harmonic distortion and keep the overall dither "noise" level low.  Noise shaping adds a filter to the noise created by adding dither.   This allows the noise to only live in the inaudible frequencies from 20khz up to 22khz.   We can't hear this and it effectively kills the harmonic distortion while reducing the overall level of dither heard in the rest of the frequency spectrum.  To be honest though, you don't need to worry about noise shaping all that much unless you're doing serious mastering.  Most dither plug-ins do a fine job of noise shaping regardless of which setting you select.  Just remember to add dither and some form of noise shaping any time you are re-quantizing (down-sampling) IE: 24bit/48k to 16bit/44.1k.

So now that we know how it works lets talk about how to correctly add it to our material.   The best way to add dither is in mono form.   If you're adding it to stereo material bounce it to mono first without dither at the same sample rate and then re-bounce the now mono material with a dither plug-in down to a lower sample rate.   Here's an example: Lets say I'm in the mix and I've got a stereo sample of live drums at 24bit/48kbps that I want to add to an old 16bit/44.1kbps session.  Fist I'd bounce the stereo sample to mono at 24bit/48kbps (no down-sampling, merely bouncing to split the stereo file to mono) I'd open a session at 24bit/48kbps drop the drum sample in there and add a dither plug-in such as Waves IDR.  I'd select my bit rate (for this example it's 16 bits) and choose my shaping option, "normal" is usually more than adequate.  Then I'd bounce the two mono files out as a stereo file and have a perfectly re-quantized sample at 16bits/44.1kbos without any harmonic distortion at all. It's that simple and it will make a difference in the overall sound of your work if you do it correctly and at the right times.

Dither is, in all reality most important during mastering when preparing material for CD & mp3 distribution but, it should also be put to use during mixing as well, like in the example above. It seems a little daunting at first but it's very important in digital audio and makes the difference between the pro's and the amateurs. Learn it, love it, use it. It's dither and it's noise that is our friend!  If you're still confused and have question just shoot me an email and I'll do my best to help you out!



No comments:

Post a Comment