Demonstration of Aliasing of a Sinusoidal Signal

(Java 1.1 Version)


Note
This is a Java 1.1 applet. It should work with HotJava 1.1, Internet Explorer 4.0 or Netscape Navigator 4.0 with the Java 1.1 upgrade patch applied.
If you are using Netscape Navigator 3 or earlier, or Navigator 4.0 without the Java 1.1 upgrade, try the Java 1.02 version of the applet.

Introduction

The applet demonstrates graphically how an undersampled sinusoidal signal appears as though it has a lower "alias" frequency.

According to the sampling theorem, a sinusoidal signal (or component of a more complex signal) can be correctly reconstructed from values sampled at discrete, uniform intervals as long as the signal frequency is less than half the sampling frequency. Any component of a sampled signal with a frequency above this limit, often referred to as the folding frequency, is subject to aliasing.

The applet is based on a fixed sampling rate of 8000 samples per second (one sample every 0.125 milliseconds). The folding frequency is thus half of 8000 Hz or 4000 Hz.

Outline instructions

The input signal frequency, in Hz, is typed into the text box. When you click the Plot button, with Input signal checked, the input signal is plotted against time. The Grid checkbox toggles on and off vertical gridlines indicating the instants at which the signal is sampled. The Sample points, representing the sampled values of the input signal, can also be toggled. Finally, the Alias frequency checkbox (visible only when the input signal frequency is above the 4000 Hz folding frequency) controls the plotting of a sinusoidal signal at the alias frequency - in other words, the input signal as it appears after the sampling process.

If all you can see is a grey rectangle, try the Java 1.02 version of the applet.


Aliasing demonstration

The following steps demonstrate aliasing of a sinusoidal input signal.

  1. With the input frequency set at its initial default value of 7000 Hz, and only the Input signal checkbox selected, click the Plot button. The sinusoidal input signal, at its true frequency of 7000 Hz, is plotted.

  2. Select Grid to show the instants of time at which the signal is sampled. The horizontal (time) axis in the plot covers a total of 0.004 seconds worth of the input signal. The signal is sampled at a rate of 8000 samples/s, so there are 8000 × 0.004 = 32 sample instants shown.

  3. Select Sample points to mark the sampled values of the signal. These occur where the signal is cut by the vertical sample markers. Note that the sample points seem to trace out a sine wave of a lower frequency than the true signal frequency. You can see this more clearly if you toggle off the Input signal plot.

  4. Select Alias frequency. This shows the sinusoidal signal at the alias frequency. A digital signal processing system to which the input signal samples are input does not know what the signal is doing between samples, and therefore cannot distinguish between sampled versions of the true input signal and the apparent alias signal.

The alias frequency can be measured from the plot, just as from an oscilloscope trace. The period is 8 sampling intervals, or

8 × 0.125 ms = 1.0 ms

The corresponding frequency is 1 / 1.0 ms = 1000 Hz.

Try other values for the input frequency and see if you can work out the relationship between the true and alias frequencies.


Download source code (zip Archive)

FFT Spectrum Analyser applet: 1.02 version | 1.1 version

Feedback | DSP home page