An Introduction to Sampling Theory
Authors: Thomas Zawistowski & Paras Shah

The applet that comes with this WWW page is an interactive demonstration that will show the basics of sampling theory. Please read ahead to understand more about what this program does. For more information on the use of this applet see the bottom of this page.

A Quick Primer on Sampling Theory

The signals we use in the real world, such as our voices, are called "analog" signals.  To process these signals in computers, we need to convert the signals to "digital" form.  While an analog signal is continuous in both time and amplitude, a digital signal is discrete in both time and amplitude.  To convert a signal from continuous time to discrete time, a process called sampling is used.  The value of the signal is measured at certain intervals in time. Each measurement is referred to as a sample.  (The analog signal is also quantized in amplitude, but that process is ignored in this demonstration.  See the Analog to Digital Conversion page for more on that.)

When the continuous analog signal is sampled at a frequency F, the resulting discrete signal has more frequency components than did the analog signal.  To be precise, the frequency components of the analog signal are repeated at the sample rate.  That is, in the discrete frequency response they are seen at their original position, and are also seen centered around +/- F, and around +/- 2F, etc.

How many samples are necessary to ensure we are preserving the information contained in the signal?  If the signal contains high frequency components, we will need to sample at a higher rate to avoid losing information that is in the signal.  In general, to preserve the full information in the signal, it is necessary to sample at twice the maximum frequency of the signal.  This is known as the Nyquist rate.  The Sampling Theorem states that a signal can be exactly reproduced if it is sampled at a frequency F, where F is greater than twice the maximum frequency in the signal.

What happens if we sample the signal at a frequency that is lower that the Nyquist rate?  When the signal is converted back into a continuous time signal, it will exhibit a phenomenon called aliasing.  Aliasing is the presence of unwanted components in the reconstructed signal.  These components were not present when the original signal was sampled.  In addition, some of the frequencies in the original signal may be lost in the reconstructed signal.  Aliasing occurs because signal frequencies can overlap if the sampling frequency is too low.  Frequencies "fold" around half the sampling frequency - which is why this frequency is often referred to as the folding frequency.

Sometimes the highest frequency components of a signal are simply noise, or do not contain useful information.  To prevent aliasing of these frequencies, we can filter out these components before sampling the signal.  Because we are filtering out high frequency components and letting lower frequency components through, this is known as low-pass filtering. 

Demonstration of Sampling

The original signal in the applet below is composed of three sinusoid functions, each with a different frequency and amplitude.  The example here has the frequencies 28 Hz, 84 Hz, and 140 Hz.  Use the filtering control to filter out the higher frequency components.  This filter is an ideal low-pass filter, meaning that it exactly preserves any frequencies below the cutoff frequency and completely attenuates any frequencies above the cutoff frequency. 

Notice that if you leave all the components in the original signal and select a low sampling frequency, aliasing will occur.  This aliasing will result in the reconstructed signal not matching the original signal.  However, you can try to limit the amount of aliasing by filtering out the higher frequencies in the signal.  Also important to note is that once you are sampling at a rate above the Nyquist rate, further increases in the sampling frequency do not improve the quality of the reconstructed signal.  This is true because of the ideal low-pass filter.  In real-world applications, sampling at higher frequencies results in better reconstructed signals.  However, higher sampling frequencies require faster converters and more storage.  Therefore, engineers must weigh the advantages and disadvantages in each application, and be aware of the tradeoffs involved. 

The importance of frequency domain plots in signal analysis cannot be understated.  The three plots on the right side of the demonstration are all Fourier transform plots.  It is easy to see the effects of changing the sampling frequency by looking at these transform plots.  As the sampling frequency decreases, the signal separation also decreases.  When the sampling frequency drops below the Nyquist rate, the frequencies will crossover and cause aliasing.

Experiment with the following applet in order to understand the effects of sampling and filtering.

Instructions for using the Program

The applet is divided into three sections, the Original Analog Signal panel, Sampled Digital Signal panel, and the Reconstructed Analog Signal panel.  By making choices of the sampling frequencies, you can see the effects of aliasing in the frequency domain plots.  By making choices of the filtering frequency, you can control what signals remain when the analog signal is sampled.  You can overlay the original plot on top of the reconstructed plot if you want to see just how different the results are.  You can also use the reset button to return all values to their original defaults.

To see this run in an independent window, click here: 

For more detailed information on sampling and signal processing in general, consider the following text: 

Digital Signal Processing : Principles, Algorithms, and Applications, by J. Proakis and D. Manolakis, New York: Macmillan Publishing Company, 1992.

Send comments to Dr. John Glover at .