Dithering is the process of intentionally adding noise to a signal during the process
of quantization, to preserve low level information and prevent correlated distortion.
That is a loaded statement.
You don’t have to fully understand this statement right away.
In the rest of this video we will try to decipher it.
But right off the bat, why would we want to intentionally add noise to a signal?
As audio engineers, we strive to keep our recordings clean and noise free.
The concept of adding noise seems counter intuitive.
Before we get into dithering our audio files, let's visually see what dither can do for
us.
Here’s a high contrast grayscale image.
Each pixel in this image is represented by 1 byte of information.
That’s 8 bits.
So each pixel can store 255 different possible monochromatic values.
From 0 which represents black to 255 which represents white, and all the different luminance
values in between.
We can say that this is an 8-bit grayscale image.
Now let's do something drastic.
Let’s drop the bit depth of this image to 1.
If we truncate the sample resolution to just 1 bit, each pixel can only represent 2 values,
black or white, and so the resultant image is true a black and white image, where the
pixels that were previously less than 50% percent bright are rounded to black, and the
rest are rounded to white.
We lose a lot of detail when we do this.
Let’s see how we can try and preserve some of the data when we step down the resolution.
This is the same image but with noise added to it.
A random value between 0 to 50% of the full scale is added to or subtracted from each
pixel in this image.
Now when we try to truncate the resolution down to 1 bit, we get this.
This is considerably more detailed than the 1-bit image that was generated when the original
was not dithered.
If you look at this image more closely, you can see that there are still only 2 possible
values, but the density distribution of the black pixels is different at different parts
of the image, and this gives you the perception of information being preserved.
This was, like most things, an exaggerated example.
And things don’t exactly translate the same between image processing and audio processing.
But we can infer a couple of points from the image dithering example.
Noise only needs to be applied if you are reducing the resolution of the source.
In other terms, noise only needs to be applied if you are truncating the word length, or
lowering the bit depth.
All the same really, just different vocabulary to express it.
Let’s look at an example.
Here we have a piano chord sustained.
In the DAW software, the samples of this audio file exist as 32-bit floating point numbers.
When any processing is done in the digital domain, the operations and calculations occur
with 32 bits of high precision.
But at some point of time, this audio file needs to be played back on the monitors or
written to disk or to a CD or streamed online.
At that point of time, the resolution needs to be dropped, and the floating point numbers
would need to be converted to integers for the Digital to Analog converters to recognize
them.
And you’d need to drop the bit depth to either 24 bits, which is possibly the highest
resolution at which modern DACs could faithfully reproduce audio, or even further down to 16
bits, where most of the consumer audio files are saved at.
Let’s simulate this.
Let’s say we’ve finished our mix and we want to hear it and save it.
Let’s go a step down and produce it at 8bits of resolution.
I’m going to make use of the Ozone 8 Mastering plugin from Izotope.
It makes sense that a dither processor is on a mastering plugin.
That’s because mastering is the final step of audio production, and you’d only want
to step down the resolution of audio at the final step and nowhere in between.
An exception to this if you have external effect sends to analog devices like reverb
units.
Any place where audio leaves the digital domain and enters the analog domain is where truncation
happens.
It’s unavoidable.
Alright, so dithering is currently turned off and we are expecting the audio to be truncated
to 8 bits when we listen to it.
Let’s listen to it!
Did you hear the digital tear and then silence?
Again.
In the beginning the noise that you hear is 8bit quantization noise.
If you’ve been following the previous video in the series about Bit depth and quantization,
this shouldn’t be a surprise to you.
The quantization noise is almost like broadband white noise.
But towards the end, when the audio is fading to silence, we get this tearing noise that
is incredibly distracting.
Why does this happen?
Let’s look at this interactive widget created by Nigel Redmon.
Link in the description.
The signal in blue is our high resolution digital signal.
Now when we want to step down the resolution, we round the signal or quantize the signal
to the nearest discrete amplitude level, depending on the bit depth we choose.
If I reduce the amplitude level of the signal though, you can see that the number of levels
available for quantization reduces as well.
The bit depth remains the same, and so does the quantization error.
But the level of this signal relative to the error is getting smaller and smaller, meaning
that the signal to quantization error ratio is getting low as well.
At around half a quantization level or half of the Least Significant bit, we are at the
fringe of what is quantizable.
And if the signal level dips below that, the quantized signal is rounded to zero and all
detail is lost.
Any amount of amplitude modulation when the signal is fading out, could lead to the quantization
signal jumping in and out of silence.
This causes the unmistakable tearing sound that you hear in poorly quantized or undithered
masters.
Let’s see what dither can do for us.
We’re in Reaper, and I’m going to choose to turn on dither when outputting at 8bits.
We can hear that the tearing noise is gone and is just replaced by constant noise.
Is this better?
You’ve gotta remember that most digital recordings are saved at a bit depth of 16
bits or higher.
Which means that the noise associated with a 16 bit audio track is about 48 db lower
than this, and almost inaudible.
Noise, especially white noise is remarkably undistracting to our hearing perception.
The brain usually tunes out a little bit of white noise in a mix.
On the other hand, sudden jumps and cuts in even low level noise can immediately be noticed
and turns our attention towards it.
This is what we are trying to avoid using dithering.
But how does adding noise actually solve the problem.
We turn back to the widget.
If I turn on dithering, you can see a series of red points spread across the board, but
also slightly correlated with the signal.
What dithering does is add a random value to each of the original sample values.
The range of the random value depends on system to system, but in this case, and generally
in most cases, the range is 2 Least significant bits.
A maximum of 1 LSB can be added to the original sample, and a minimum of 1 LSB can be subtracted
from the original sample.
The reason why I mention LSB here, and not some concrete value is that the range is dependent
on the target bit depth.
For instance, the random value range for a target bit depth of 8 is much larger than
the randomness required for a target of 16 bit.
Let’s connect the dots to visualize the plot better.
Now that we have a signal, with a randomized noise or dither added to it, when the resolution
is lowered, the signal is rounded to the nearest discrete level.
You can see that when the signal level is lowered below the quantizable level, where
the original signal would’ve been rounded to zero, the noise within the signal allows
the dithered signal to be rounded up from time to time, thereby keeping the noise floor
constant.
What you get with dither is a constant and predictable noise floor rather than the instantaneous
dropout of signal from noise to silence.
This isn’t the only problem dither solves.
Let’s bring back the definition.
Dithering is the process of intentionally adding noise to a signal during the process
of quantization, to preserve low level information and prevent correlated distortion.
So we understand why we intentionally add noise, and we understand that doing this can
preserve the noise floor of the signal when the signal dips below it.
The other important reason why dither is added to signals is to prevent correlated distortion.
This is possibly the biggest advantage of dither
When we quantize a track, we’re now accustomed to the fact that quantization results in error,
and this error manifests itself as noise.
We never gave too much thought to the type of noise it results in and just assumed that
this would be broadband noise.
And most of the time, it is.
If the audio being quantized is rich and loud, the resultant error signal is absolutely random
and follows no discernible pattern and is said to be uncorrelated with the original
audio.
This is what results in noise which is white, the randomness.
And this is what we strive for.
But things are different when the source material is really low in amplitude or when the source
signal is simple in nature and not rich or complex.
Under these circumstances, the error from quantization is more predictable, tends to
follow along with the underlying signal and has a tendency of forming patterns and repeating
itself.
The error isn’t random anymore, it’s correlated.
The error doesn’t result in noise any more, it results in sonic distortions and sometimes,
these distortion partials stick out like a sore thumb, well above the noise floor and
can get very noticeable and distracting.
Let me show you what I mean.
Here’s a sine wave oscillator playing a few notes.
This is a signal as simple as it can get.
This is what it sounds like at a high bit depth.
When we lower the bit depth, we expect to hear some quantization error.
Let’s listen to what it sounds like.
Right, now that doesn’t sound like broadband noise.
What it does sound like is a square wave or sawtooth wave being played alongside our signal,
and these additional partials quite clearly being out of tune.
If we examine the output spectrum, we see these distinct partials sticking out above
the expected noise floor of about -48db and these partials clearly influencing the output
signal.
If we add dither however, we notice that the partials are gone, and we get a clear output
signal, with no distortion components, just added broadband noise.
If we notice the spectrum of the undithered and dithered signals side by side, we see
that we’ve compromised the signal with a slightly higher noise floor to get rid of
the distortion partials.
Again, as a reminder, the noise here is significant since the signal has been truncated to 8bits.
But at 16 bits the noise is barely audible.
And at 24bit the noise is completely inaudible.
Here’s another example, and this shows that a complex sound at low amplitude tends to
cause correlated distortion.
At the start, the quantization error results in fairly uncorrelated noise.
But as the signal fades away, sharp inharmonic partials start to arise.
Dithering the signal gets rid of these inharmonic partials.
And as seen before, dithering raises the noise floor but eliminates correlated distortion.
It’s easy to see why the distortion partials appear.
When quantizing a simple signal, the rounding errors are predictable.
Here the quantized output signal is just a more complex form of the sine wave.
And as the signal dips, we see a clear pulse wave output being formed, and pulse waves
have enormous amounts of harmonic content.
If you introduce dithering, the correlation is gone, and so are the strong partials that
can be formed.
The rounding errors are randomized.
Let’s bring back the definition again one last time.
By now you should have a fairly good understanding of what dither does and why it’s needed.
There’s one last thing I want to add, and that’s where and when dither is needed.
As I’ve mentioned before, dither can be applied wherever truncation happens.
This is usually at the last step of production when the track is bounced.
But this could also be within plugins which operate at a higher bit depth when compared
to the hosting program.
As to when it’s needed.
It’s needed when audio is re-quantized at 16 bits or lower.
That means when you’re converting 32bit to 16bit audio, 24bit to 16bit, or even 16bit
to 16bit.
There is definite possibility of correlated distortion within a 16 bit quantized track
being heard.
So always dither when you’re targeting 16bit output.
If you’re targeting audio output at 24bit, then don’t dither.
Even when it means truncation from 32bit to 24bit.
Yes, correlated distortion would still occur in this scenario, but the partial strengths
and the noise floor would be well below the threshold of hearing and so it’s never heard.
You can dither if you want, there is no downside to it.
But there’s no upside either.
The effects just won't be heard.
In the next video, we’ll look at the types of dither and the different probability density
functions for applying noise.
This would be an implementation level topic, targeted towards programers.
So if you think you’ve heard enough about dither, feel free to skip the next one.
But do catch me on the one after, where I’ll be talking about Noise Shaping, a super interesting
concept that’s applied alongside dithering to reduce the overall noise floor of the quantized
signal and make 16 bit tracks usable and effective in the real world, without needing to go any
higher in bit depth.
Take it easy.