In the previous video, we looked at the Nyquist Shannon Sampling theorem, and if you haven’t
checked that one out yet, I encourage you to do so now, since this entire video will
be based on the previous one.
As a refresher, the sampling theorem states that a band limited continuous time signal
can be represented in its samples and can be recovered back when sampling at a frequency
greater than twice the highest frequency component of the input signal.
Alright, let’s apply this principle to audio signals.
And we can already identify and limit the highest frequency component that should be
in our input signals.
It’s the limit of human hearing.
20kHz.
It’s an optimistic limit that’s been established through a lot of research and testing of individuals
in the general population.
But for a majority of us, it’s well below that.
And as you grow older, your sensitivity to high frequencies decreases.
We can realistically cap the highest frequency in our input signal to be 20kHz, because having
any frequencies above that is just wasteful and unnecessary.
According to the sampling theorem our sample rate can be any value higher than 40kHz.
And as mentioned in the previous video, we need a bit of a buffer between the highest
representable frequency and half the sampling rate or the Nyquist frequency, and we came
up with a practical estimate of choosing a sample rate which is around 2.5 times higher
than the highest frequency.
We did this in consideration of the practical limitations posed by analog filters when cutting
off frequencies above the Nyquist.
This number is not a hard rule, but rather is just a suggestion, a ballpark number if
you will, and is solely dependent on the hardware you are using.
Well engineered and well picked electronic components in converters are more than capable
of handling tight spaces for filter cut-offs.
In contrast, poorly designed circuits would need even more bandwidth than the estimate
of 2.5 times, to fully attenuate the frequencies before the Nyquist.
So what do we have that we can work with?
What sample rate can we use which is close to 50kHz, which is 2.5 times 20kHz.
Some of the popular and most commonly used sample rates include 44.1kHz, which gives
us a buffer between 20kHz and 22.05kHz which is the Nyquist frequency for the sampling
rate of 44.1kHz.
The buffer, or the guard band is 2.05kHz of bandwidth for the filter to achieve it’s
attenuation, which is admittedly, a bit tight.
The next common sample rate is 48kHz, which gives us a decent bandwidth of 4kHz to work
with.
After that is 96kHz, which is almost double what we initially wanted, but it does have
a very comfortable 28kHz of bandwidth.
What does bandwidth mean here, exactly.
In the context of signals in general, it means a range of frequencies.
Take 44.1kHz sampling rate for example.
This sample rate can theoretically represent frequencies from 0Hz to 22050Hz.
It’s range or bandwidth is said to be 22050Hz.
But bandwidth in the context of transmission has a slightly different implication.
Signals can be propagated through guided transmission media, such as cables and optical fibres,
and wirelessly through electromagnetic waves in the form of radio and microwaves.
These transmission media have a certain bandwidth associated with them as well.
But in this context, it’s the maximum rate at which information can be flooded through
the medium.
You can think of it as the information rate or data rate.
This rate has a tendency to affect the choice of audio bandwidth that we select, but is
generally dependent on the application.
For example if you want to transmit audio to your speakers through an amplifier in your
own home, even conventional copper cables like coaxial cables have a bandwidth of several
hundred megahertz.
When comparing that to even the most generous sample rate chosen for audio, transmitting
multichannel audio through these cables is a breeze, with a lot of bandwidth to spare.
Let’s look at a different application in telecommunication, phone lines.
The telephone audio signals are usually passed through copper cables with really high bandwidths
when compared to audio bandwidth like we already found out.
But you are not exclusively using this line.
Thousands of people could be utilizing the same phone lines for communication simultaneously.
Over here, you don’t really have the luxury of choosing a generous high fidelity sample
rate, efficiency is key.
Going back to our conundrum of choosing the right sample rate, we can agree that we want
all the audio frequencies to be represented, right from 20Hz to our hearing limit of 20kHz.
But do we really?
Yes, if you want to listen to Beethoven in all it’s high frequency glory.
But if you just want to talk to somebody on the phone, researchers discovered that intelligibility
of human speech lies between 300Hz to 3.4kHz.
So to be clear enough for another person to understand your speech, 3kHz of audio bandwidth
is generally sufficient.
All the higher frequencies can be ignored.
So you don’t need a high sample rate to express just 3kHz.
A sampling rate of 8kHz should do fine.
Do you want to know what an 8kHz sampled audio sounds like?
This is exactly it.
You can hear that all the high frequencies are missing, but it’s still quite intelligible
and recognizable.
It sounds like I’m talking through a telephone line, because this is precisely the frequency
that telecommunication engineers use for sampling.
I’m back now on the full audio spectrum bandwidth.
With 8kHz as the sampling rate, we have a tight guard band between around 3.4kHz to
the Nyquist frequency of 4kHz.
So it’s harder for analog filters to completely cut off within this range.
But again, in telecommunication, efficiency is more important than producing the best
audio quality possible.
Telecom engineers generally prefer efficiency and low cost design, and can tolerate a bit
of aliasing distortion produced due to low filtering performance during conversion.
If you are still confused as to why low sampling rate means higher efficiency, think about
it in terms of the amount of data we have to deal with every second.
With an 8kHz sampling rate, we are looking at 8000 data points per second that we have
to create from the analog signal, to transmit along a cable, to store and replicate.
As the sample rate increases, the converters would have to work faster to create more data,
within that same 1 second interval, their processing speed would need to ramp up, storage
capacity would need to increase, and generally all components within the signal chain would
need to handle the high rate of data flow.
Over time though, as processors became faster, and as transmission media became more efficient,
we could afford to sample higher.
I want to devise a simple experiment.
Let’s go to Audacity, and this time, we’ll record something on it.
I’m using a Focusrite audio interface and an Audio Technica condenser microphone which
are very capable audio devices.
But I am intentionally setting the sample rate set to a low 8kHz while recording.
I’ll play a sinusoidal sweep of frequencies from 200Hz to about 10kHz on another device.
You could see and hear that the audio capture of the sinusoidal sweep ended in the middle,
while the sweep continued.
This should be fairly comprehensible by now, since the analog to digital converter in the
Focusrite cuts off any frequencies above the Nyquist frequency of 4kHz.
Analyzing the waveform, that’s what you see as well.
If you select the track and head over to Tracks and Resample, you have the option to change
the sample rate now, post recording, in the digital domain.
Obviously choosing a high sampling rate now would not bring back the missing high frequencies.
Because they were never recorded to begin with.
But you have extended the capacity to hold more bandwidth.
This could come in handy when you want more bandwidth to play with.
For example, I can choose to pitch up the recording.
Lets select the track, go to Effect and Change Pitch.
Over here, I’d like to increase the percentage change to 100%, which is essentially increasing
the pitch by an octave.
I’ll also turn on High Quality Stretching to avoid any aliasing and set the project
sample rate higher up so we can hear the change.
Since I have chosen to resample at 44.1kHz, we have a lot of bandwidth available to us.
And we can represent the shifted high frequencies.
Now lets select the track and resample it again, but now going back down to 8kHz.
This time, the resampling process recognized that there were frequencies higher than the
Nyquist and just cut them off.
We are back in a position where we have no spare bandwidth to represent them.
So the higher frequencies above 4kHz, just vanish.
In this whole experiment, I want you to recognize that sampling and filtering occurred in both
domains.
Firstly in the analog domain to convert the microphone signal to a digital signal, using
analog equipment and an analog low pass filter, and then again in the digital domain, when
we resampled the track, and made use of a computer program and an algorithmic digital
low pass filter to do exactly the same.
In both cases the output was consistent and predictable.
I also want to highlight the importance of choosing the right initial sampling rate for
recording.
Because you can’t recover frequencies that were skipped for being higher than the Nyquist
frequency.
Going back to our discussion, another commonly used audio sample rate is 16kHz and it sounds
like this.
It’s generally used in voice over internet protocol applications like skype and whatsapp
which represents an 8kHz bandwidth of audio frequencies, which sounds much more crisp
than the previous sample rate.
Again, the primary motivation here is to keep the sample rate low enough to transmit these
signals in conditions when internet connectivity is poor, but high enough to capture more high
frequency content in general.
At 44.1kHz, the rate at which my voice was originally recorded at, we have a full representation
of all audible frequencies.
If you ignore the filtering difficulties during conversion, with a 44.1kHz sampled digital
signal, you’ve already achieved the highest audio fidelity possible.
The number 44100 seems very specific.
It was developed and standardized by Sony and Philips along with their invention of
the Compact Disc.
The number was chosen to work well for mathematical conversion when working with different video
frame rates, and also to keep the size of audio recordings slim to fit well into the
limited space offered by the CD.
48kHz is another common sampling rate predominantly used along with video, again, for its easy
and whole numbered mathematical conversions when working with different video frame rates.
It’s quite likely that the streaming service that you are watching this video on had resampled
my audio from 44.1kHz to 48kHz when the video was uploaded, and you are listening to a digital
48kHz rendering of audio.
For consumption of audio, for listening and playback, having sampling rates higher than
this is just wasteful and unnecessary, since it adds no value in terms of audio fidelity
in the audible range of frequencies.
It would only bloat up the overall bandwidth of the digital signal.
So is that to say that high sampling rates are absolutely pointless?
Not at all.
Again, as a consumer of audio and even as a producer or sound engineer, in most cases,
a sampling rate of 44.1kHz or 48kHz is ideal, and you’d never need more.
But if you are interested in hardware design, or signal processing, or into building applications
and writing plugins, you are likely to use higher sampling rates by means of oversample
in the digital domain.
This is generally done to deal with the problem of aliasing.
That’s predominantly where higher sampling rates are used.
I can think of one other example, where you want to record wildlife sounds, like the ultrasonic
frequencies emitted by bats for example.
Of course in this case, you need more than just a higher sampling rate.
You need the equipment for capturing ultrasonic frequencies.
But this is too specialized a case and we won't be delving into it.
But the conversation inevitably retracts back to what analog to digital converters are capable
of.
Are they truly capable of faithfully converting analog signals to digital signals at 44.1kHz
sampling rate, with all the difficulties of filtering that I’ve been waffling on about?
Yes, they are, and I’ll waffle on a little more about how that is possible and the innovative
ways that engineers have devised to circumvent the analog filtering problem.
But first, a little bit about why filtering at the input stage is needed to begin with.
For this we need to look at aliasing in further detail.