Noise shaping, as the name suggests, is a technique for shaping white noise, and manipulating
how the noise power is spread across different frequency bands.
It’s not lowering the noise, but rather shifting noise to higher frequencies to make
the noise less apparent and less audible and thereby increase the effective dynamic range
that’s available.
Noise shaping is not a standalone process.
It’s never done on it’s own.
It’s only ever applied alongside dithering, and only when reducing the bit depth of the
audio.
Well, technically, it can be applied without dithering.
But then you’d be shaping spectral distortion from quantization error, not noise.
We’ve previously looked at dithering and why it’s needed, and you can check it out
here, if you haven’t already.
Noise shaping, like dithering, is not going to turn any heads.
It’s not a particularly exciting process where you can observe a lot of audible differences
in the end.
Infact, the effects of dithering and noise shaping are so subtle that you have to really
listen hard to spot the difference for most applications of audio.
But it doesn’t mean that it’s useless.
Dithering for example, is an absolutely integral part of the process of bit reduction, especially
when reducing the bit depth to 16 bits.
Without it, there could be unexpected distortion components and artifacts in your audio file.
To preserve the integrity of the audio file, you have to dither.
Noise shaping is not absolutely necessary, but it’s nice to have.
Since noise shaping increases the effective dynamic range, it makes 16-bit audio an attractive
option without needing to go any higher in bit depth.
There’s a caveat when using a technique called Delta Sigma Modulation rather than
the more common pulse code modulation, where noise shaping is really important and an integral
part of the process, but that’s for another time, let’s not go there yet.
Thats where noise shaping and oversampling coming into picture
Alright, let’s get to the crux of this.
How does shaping white noise get us a higher dynamic range?
For this, we need to understand the Equal Loudness Curves.
There’s a whole video dedicated to this in the module on acoustics, so I’ll be brief
here.
We’re interested in a single curve in this set of curves.
The bottom one, the threshold.
This single curve represents a concept called the absolute threshold of hearing.
Quite simply, it visually shows us the minimum sound pressure level of a pure tone that an
average human ear can hear with no other sound present.
We can see that the human ear is quite sensitive between the range of 500Hz to 5kHz, and isn’t
very sensitive below 500Hz and above 5kHz.
Essential, loudness perception is frequency dependent.
White noise is random noise.
The noise power is distributed evenly across the entire frequency spectrum.
What if, we could model this curve and spread the noise power around such that most of the
power is situated in a range of frequencies that our ears aren’t very sensitive to.
We are merely redistributing the power here, and freeing up some of the space in the middle
of the frequency spectrum.
Because of how our ears are designed, and because of our psychoacoustic loudness perception,
the effective loudness of this shaped noise, is lower than plain white noise.
This is essentially noise shaping, filtering the noise from the dithering stage to get
a little bit more dynamic range in our audio.
There are several noise shaping algorithms in use today, and I won’t be going over
all of them, but I’ll give you a taste of what a simple noise shaping algorithm would
look like.
Here’s our handy little sinusoidal signal, and here’s the same signal with triangular
dither applied.
The difference between the 2 signals gives you the noise associated with the process
of dithering.
Since triangular dither is random, the resultant noise is white noise.
We know this and we’ve discussed this process at length.
But what if, instead of choosing a random value at every sampling interval, we take
into account the previous value that was chosen and subtract it from the new random value
at the next sampling interval.
What does this achieve?
It essentially means that the random samples have a higher tendency to shift polarity,
a tendency to zigzag around more prominently.
Although we still maintain randomness within the system, the frequency distribution isn’t
flat anymore.
Their apparent periodicity is higher, which translates to the noise in the real world
tending to be concentrated in higher frequency bands.
We can see that by subjecting the noise to a spectrum analyzer.
Essentially what we did was feed the noise signal back onto itself.
This feedback loop forms the basis of a filter.
We can look at the whole process more holistically to understand what’s happening.
When we are reducing the bit depth of an audio signal, we run the signal through a quantizer.
The resultant output signal is bit reduced, and would contain quantization error.
To eliminate the correlated distortion that results from this quantization error, we add
a dither signal to our input signal right before quantization occurs.
And now for the interesting bit.
If we take the output signal and subtract it from the input signal before dither, we
can isolate the error signal.
If we then feed the error signal back through a filter and subtract it from the input, we
can spectrally shape the quantization noise.
This feedback loop would only affect the frequency response of the error signal, and would leave
the actual input intact and unchanged.
It has the effect of passing the noise through the filter, not the signal itself.
We can have any sort of complicated filtering mechanism here to shape the noise as we please.
A suitable weighting function can be utilized with a higher order filter to try and simulate
the absolute threshold of hearing curve, and spectrally shape the noise to reduce its influence
in the critical frequency bands between 500Hz to 5kHz.
Don’t worry if this doesn’t make too much sense, filtering is a huge area of study and
I can hopefully get to it at some point of time.
Choosing the right filter design is a delicate balancing act.
The higher the order of the filter, the finer the control you have over the spectral shape.
But, implementing higher order filters actually increases the overall noise power that is
introduced into the signal.
Though we are trying to push noise into less audible bands, having high noise power could
have adverse effects, like distorting and ruining tweeters for example.
Since dithering and noise shaping is such an integral part of audio production and playback,
and since it’s used in every audio appliance irrespective of the application, a consortium
of companies came together to develop and license a set of algorithms for dithering
and noise shaping for digital audio hardware and software.
They’re collectively called the POW-R algorithms.
Psychoacoustically optimized word length reduction.
Just rolls off the tongue.
Psychoacoustically optimized, meaning that they’re optimized for human hearing and
the weird nuances that influence our hearing perception.
And word length reduction, meaning that they play a role when reducing the bit depth of
audio.
The singular aim of these algorithms is to achieve the most sonically transparent audio
when reducing the bit depth.
Chances are, these are the algorithms implemented in your DAW softwares, they’re quite common.
There are 3 variants to it and are used for different audio use cases.
The POW-R 1 or the original POW-R algorithm, doesn’t have any noise shaping at all.
It uses a narrow band dither and the noise is white.
This is generally used with low dynamic range mixes, like compressed pop, rock or metal,
where you don’t tend to hear noise from quantization.
The POW-R 2 algorithm is used with speech.
It includes very subtle noise shaping that attenuates noise at around 2kHz and amplifies
it at 14kHz and upwards.
The POW-R 3 algorithm is used when the audio is complex in nature, has a really wide dynamic
range, like in classical music, and if this audio is intended to be played back in really
loud listening environments like in cinemas and movie theaters.
This algorithm implements an aggressive noise shaping curve which tries to reduce the loudness
perception of noise as low as possible.
That’s all that I’m going to talk about dithering and noise shaping, and I’ve already
said too much.
If you’re a general consumer of music, or a producer even, you set the dither and noise
shaping for your project when rendering, and you forget about it.
Choosing different algorithms and techniques isn’t going to impact the end result by
much at all, and the differences are incredibly subtle and hard to spot.
But they’re needed!
Please don’t mistake my indifference to insignificance.
Here’s a little anecdote that might help you see dithering in a new light.
Airplane bombers in World War II used mechanical computers to perform navigation and bomb trajectory
calculations.
These computers were nothing but boxes filled with hundreds of gears and cogs.
Curiously, these computers performed more accurately when flying on board the aircraft,
than on the ground.
Engineers realized that the vibration from the aircraft reduced the error from sticky
moving parts.
Instead of moving in short jerks, they moved more continuously.
Much later, small vibrating motors were deliberately built into the computers, and their vibration
was called dither which in middle English means “to tremble.”
Today, when you tap an electrical meter or water meter in your home to get a more precise
reading, you are actually applying dither.
In any case, in minute quantities, dither essentially simulates analog behavior in digital
systems.