Looking for the German FIDELITY Online? Just click here!
Nyquist-Shannon Sampling Theorem

Nyquist-Shannon Sampling Theorem

Connecting the Dots

An overwhelming proportion of the music we listen to today comes from digital sources that require conversion to analog – and that wouldn’t be possible had not one Mr. Nyquist* recognized a fundamental principle. If you want to know not just that, but why exactly the metaphor of the stepped wave in digital music reproduction is a misconception, read on.

Nyquist-Shannon Sampling Theorem

It seems to make perfect sense: Since digital means discrete states rather than smooth transitions, eight bits allow the representation of 256 values and nothing in between. So why wouldn’t the signal abruptly “jump” from one value to the next 44,100 times per second. To understand not just that it doesn’t, but also why, we need to take a closer look at how frequencies actually work.

Frequency can be thought of as acceleration at a given amplitude. Don’t get scared – we’ll break this down. For visualization purposes, imagine a transparent disk with a bright red dot at one point along its circumference. Now imagine it rotate uniformly while moving sideways along the time axis. Looking at it from the side, we’ll see that the red dot will accelerate smoothly up and down to trace out a perfect sine wave. If the disk makes exactly one complete rotation over a distance corresponding to one second, the frequency is one hertz. The key thing to realize is this: If we assume the disk’s rate of sideways movement is always constant (it represents the passage of time) the rotational speed of the disk, and therefore the acceleration of the dot along the sine curve, are directly linked to the frequency – in fact, they are essentially just different ways of expressing the same thing. If, for example, we wanted to “sharpen” the sine curve and move the dot faster from the top peak to the bottom peak, we’d need to have the disk spin faster. Faster rotation logically means more cycles in the same amount of time – in other words: a higher frequency.

Now let’s assume we know that the disk cannot rotate more than once per second (i.e. the bandwidth is limited at the upper end) and that we learn the position of the dot exactly every half second. If we are lucky and our two position samples fall exactly on the highest and lowest points of the sine curve, then we know beyond any doubt that the sampled signal must be a sine wave. All other waveforms, such as square or triangle waves, would at certain points imply greater acceleration of the dot, i.e. faster rotation of the disk and therefore higher frequency components – within our specified bandwidth, they therefore cannot exist. If, on the other hand, the disk could rotate arbitrarily fast, our two data points would not allow us to make any definitive statement about the waveform – between the two data points, the red dot could do anything. This also resolves the image of the stepped wave: steps and edges in the frequency response do not arise from low sampling rates; on the contrary, they require extremely high frequencies.

This is all rather elegant so far, but even with bandwidth limitation there is a small problem you may have guessed already: If the two samples do not fall exactly on the points of greatest excursion, we see the wave shifted in time, or phase, and at a lower than its actual amplitude. From the measured amplitude and the given bandwidth limitation, we would still be able to infer the correct waveform, just with incorrect parameters. In the extreme case – if the samples fall exactly on the zero crossings, we would see no excursion at all – our data points would simply carry no information at all.

Nyquist-Shannon Sampling Theorem
A sine tone that exactly matches the Nyquist frequency can only be reconstructed unambiguously in terms of frequency. If the signal is offset from the sampling by, for example, 60 degrees (green curve), the DAC “thinks” the samples fall on the peaks and troughs and accordingly reads amplitude and phase incorrectly.

Fortunately, the sampling only has to be timed a tiny bit more closely for frequency, amplitude, and phase to be unambiguously mathematically derived from the measured amplitudes – and that brings us to the Nyquist-Shannon sampling theorem, which states that a signal can be reconstructed exactly from amplitude values (samples) taken at regular time intervals if it contains only frequencies lower than half the sampling rate (i.e. below the so-called Nyquist frequency). A music signal limited to 20 kilohertz and sampled at 44.1 kilohertz therefore contains enough information for perfect reproduction of the incoming waveform.

Our disk metaphor explains why sine tones can be reconstructed exactly, but as we all know, music signals are considerably more complex – fortunately, however, they really do consist only of sine waves, because any waveform that occurs in reality can be decomposed into sine components with different amplitudes and phases. This decomposition is called the Fourier transform. A square wave, for example, consists of the fundamental frequency and all its odd harmonics (i.e. all odd integer multiples of the fundamental frequency), with their amplitudes decreasing in proportion to the harmonic number – the third harmonic, for example, has one-third the amplitude, the fifth one-fifth, and so on.

Nyquist-Shannon Sampling Theorem
Here you can see how a sine wave increasingly approaches a square wave when combined with the odd multiples of its frequency (the 3rd, 5th, and 7th harmonics in the image) at the correct amplitudes. If the series were continued to infinity (unfortunately we can’t visualize this here due to space constraints), it would eventually produce a perfect square wave.

For analog-to-digital conversion, this means that a DAC essentially sees every signal as a colorful bouquet of overlapping sine waves, all of which it can reproduce faithfully as long as all contained frequencies sit below the Nyquist limit.

Of course, all of this works less well in practice than in theory – for example, absolutely perfect reconstruction essentially requires infinitely steep filter slopes, which do not exist. Whatever we can technically do will always leave behind (minimal but measurable) artifacts. This is where one of the greatest advantages of Hi-Res formats becomes apparent: By moving the filtering to a range far beyond the audible spectrum, any reconstruction errors are moved there as well.

*Harry Nyquist was not the only person involved in this discovery; he built his ideas on the work of Edmund Whittaker, and Nyquist’s findings were in turn supplemented by Claude Shannon. Independently, Vladimir Kotelnikov arrived at the same conclusions, although the Iron Curtain effectively blocked the exchange of knowledge.

The stated retail price of the reviewed device is valid as of the time of the review and is subject to change.