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.
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.
What is (Nyquist) Sampling Theorem?
Derivation of Nyquist sampling rate
What is anti-aliasing filter?
To prevent aliasing, we have two options :
- Increase the sampling rate (fs) beyond the Nyquist rate (2. fm).
- 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.
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.