In the previous video, we saw the need to split the amplitude axis into discrete levels.
Analog values nearby are quantized or latched onto these discrete levels, so that we have
a finite set of measurable values.
The number of levels that we can use to represent different amplitude depends fundamentally
on how data is represented and stored in the digital format.
And fundamentally, the smallest unit of data in electronics is a switch or a binary bit,
where data or the state value can be represented as either on or off, high or low.
Two possible values.
A binary system.
We can expand this binary system to include a cascade of switches or bits.
Though a single bit can only represent 2 distinct values, a number of bits together can quickly
escalate the number of distinct state representations possible.
2 bits can represent 4 unique states, 3 bits can represent 8, 4 bits can represent 16 and
so on.
You can see a pattern here.
The growth is exponential.
More precisely, the growth in the number of unique states possible is a power of 2.
Here n is the number of bits used.
You can see that things grow pretty fast in any exponential settings.
16 bits can represent 65,536 different values.
24 bits can represent 16,777,216 values, and 32 bits can represent a whopping 4,294,967,296
state values.
That’s the power of permutations and combinations for you.
I’m not going to delve deep into binary representation or binary arithmetic.
There are several resources out there and I can link a few in the description.
(??) But I’m going to try and draw some parallels between the binary number or a Base-2
number system and the system that we are most accustomed to, the decimal number system or
the Base-10 number systems.
Let’s take an example of 8 bits.
8 bits can accommodate 2 to the power of 8 different unique state values, that’s 256
different values - from 0th state when all bits are low, to the 255th state when all
bits are high.
The binary system is base-2 since each digit is capable of representing 2 states, either
0 or 1.
And likewise the decimal system is base-10, as each digit has a range from 0 to 9.
Numbers in both systems are written from left to right, with the most significant digit
on the left and the least significant digit on the right.
It’s called so, because modifying the least significant digit has the least impact to
the overall number that it represents.
On the other hand, changing the most significant digital will significantly alter the resulting
number.
Although a bit may be the smallest unit of data, it’s too small and limited to be individually
operated upon.
Digital systems and computers would rather prefer to group bits together, and perform
operations on the group.
The smallest such group is called a Byte, and a byte is just a group of 8 bits.
Thus a byte is the smallest addressable unit of memory in computer architectures.
That’s one of the reasons why you find bit rates or bit depths in this case always as
a multiple of 8.
Like 16bits, 24, 32 and so on.
Having said that, let’s use just 4 bits to represent our amplitude values.
I’m doing this so we can simplify the process of illustration and understand the concepts
better by having just 16 distinct values.
Note that a 4 bit representation, or a bit depth of 4 is never used in audio.
Not only is the resolution super low and wildly inaccurate, it’s also wasteful, since you
are not using 4 of 8 available bits.
As I already mentioned, a byte is the smallest unit of memory a computer operates upon.
Even if you use only 4 bits for storing a value, the container that it is held in, always
contains 8 bits, 4 other bits are just set to zero all the time.
We’ll look at a snapshot of audio which is centered around a baseline.
Let’s play it and listen to it for a while.
What you listened to was produced at a sample rate of 44.1kHz, and a bit depth of 16.
This is your average CD quality music.
You can’t really notice anything wrong with it.
Audacity also translates the samples in this audio file into 32 bits.
This doesn’t mean that we are magically increasing the resolution of the audio file
from 16 bits to 32 bits.
All it means is that Audacity likes to work with 32 bits of data, as a 32-bit floating
point number is a common data format in programming languages, and it gives you the advantage
of extra headroom within the digital domain.
But for all intents and purposes, we’ll consider this audio file, what we just heard
as having 16 bits of resolution, and the absolute best version that we have.
Now, let’s have some fun by destroying it.
So what we want to do is reduce the bit depth and hear the difference.
Let’s do something drastic.
Let’s reduce the bit depth to 4bits.
With 4bits you get 16 amplitude levels, which is piss poor resolution to say the least.
We need to forcefully reduce the resolution, and we
leverage the Nyquist prompt for it.
I’m going to select the track, go to Tools -> Nyquist prompt.
And I’m going to enter this command.
We are going to quantize the entire track such that it has 16 levels.
8 on and above the baseline, and 8 more below the baseline.
Hit enter, and we can see that the track just came out of a minecraft filter.
And if we zoom in, we can clearly see 16 distant amplitude levels that the samples can take.
No single sample in this entire track lies in between these 16 amplitude levels.
Let’s hear it.
That sounds horrendous.
How would you describe the sound?
Noisy would be a good description.
You can hear the music, you could probably recognize it from the original, except that
it has a lot of unwanted noise.
Here’s the original, and here’s the low resolution render.
Let’s try to extract just the noise element.
We can technically do this by subtracting one track from the other.
Over here in Audacity, there is no subtract option, but what you could do is invert the
phase of one of the tracks and add the two.
It’s essentially a subtract operation.
Let’s try that.
I’ll select one of the tracks, go to Effects -> Invert.
Now I’ll select both the tracks, head over to Tracks -> Mix -> Mix and render to new
track.
Let’s hear it.
There are 2 really interesting facts that can deduce from this new track.
The noise is a function of the audio.
What does that mean?
It isn’t white noise or randomly generated noise.
White noise sounds like this.
This noise on the other hand, moves and sways along with the song.
You can hear this more evidently in the quieter sections of the song.
The noise is determined by the underlying audio.
The second point to note, strangely enough is that the noise amplitude is constant.
Look at the meters here.
The meters read around -24dBFS.
If you want to learn more about the decibel scale and how audio levels are measured, check
out the module on Loudness and Level.
Looking at the level meter here, no matter where I navigate to in the track, the levels
read the same.
The noise track’s waveform itself is squiggly, and doesn’t suggest any uniformity.
And yet the levels are constant.
The original track has a decent amount of dynamic range, but the noise associated with
a bit depth of 4 is constant.
Now let’s give this same experiment another shot.
But this time, we’ll use a bit depth of 8 instead of 4.
With a bit depth of 8, you are allowed a decent range of amplitude values.
256 to be precise.
This is nowhere close to 65536 possible amplitude values with 16 bit resolution, but it is fairly
better than the measly 16 possible values that we got earlier with 4 bit resolution.
Here, we have the original track again.
And I’m going to forcefully quantize the track to 8 bits.
Go to Tools -> Nyquist prompt.
I’m going to set this number to 128.
Again, this will quantize the original track such that it’ll now have 128 amplitude levels
on and above the baseline, and another 128 levels below the baseline, totalling to 256
total levels.
As you listen to the track, depending on how and where you’re listening to it, you may
or may not hear the noise.
I say this because there is definitely noise present in the track.
But it’s low enough that it may not be heard if you’re listening to it in a noisy environment
or if you’re listening to it at low volume.
You can hear the noise better in quieter sections of the track.
Let’s isolate the noise like we did before.
I’m going to bring in the original track, and invert it.
And I’m going to mix or add the quantized track and the inverted track and viola, out
comes the noise.
We can observe a similar trend with the noise signal here, that it’s constant power.
But the level meter indicates that the noise levels are much lower than before, at around
-48dBFS.
Based on these observations, we can postulate that quantization can add a degree of error
into the signal, and this error is heard as broadband noise.
So in simpler terms as you reduce the resolution of the signal by decreasing the bit depth,
you add more error into the signal, which results in more noise.
Does that mean that a 16 bit track has some noise in it as well?
Absolutely.
But the noise levels are so low, that for most intents and purposes, it can be considered
noise-free.
But we can theoretically calculate the noise level we can expect for different bit depths.
Signal to Quantization Noise ratio or SQNR is a widely used metric in measuring the quality
of the analog to digital conversion process.
Though it’s not the only metric used, it gives us an idea about the dynamic range that’s
possible for a given bit depth.
It’s a simple formula, where Q is the bit depth.
You can see that the only factor that determines the signal to noise ratio is the bit depth.
So this formula can be further simplified like this.
So if I substitute the value of bit depth to 4, we get the signal to quantization noise
ratio of around 24dB.
This is practically what we saw, with the constant noise floor at -24dBFS earlier.
This technically means that for an audio track quantized at 4bits, we have a maximum dynamic
range of 24dB.
With a bit depth of 8, we get the Signal to quantization noise ratio as 48dB, again, exactly
what we noticed in the level meters for 8 bit quantization earlier.
Now, for 16 bits, we get the SQNR as 96dB.
Now, what does this mean in practice?
It means that if you are in the quietest setting possible, you’ll have to drive a 16bit audio
track up to 96dB of loudness, which is quite high, to even begin to hear the noise associated
with quantization.
I’m not saying that 16 bits of resolution is enough or adequate.
It all depends on the usage and application.
The human ear is capable of perceiving sounds from the threshold of hearing at 0 decibels
to the threshold of pain, at around 130 decibels of Sound Pressure.
This means that we humans have a theoretical dynamic range of 130 decibels that we can
fully tap into and experience in an ideal setting.
If we are seated in a soundproofed anechoic chamber and an audio track produced at 16
bits of resolution is played back at a deafening 110 decibels, during the quietest parts of
this audio track or during silence, you could easily hear the quantization noise, as it
would be around 14dB loud.
But if you’re in your living room, listening to music at comfortable levels, the noise
floor of the signal is well below the threshold of hearing, and the noise is never heard.
What about 24 bits then.
We can see that the signal to quantization noise ratio for 24bit audio is around a 144dB.
That’s a bigger dynamic range than we can even perceive.
You can be confident that with a 24 bit depth audio track, no matter what the listening
environment is, no matter what the application, you’d never be able to hear the quantization
noise.
This begs the question, why not just use 24 bits as the standard?
Well for one, going from 16bits to 24bits will increase the size of the audio file by
50 percent!
As engineers we need to strive to utilize resources as best as possible.
Now, the interesting thing is Bit depth isn’t the end all be all factor which determines
the noise that is heard.
I choose my words really carefully here, because I’m not saying that the amount of noise
or the noise power would differ for the same bit depth.
Infact, no matter what you do, at 16 bit resolution, you’ll always have a constant noise power,
which is represented as -96db of full scale amplitude.
But the type of noise you hear can be changed!
I’ll show you what I mean.
This here is white noise, randomly generated broadband noise.
Since it’s randomly generated, the frequency distribution is quite uniform across the board.
Meaning, that all frequencies have equal weightage.
Pay attention to the signal level as well.
Now, listen to this noise.
Take a look at the level meters.
It says that the level of this noise is similar to that of the white noise, but it feels so
much quieter.
Why is that?
If we look at the frequency response of this noise, we observe that the lower frequencies
are boosted up and higher ones are reduced.
It’s the same noise power as earlier, but we’ve shuffled that power around and changed
the balance of it.
Regarding why this sounds quieter, is all to do with our ears and how we perceive loudness
for different frequencies.
It’s covered in quite a lot of depth in the module on Loudness and Levels, and I’ll
be glossing over it in the next video as well.
But what if we could apply this concept and shift the balance of power of the quantization
noise?
Could that reduce the loudness of the noise from the error signal?
What if we could move this noise out of the audible spectrum entirely?
All of this is well within the realm of possibility and in fact is being done in several commercial
digital systems without the end user ever knowing about it.
It’s the science of dithering and noise shaping, and it’s coming up next.
Until then, make some noise.