Sampling Theorem

You can use this applet to explore the Sampling Theorem, which states that to resolve a frequency N you must use a sampling rate of 2N. This 1:2 relationship is important enough that the term Nyquist Frequency is defined as the frequency equal to half the sampling rate. Frequencies that are above Nyquist "fold over" and introduce new frequencies to the spectrum that were not present in the original signal. The foldover frequency can be easily calculated, and equals the sampling rate minus the 'offending' frequency.

For example, sampling audio at 44100 samples per second can resolve a frequency no higher than 22050 Hz. 22050Hz, therefore, is called the Nyquist Frequency. A frequency of 22051 would fold over and introduce a new frequency of 22049.

  • To see how a higher sampling rate results in a better reproduction of a signal, set the original frequency to 2, and move the sample rate scrollbar all the way to the left. Slowly increase the sample rate and see the interpolated waveform (red) fit closer and closer to the original waveform (blue).

  • To demonstrate sampling at the Nyquist Frequency, choose a frequency of 10 and a sampling rate of 20 in the applet below. You will see an interpolated waveform in red, reproducing the original blue waveform. Notice that for every cycle in the original, there is a cycle in the sampled reproduction.

  • To demonstrate foldover, choose a frequency of 19 and a sampling rate of 20. This frequency is way over the Nyquist Frequency (10), and results in a foldover frequency of 1Hz (SR - Original Frequency, or 20-19=1 in this case). Gradually reduce the original frequency from 19 down to 10 again, and watch the foldover frequency change. At Nyquist and below, there is no more foldover, and the sampled waveform reflects the frequency of the original.

  • To see foldover for frequencies just above Nyquist, choose a frequency of 11 a sampling rate of 20. This is 1 Hz over Nyquist and should result in a foldover frequency of 20-11=9. Check it: from left to right, count the cycles from peak to peak. You should count 9 cycles, ie a frequency of 9Hz, instead of the original 11Hz.

    You need a Java-enabled web browser to view this applet.

    Author: Nick Didkovsky, didkovn@mail.rockefeller.edu
    Course supplement for Digitally Controlled Music Systems (E85.2603) at New York University

    Doctor Nerve Home Page, http://www.doctornerve.org
    Interactive Computer Music, http://www.punosmusic.com
    Java Music Specification Language, http://www.algomusic.com