• Home
  • Music
  • Production Blog
  • Contact

    Milo Burke

    • Home
    • Music
    • Production Blog
    • Contact
    Back to all posts

    Understanding Dither

    Introduction 

    Maybe your DAW comes with a dithering plugin, or maybe you've seen dither as an option in your limiter, or in the export settings of your DAW. You have the vague idea that it's used for mastering, and you can't remember if you're supposed to always use it or never use it. 

    What is dither? Why do you want to use it? And when is it appropriate? 

    For the sake of this post, I'm going to assume you have a rudimentary understanding of sample rate and bit depth. If this isn't the case, we'll cover the basics of those in a future article.

    If your eyes glaze over at any point in reading this and you're just thinking, "Milo, I don't want to know how it works!", I don't blame you. This is mathy and dense, and I'm not sure anyone gets particularly excited about dither. The body of the article is there for the curious. But if you want the short and sweet version, skip down to the section titled "Keeping It Simple".

     

    Bit Depth in Your DAW

    So you know that CDs and mp3 files only allow for a 44.1 kHz sample rate of 16-bit audio. If that's all the resolution your final song will have, why should we work with higher bit depths?

    For every sample of audio recorded, the bit depth is the string of numbers that records where the amplitude of each sample is, giving the waveform its shape. But anytime you make the slightest change in audio, you multiply or divide that string of numbers by another string of numbers. This isn't just for major changes, like adding a virtual guitar amp to an instrument. Even adjusting the volume by a single dB requires one long string of numbers to be used against another.

    The problem we run into is rounding errors. 16-bit audio only allows for 65,536 unique values. And if you use a virtual instrument with a plugin chain containing EQ, compression, delay, saturation, and stereo-widening, your DAW is crunching many, many string numbers, and all of those calculations will produce rounding errors.

    Unfortunately, those errors add up. If you sell a car, it might be close enough to round to the nearest thousand dollars when telling someone how much you sold it for. But if a dealership sells 80 vehicles a week, rounding to the nearest thousand dollars 80 times isn't nearly specific enough for the dealership's manager to know how much revenue is made, and if there will be any profit after paying the sales people and necessary expenses. It's the same when calculating audio: with each new rounding error, what you're hearing is less and less true to the original sound. It will probably still sound "fine", since it's not 12-bit or 8-bit, but it could sound better.

    When we step up in bit depth, we can calculate each change to the audio with greater precision. 24-bit allows for 16,777,216 unique values, and 32-bit allows for 4,294,967,296. Your DAW may support 64-bit internal processing, which carries out each calculation to a possible result of 18 quintillion unique values. By comparison, you can see how the paltry 65,000 values offered by 16-bit isn't quite enough.

    When you process at a higher bit depth, the rounding errors often still exist, but they are pushed further down the string of digits, further from the core of the sound, down into the inaudible range. Perfect.

    So even though 16-bit may be sufficient for recording decent quality audio, you can see why you should use a higher bit depth within your DAW: you're not leaving that audio alone. You're calculating numbers against it again and again. That's why you need the precision.

     

    Exporting Your Music

    To avoid rounding errors, you've decided to make all future songs 32-bit floating point. Great!

    But what happens when you finish the song and you're looking at your export settings? You remember that whether you're aiming for CD or mp3, you're limited to 16-bit audio. If you export your 32-bit song to a 16-bit file, your DAW will just chop off all those extra numbers assuming that they're not needed. It's better than having worked at 16-bit from the beginning, but it's still less than helpful.

    If you have all this extra information in every single sample of your music, and the final container can't hold all of that extra information, what can you do to save as much of that detail as you can? What happens when you need to express a value between the numbers available in a 16-bit file?

     

    A Tangible Example

    Suppose you work for McDonald's, and you're in charge of purchasing paper cups for every restaurant in your state. If ten million people live in your state, that's a lot of cups!

    You want to place an order for 150 million paper cups to last the entire month. You know your supplier's cups are worth 2.2 cents each, and that's the price you want to buy them at. However, your currency doesn't allow for transactions of less than a cent. The supplier isn't going to sell the cups for 2 cents each, or she'll be forfeiting $300,000 on a purchase this big. And you're certainly not going to pay 3 cents per cup, costing you an extra $1,200,000. What can you do?

    If each cup has to be priced individually using the decimals your currency allows, the solution is to buy one cup for 3 cents, and then buy four cups at 2 cents each. We're rounding the numbers, but we're not rounding in the same direction each time. You're paying a different amount per cup, but you're paying an average of 2.2 cents per cup just like you wanted. Repeat this process for every five cups and you've found a way to fill your entire order at a sale price per cup that's not represented by your currency. Once in a while, math can be pretty cool.

     

    Dither to the Rescue

    Dither does the same thing to audio, and it does it by introducing random values that sound like noise. If your 32-bit song wants to express the amplitude of a sample with a very high degree of accuracy, but the containing file just can't hold numbers that precise, then dither rounds up for some samples and rounds down for others. Just like we did buying paper cups for McDonald's. Dither will choose to round up on this sample and down on another, making the appropriate decision of which direction to round for every single sample of audio. And when you average them together, the targeted precision from your 32-bit source audio is represented in the tiny 16-bit file. Neat!

    If you were reading carefully, you'll notice I mentioned that dither adds noise. Noise is bad. But the noise added is so low level that it's extremely difficult to hear. And smart dither algorithms can shift the added noise out of the frequency range our ears are most sensitive to, about 3.5 kHz, to a frequency much more difficult to hear, perhaps 18 kHz and above. The result is that you're storing more information in a container than you should be allowed to store, and you do it by adding an inaudible amount of noise.

     

    The Time for Dither

    One application of dither is not likely to add a perceptible amount of noise, considering that every piece of equipment used in recording and playback also adds a tiny amount of noise. But if you stack that noise again and again, it can become audible and irritating. So you shouldn't add dither any more times than necessary.

    The only time you need to add dither is when you're reducing bit depth. Because it's only when extra bits are being chopped off that you need to find a way to cram all that extra information into fewer bits.

    Examples:

    A recording engineer concerned about fidelity records music in a 32-bit session. He needs to send the multi-track files to the mixing engineer, who is not particularly interested in fidelity, insisting that he can only accept 16-bit or 24-bit files. In this scenario, the recording engineer should dither each track of the multi-track session down to 24-bit audio, in order to stay as high quality as possible and packing in as much extra information as possible.

    If that mixing engineer also masters the song, then he needs to fit the song into a 16-bit file. In this case, he should also add a layer of dither once he's finished mastering, this time to the CD's target of 16-bits. Because once again, higher resolution audio needs to fit into a lower resolution container, and we don't want to toss away any more of that precious detail than we have to.

    But if the mixing engineer can accept 32-bit files and mix the song in a 32-bit session, that's preferred, and the recording engineer doesn't need to dither the files down to 24-bit.

    If you're recording or producing music at home, I recommend starting each song at 32-bit floating point and keeping it there throughout the recording, production, mixing, and mastering (if you're doing your own mastering). If your DAW has the option to turn on 64-bit internal processing, it will sound better still. Though we're entering diminishing returns here. Only at the end do you dither. Because you control your bit depth from start to finish, only one application of dither is necessary, right before the final export of the song.

    Always dither to the bit-depth you need. Any higher, and you end up chopping off bits. Any lower, and you're throwing away extra resolution.

    And if you're making your music available in hi-res format, you probably want to dither an extra copy to 24-bit, not 16-bit, to preserve that extra resolution.

     

    The Place for Dither

    When we add dither, we're still technically throwing some information away, because the rounding it adds can only be so precise. And we're also adding noise. So we want to be sure we're not dithering any more than necessary.

    Unless you're exporting stems to a lower bit depth, it is never appropriate to put dither on an individual track in a session. It can only do harm, not good. Save dither for the master bus.

    Working at a higher bit depth allows us to reduce rounding errors, and dither cuts down that bit depth. It would be a shame to add dither before all the calculations are finished, leaving room for new rounding errors and eventually chopping off bits. This is why dither comes last.

    The limiter is usually considered the "last" plugin on your master bus. After all, you wouldn't want to limit to the perfect loudness and then add an EQ after the limiter, boosting the song into clipping, would you? Though the limiter is the last plugin that affects the sound, dither still follows, because it needs to do its job after all the other calculations have been made, and because it won't add enough gain to your song to push it into clipping. Dither is the last plugin that affects the data in any way. The only plugins that you can use after limiting and dither, are metering plugins that don't change the audio in any way.

    Your limiter may include the option to turn on dithering. It knows to do this after the limiting takes place, not before. This is just fine. Or, you can use a separate plugin to add dither after your limiter. Or, your DAW may have dither options in the export window.

    Note, some DAWs add dither appropriate to your container file automatically in each and every export. I was recently surprised to learn that this is true for Studio One, my preferred DAW. If your DAW can automatically apply dither, you can choose to allow it, or choose to disable it and add your own dither. But it's better not to add dither twice.

     

    Keeping It Simple

    • What does dither do? Preserve extra information from a higher bit depth for when audio is packaged into a lower bit depth file.
       
    • When do you need to dither? At any stage audio of any kind is going from a higher bit depth to a lower bit depth.
       
    • Where do you put dither? After the very last plugin on your master bus.
       
    • Do you need to dither when increasing bit depth? Don't be silly! It's hard to put ten gallons of water in a five-gallon bucket, but it's easy to put five gallons of water in a ten-gallon bucket.
       
    • Do you need to dither when changing sample rates? I know you often see sample rates and bit depths grouped together, but no. Sample rate represents the horizontal axis of a waveform, and bit depth represents the vertical axis. If you change the sample rate, you can still leave the bit depth the same, and there is no reason to add dither when the bit depth stays the same.

     

    Wrapping Up

    Even if you've made it this far, you're probably not super excited about dither. I'm not either, but it is important. That said, the theory and analogies above gave you an understanding of what dither is and what it does. And the quick questions and answers just above tell you when to use it and where.

    This information will always be important, and how/when you add dither will never change. Make good dithering practices a habit now and you'll be on dither-autopilot the rest of your life.

    05/28/2018

    • 1 comment
    • Share

    in Mastering

    1 comment

    • Log out