Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 6

Sampling and the Nyquist Theorem

Recommended resources

Introduction

In our previous lesson, we established the crucial difference between continuous analog signals and the discrete, numeric representation of digital audio. You learned that digital audio is created by taking a series of "snapshots"—or samples—of an analog wave. This naturally leads to a fundamental question: how many snapshots are enough to capture the original sound wave perfectly? Is it just an approximation, or can we achieve a true reconstruction?

This lesson will answer that very question, directly addressing the learning outcome of explaining the process of sampling and the importance of the Nyquist theorem. We will explore the theoretical backbone of all digital audio: the rule that dictates how to sample a signal without losing information. We will also investigate the disastrous consequences of breaking this rule, a phenomenon known as aliasing. Understanding this principle is non-negotiable for any audio engineer, as it underpins why we use specific settings in our digital audio workstations (DAWs) and recording equipment.


The Challenge of Digital Representation

As we discussed, an analog signal is continuous, containing an infinite amount of information. A computer, however, can only store a finite set of discrete values. The process of sampling is our bridge between these two worlds. It involves measuring the amplitude (voltage) of the analog waveform at regular, fixed time intervals and recording that value as a number. The result is no longer a continuous line but a sequence of dots.

To see this process in action and understand why it's necessary for digital storage, let's watch the beginning of the following video.

Sampling, Aliasing & Nyquist Theorem

This video from the 0612 TV w/ NERDfirst channel provides a clear introduction to the concept of sampling.

Please watch the section from the beginning up to the 3:56 mark. Focus on the explanation of why we must discretize a continuous wave to store it digitally and how this creates a list of points, or samples.

The video raises a critical point: if we are just storing a series of dots, how can we be sure that connecting them will recreate the original smooth curve? What if we don't take enough samples and misinterpret the wave's true shape? This is where a landmark discovery in information theory provides the answer.


The Nyquist-Shannon Sampling Theorem: The Golden Rule

In the mid-20th century, engineers Harry Nyquist and Claude Shannon independently formulated what is now known as the Nyquist-Shannon Sampling Theorem. This theorem is the foundation of digital audio and provides a stunningly elegant solution to the sampling problem.

In simple terms, the theorem states:

To perfectly reconstruct an analog signal from a series of samples, the sampling rate must be greater than twice the highest frequency present in the signal.

Mathematically, this is expressed as:

Where:

  • is the sampling frequency (the number of samples taken per second).
  • is the maximum frequency component in the original analog signal.

This means that as long as you obey this rule, you are not merely creating an approximation of the original wave; you are capturing its complete "mathematical DNA." With the right reconstruction process, you can restore the original analog wave with no loss of information.

The article below provides a fantastic, plain-English explanation of this concept.

Nyquist-Shannon Sampling Theorem: Why Digital Audio ...

This article from Zeneil Ambokar on Medium uses excellent analogies to build an intuition for why the theorem works.

Please read the first section, titled The Problem in Plain English. Pay close attention to the analogy of photographing a dancer and the core idea that a sine wave needs "just over two points per cycle" to be uniquely defined.


Aliasing: When Sampling Goes Wrong

The Nyquist-Shannon theorem tells us the condition for success, but it also implies a condition for failure. What happens if our sampling rate is less than twice the maximum frequency? The result is an undesirable form of distortion called aliasing.

When you undersample a high-frequency wave, your samples don't capture enough information to define its shape. The reconstruction process then misinterprets these samples as belonging to a completely different, lower-frequency wave that wasn't in the original signal. In effect, the high frequency "aliases" or masquerades as a lower frequency.

The most critical thing to understand about aliasing is that it is irreversible. Once a high frequency has folded down into the audible range, there is no way to distinguish it from a legitimate frequency that was originally present. The damage is permanent.

This image perfectly illustrates the difference between correct sampling and aliasing.

This diagram contrasts proper sampling, where the sampling rate is high enough to capture the wave's shape, with aliasing, where an insufficient sampling rate leads to the reconstruction of an incorrect, lower-frequency wave.

To see a visual demonstration of how this happens, let's return to the video from 0612 TV.

Sampling, Aliasing & Nyquist Theorem

The video now demonstrates what happens when the sampling rate is too low for the frequency of the signal.

Watch the segment from 5:18 to 6:48. Observe how the samples taken from the high-frequency wave, when connected, create a wave of a much lower frequency. This is aliasing in action.

Now that you've seen what aliasing looks like, it's important to understand its sonic character and how it manifested in the history of digital audio.

Nyquist-Shannon Sampling Theorem: Why Digital Audio ...

This section of the same article delves into the sonic consequences of aliasing and why it's a permanent problem.

Please read the entire section titled When Things Go Wrong: Aliasing. Focus on the description of what aliasing sounds like (metallic, inharmonic) and the explanation of "frequency folding."


From Theory to Practice: Standard Sample Rates

The Nyquist-Shannon theorem directly explains the standard sample rates you will encounter constantly in your career.

  • The range of human hearing is generally accepted to be from 20 Hz to 20,000 Hz (20 kHz).
  • To capture the entire range of human hearing, according to the theorem, we must use a sampling rate greater than Hz, or 40,000 Hz (40 kHz).

This is why the standard for Compact Discs (CDs) was set at 44.1 kHz. This rate provides coverage up to 22.05 kHz, comfortably capturing all audible frequencies with an added "safety margin" for the filters involved in the process (which we'll touch on shortly).

The choice of 44.1 kHz specifically, rather than a round 40 or 42 kHz, has a fascinating history tied to the video technology used to store the first digital audio recordings.

Nyquist-Shannon Sampling Theorem: Why Digital Audio ...

This final reading explains the historical and technical reasons behind the industry-standard sample rates.

Read the section titled The Magic Number 44,100. This will give you insight into why music is typically at 44.1 kHz, while audio for film and video uses 48 kHz.


Preventing Aliasing

To prevent aliasing, audio converters employ a crucial component: an anti-aliasing filter. This is a very steep low-pass filter placed in the circuit before the analog signal is sampled. Its job is to aggressively remove any frequencies above the Nyquist frequency (half the sampling rate). For a CD-quality converter sampling at 44.1 kHz, this filter will cut out everything above 22.05 kHz, ensuring that no ultrasonic frequencies can be sampled and alias down into the audible spectrum. This pre-emptive filtering is the primary defense against aliasing.


Conclusion

In this lesson, we have unpacked one of the most important theoretical concepts in audio engineering. You now have a solid foundation for understanding how analog sound is faithfully captured in the digital domain.

Here are the key takeaways:

  • Sampling is the process of converting a continuous analog wave into a series of discrete numerical values by measuring its amplitude at regular intervals.
  • The Nyquist-Shannon Sampling Theorem dictates that for a perfect reconstruction, the sampling rate must be more than twice the highest frequency in the signal ().
  • Aliasing is an irreversible distortion that occurs when a signal is undersampled. High frequencies "fold down" and are incorrectly represented as lower frequencies.
  • Standard sample rates like 44.1 kHz (for music) and 48 kHz (for film) are direct applications of this theorem, chosen to capture the full range of human hearing while accommodating practical technology constraints.
  • Anti-aliasing filters are used before the conversion process to remove frequencies that could cause aliasing.

In our next lesson, we will formalize our understanding of the two key parameters that define digital audio quality. We will revisit sample rate in this new context and introduce its crucial counterpart, bit depth, to see how they work together to determine the fidelity of a digital recording.