Understanding sample rates in digital audio
Recording your music at home is supposed to be fun, not overly technical.
So it can really suck when you get stuck with technical jargon like “sample rate”.
And what on earth is a Nyquist? What’s this ‘aliasing’ that everyone talks about?!
How do we make sense of these phrases?! Big numbers like 44,100 kHz aren’t really self-explanatory.
Well, when we’re finished you’ll understand what the sample rate is and how it affects your audio recording.
Here are the topics we’re discussing:
- What is a sample?
- Which sample rate should I use?
- Audio resolution and bandwidth
- Why 44.1 kHz is the common sample rate
- Conclusion: what is a good sample rate?
Let’s get to the bottom of sample rates, shall we?
What is a sample?
A sample is a snapshot measurement of a soundwave.
More specifically, a sample is a measurement of a sound wave’s amplitude (signal strength).
Digital system like an audio interface takes thousands of individual samples that record the amplitude of a soundwave at specific times to reconstruct it digitally.
Sound waves are continuous waves and they’re made up of individual wave cycles. So then, a sample is a measurement of amplitude for an individual wave cycle.
And together, these many wave cycle samples sum to sample a sound wave in its entirity.
Then our interface can convert the soundwave into binary data that our computer can understand.
What is the definition of sample rate?
Sample rate is a measurement of the number of samples we take per second of audio; and therefore the speed at which we do so.
In other words, the sample rate determines how many snapshot samples digital recording tech like an interface takes of a soundwave.
In practice, we need to take thousands of samples of our recording per second if we want our digital signal to sound accurate to our original soundwave.
Then we can reconstruct the resolution of the original sound wave.
In other words, a high enough sampling rate allows us to capture every detail of the original sound.
How do we measure sample rates?
We measure the sampling rate in kilohertz (kHz).
Using the most common sampling rate, an audio sample rate specification looks like this: 44.1 kHz.
Moreover, the sampling rate of 44.1 kHz means we’re taking 44,100 samples of our audio per second!
Below is a list of the common sample rates:
- 44.1 kHz 44,100 samples per second
- 48 kHz – 48,000 samples per second
- 88.2 kHz – 88,200 samples per second
- 96 kHz – 96,000 samples per second
- 192 kHz – 192,000 samples per second
Does a higher sample rate mean a better quality recording?
The sample rate in music production is a vital factor that influences the accuracy and quality of sound recordings. Essentially, the sample rate determines how often the audio signal is sampled per second, directly affecting the range of frequencies captured and the clarity of the audio.
By taking more samples per second, you are going to get a digital signal with a higher audio resolution. A higher sample rate allows for a broader frequency response and improved resolution, resulting in a more detailed and faithful reproduction of the original sound.
Using higher sample rates can help reduce artifacts and distortion during the digital-to-analog conversion process, ensuring a cleaner and more high-fidelity output. While the necessity of ultra-high sample rates, such as 192 kHz, is debated among professionals—in terms of audible benefit in the final product—the additional data can be advantageous during the production phase for certain technical processes.
But that doesn’t mean it’s always such a great idea to use a higher sample rate.
Recording at a higher sample rate leads to a bigger audio file. Furthermore, it requires more processing power of your computer too. As we’re taking more samples we’ll need more disk space to store them, and a processor that can handle the job and a big audio file is counterproductive if you’re looking to stream it across the internet!
Which sample rate should I use?
The common sample rate of 44.1 kHz (44,100 samples per second) is high enough to capture the frequencies within the threshold of human hearing.
But If you’re looking to record a stereo signal, recording at 44.1 kHz will not do unless you record each channel individually and pan them. But, in total, you’re still taking 88,200 samples.
As you have double the signal to capture, you’ll need to double the sampling rate to 88.2 kHz. You’ll need to take 88,200 samples to capture the resolution of your stereo signal.
With this said, your interface may be adept enough for you to just plug & play. Some interfaces have two inputs and each takes at least 44,100 samples per second anyway.
Sample rates and the frequency spectrum
The extent to which sample rate affects the fidelity and sonic quality of music recordings depends on the rate chosen. Most human ears can perceive sounds ranging from 20 Hz to 20 kHz. Standard consumer audio formats, such as CDs and MP3s, typically utilize a sample rate of 44.1 kHz, which is adequate for capturing frequencies audible to the average human. This rate sufficiently covers the spectrum of human hearing without significant loss of detail for the vast majority of the audience.
And this is why we need to take enough snapshot samples of a signal. Consequently, we need a sampling rate that is at least double the frequency of the signal.
With this in mind, dividing 44.1 kHz in two gives us 22.05 kHz – and that’s just enough to accommodate the frequencies that we can hear.
However, professional audio production can benefit from higher sample rates. Recording at higher rates, like 88.2 kHz or 96 kHz, provides more data points per second, which enhances the audio’s precision, especially for high-frequency content. This extra detail is crucial in professional settings where audio is often manipulated extensively through processes like pitch shifting or time stretching, which can degrade quality if the original recording isn’t detailed enough.
While the basic human hearing range is adequately covered by a 44.1 kHz sample rate, higher sample rates can significantly improve the fidelity and sonic character of recordings by providing more detailed audio data. This is especially useful in professional music production, where nuanced sound manipulation is key, although the perceptual benefits to the average listener may be less pronounced. Therefore, determining the appropriate sample rate depends on the specific needs of the project and the intended audience.
What is the Nyquist rate? How to calculate the sampling rate for a frequency
The Nyquist theory states that we need a sampling rate equal to twice the highest frequency of a signal to capture every frequency in the signal.
A singular wave cycle always has one negative and one positive amplitude value. These values are the measure of cycles’ signal strength (amplitude).
And to find the wavelength of each wave cycle – which determines their frequencies – we must sample every cycle’s positive and negative amplitudes.
As a result, we must sample each wave twice if we want our digital signal to have the correct frequency.
The Nyquist frequency and aliasing: when sampling goes wrong…
The Nyquist sampling theory tells us that taking less than 2 samples per cycle leads to an incorrect digital reconstruction of our signal – an unwanted ‘alias‘ of the original.
Here are some examples to quite literally illustrate aliasing:
In the first image, the reconstructed soundwave (3) resembles the original soundwave (1) perfectly. That’s because we’ve taken enough samples (2) to capture the frequency of the soundwave.
But in the second image, we haven’t increased how many samples we want to take (5) despite rapidly increasing the frequency of the audio (4), thereby giving us an alias of our original soundwave (6).
As a result, our reconstructed waveform resembles that of the first example with a much lower frequency. In other words, the resulting frequency is an alias frequency.
Audio resolution and bandwidth
The resolution of your digital audio is partly determined by how many samples of your recording that your audio interface takes per second.
And the process of sampling a sound wave is the first part of the analog to digital (ADC) process.
What is analog to digital conversion (ADC)?
Sampling is at the core of analog to digital conversion.
Our digital recording device must take thousands of snapshot samples of our sound wave per second.
As we have discussed, these snapshot samples record the amplitude values of individual wave cycles. Then, we can perfectly reconstruct the frequencies in our sound wave by taking enough of them for each wave cycle.
After sampling our sound wave, our interface converts the samples into binary information for our computer. Next, our computer needs to store them – and computers store information as bits.
How bit depth and sample rate work together to create a bandwidth
The bit depth determines how many available bits there are to measure the sound wave in the first place, and then for we to store our samples in digital bytes.
Therefore, a bit depth that can accommodate the thousands of per second samples allows us to record in as high a resolution as possible.
In other words, bit depth and sample rate work together to give us the total bandwidth of our digital recording.
This means that the total bandwidth we can utilize defines how accurate our digital signal is to our original recording!
More bandwidth = more accurate reproduction
Sample rate vs bitrate
Sample rate defines how many samples of our sound wave we take per second. In the context of converting analog audio to digital, this means taking snapshots or ‘samples’ of the continuous analog waveform at regular intervals.
Expressed in hertz, or samples per second, a higher sample rate results in a more accurate digital representation of the original sound. For example, common sample rates in music production include 44.1 kHz, which is used in CDs, 48 kHz, which is standard for video and film, and 96 kHz for high-resolution audio.
However, bitrate determines the size of your digital audio file.
Sample rate and bit depth work together to create a total audio bandwidth. The amount of available bits corresponds to the number of digital amplitude values available for us to map our samples to.
This means that the total bandwidth we can utilize defines how accurate our digital signal is to our original recording! More bandwidth = more accurate reproduction. Understanding and choosing the right sample rate for your projects is crucial to achieving optimal audio quality while maintaining efficiency in file size and system resources.
To calculate the bitrate of your digital recording, you can use the following calculation:
Sample rate x bit depth x number of channels = bit rate (Mpbs)
Bit rate determines the number of bits your computer must process per second to play your digital audio recording as intended.
So let’s say we record one guitar riff with a sample rate of 44.1 kHz and bit depth of 24-bit.
44,100 x 24 x 1 = 1,058,400 / 1.1 megabits per second (Mbps)
And after calculating the bit rate of your recording, multiply it by the number of seconds of your recording. Let’s say we recorded for 20 seconds.
1.1 x 20 = 22 / 22MB
Why 44.1 kHz is the common sample rate
44.1kHz is the most common sample rate despite being the lowest of the commonly used rates because it’s a good halfway line between audio quality and mitigating storage space issues.
For example, the 44.1kHz sampling rate is the sampling rate of CDs’ quality audio.
This is because compact discs have limited space. Consequently, they require a file size that doesn’t take up too much space but an audio resolution that sounds good.
More to the point, in the first days of digital audio computer storage was still quoted in megabytes! As a result, storage space was of greater concern than it is today.
What sample rate does Spotify use?
Spotify requires the common 44.1 kHz audio sample rate on its streaming service.
More specifically, Spotify requests 16-bit MP3 files with a 44.1kHz sampling rate.
So do we still use CD quality resolution in the age of streaming?
Each streaming service is different, so not always.
But MP3 files are small audio files and we can therefore distribute them easier online.
However, MP3 files do not sound as good as CD quality audio. To find out why don’t miss our article on digital audio files.
Anyway, higher sampling rates lead to bigger audio files. So if we were to record at a higher sampling rate like 96 kHz then our audio files would be pretty big – considering it takes 96,000 samples per second.
Then, for online streaming, our music would require more storage space and more processing power.
With that said, it certainly isn’t impossible to stream with higher audio resolution. Apple Music has been using lossless audio (explained in the digital audio file article) for a while now.
And artists can upload their music to Apple Music at true CD quality (16 bit at 44.1 kHz) with no information lost; or at a higher resolution of 24 bit at 48 kHz.
But Spotify asks all artists to upload mp3 files, which are lossy audio files.
Conclusion: what is a good sample rate?
Technically, a good sample rate is any that takes enough samples of your original soundwave so to digitally reconstruct every detail. And we need a sample rate that’s double the frequency of the soundwave to do so.
If the frequency of your soundwave is 15 kHz, taking any less than 30,000 samples per second will create an unwanted alias of your sound.
This is because we need at least two samples per wave cycle to capture the frequency information of each wave cycle.
But there are higher sample rates, of course. In fact, high-resolution audio is thought to be 96kHz / 32-bit audio.
Taking 96,000 samples per second does have many advantages. For example, we can capture all of the expressive details in the 10-20 kHz range. This range is where a lot of natural expression for vocals, stringed instruments, and more sit.
A higher sample rate allows us to catch those details in our digital recording. Though this does add a lot of value to the listening experience, it also increases the file size.
And as we have discussed, streaming services like Spotify only accept the 44.1kHz as a sample rate. However, the likes of Apple Music accept audio at higher resolution.
But if you were to upload to Spotify, recording with a higher sample rate will require you to attenuate the sample rate in the post-mastering stage.
To conclude, it’s a good idea to investigate what resolution each service accepts and export different audio files for each platform.