Search

Aliasing, Sampling theorem and Anti-aliasing

More topics in ,

Aliasing, Sampling theorem and Anti-aliasing

What is aliasing?

Aliasing occurs when a sampler (of an analog to digital converter) periodically misses samples such that it sees the signal as a different frequency. It is an unintentional form of undersampling.

Aliasing happens in signal processing when a signal is sampled at a rate lower than the Nyquist rate. The Nyquist rate states that to reconstruct a signal accurately, it must be sampled at a rate at least twice the signal’s highest frequency component. If the sampling rate is insufficient, high-frequency components of the signal may appear as lower-frequency components in the sampled data, resulting in distortion or artifacts.

Explaination of aliasing

In Fig 1, it is shown that a single-tone signal is correctly reconstructed if the sample rate is more than 2fm (Nyquist rate). In Fig 2, The spectrum of the same is shown. During reconstruction through a digital-to-analog converter, a reconstruction filter removes high-frequency components. In that filter band, only the original signal tone is present. It means that the signal is reconstructed correctly.

oversampling-1
Fig 1: Original signal getting reconstructed properly if the sampling rate is more than Nyquist rate.
oversampling_spectrum-1
Fig 2: The reconstructed signal spectrum is identical to that of the original signal if sampling rate is more than Nyquist rate.

In Fig 3, the same signal is sampled at a rate less than 2fm (Nyquist rate); the samples do not represent the signal correctly in the time domain. In Fig 4, the spectrum is shown. During reconstruction, image tones (fs-fm) come inside the signal tone band, leading to artifacts, as shown in Fig 3.

undersampling-1
Fig 3: Original signal getting falsely reconstructed if the sampling rate is less than Nyquist rate.
undersampling_spectrum-1
Fig 4: The reconstructed signal spectrum now includes a image component because of aliasing. This aliasing is happening because of sampling frequency is less than Nyquist rate.

What is (Nyquist) Sampling Theorem?

The sampling theorem states that in order to accurately reconstruct a continuous-time, band-limited analog signal from its samples (a discrete-time signal), the sampling rate must be at least twice the maximum frequency (or twice the bandwidth) of the analog signal. In mathematical terms, if fm is the maximum frequency component in the analog signal, then the minimum sampling frequency required to avoid aliasing and accurately reconstruct the signal is given by: $$f>2f_{m}$$

Derivation of Nyquist sampling rate

We can derive the above expression from Fig 4. We see that the aliased image is at fs – fm. If we do not want aliasing, this image should be lying at a frequency higher than fm. Why higher than fm? Because of this maximum desired frequency of interest. This means fs – fm > fm or fs > 2fm.

What is anti-aliasing filter?

To prevent aliasing, we have two options :

  1. Increase the sampling rate (fs) beyond the Nyquist rate (2. fm).
  2. Natural signals have frequency content that extends out to infinity, we cannot increase the sampling rate to infinity. The other option is to choose a suitable maximum sampling frequency (fs) and remove the content beyond (fs/2) from the signal using a low-pass filter. This filter is called an anti-aliasing filter. If these signal components at > fs/2 are allowed, aliasing cannot be avoided.

Example of aliasing in real world

Aliasing in digital audio

Aliasing can manifest as unwanted audio artifacts, such as “aliasing noise” or distortion when a sound signal is sampled or processed at an insufficient rate. Anti-aliasing filters often prevent or reduce aliasing by removing or attenuating high-frequency components before sampling.

These artifacts typically manifest as unwanted tones, harmonics, or roughness in the audio signal. For example, if a high-frequency signal is not adequately sampled, it may be mistakenly represented as a lower-frequency signal, leading to audible distortion.

In addition to anti-aliasing filters, digital audio systems often employ oversampling techniques and more advanced signal processing algorithms to reduce aliasing further and improve the audio reproduction quality.

Aliasing in computer graphics

Aliasing in computer graphics commonly manifests as jagged or stair-stepped edges, shimmering or flickering patterns, and moiré patterns. It occurs because computer displays and digital images are composed of discrete pixels, and when rendering or displaying a continuous image, the limited number of pixels can lead to inaccurate representation.

computer_graphics_aliasing-1

One of the most well-known examples of aliasing in computer graphics is the “jagged edge” effect, often seen in diagonal or curved lines. When a line or curve is displayed with a low resolution or inadequate sampling, the pixels that represent the shape do not accurately follow the desired smooth line, resulting in a staircase-like appearance.

Quick Calculators

RC circuit
Time Constant (s) =

Cutoff Frequency (Hz) =

Time Constant (s) =

Cutoff Frequency (Hz) =

Impedance magnitude (Ω) =

Resonant frequency (Hz) =

Topics