Skip to main content

Nyquist-Shannon Theorem: Aliasing in Signal Processing & Best Practices for Downsampling and Upsampling


Aliasing in Signal Processing

1. Nyquist-Shannon Sampling Theorem (Standard)

This is the foundational principle for preventing aliasing in both downsampling and upsampling:

  • The signal must be sampled at least at twice the highest frequency component in the signal (i.e., the sampling rate should be greater than or equal to twice the maximum frequency, known as the Nyquist rate).

Mathematically:

fs ≥ 2 × fmax

Where:

  • fs is the sampling rate.
  • fmax is the maximum frequency present in the signal.

For a signal with frequency content up to fmax, the Nyquist rate is 2 × fmax. If you violate this and sample below this threshold, aliasing will occur.

 

Aliasing in Signal Processing

Aliasing is a phenomenon that occurs when a continuous signal (or sampled signal) is undersampled during digital signal processing. This results in different signals becoming indistinguishable from each other when sampled at a lower rate. Aliasing is a major issue in both downsampling (decimation) and upsampling (interpolation), although it manifests differently in each case.

 

1. Aliasing during Downsampling (Decimation)

Downsampling involves reducing the sampling rate of a signal. When you downsample a signal, you take fewer samples per unit time. If the signal contains frequencies higher than half the new sampling rate (the Nyquist frequency), those high-frequency components get folded back into the lower frequency range, causing aliasing.

Conditions for Aliasing in Downsampling:

  • The original signal contains frequency components above half the new sampling rate (i.e., above the Nyquist frequency).
  • The Nyquist-Shannon sampling theorem states that to avoid aliasing, the original signal should be band-limited to half of the sampling rate (i.e., the Nyquist frequency).
  • If you downsample without low-pass filtering (anti-aliasing filter) the signal to remove these high-frequency components, aliasing will occur.

Example:

Suppose your original signal has a sampling rate of 1000 Hz. This means that the Nyquist frequency is 500 Hz.

If you want to downsample to a new sampling rate of 300 Hz, the Nyquist frequency for this rate is 150 Hz.

Any frequency component in the signal above 150 Hz will alias and appear as lower-frequency components.

To prevent aliasing during downsampling:

  • Pre-Filtering (Anti-Aliasing Filter): Apply a low-pass filter to the signal before downsampling. This filter should remove any frequency components above the Nyquist frequency of the new sampling rate.

For example, if you downsample from a sampling rate of fs = 1000 Hz to fs' = 300 Hz, the filter should remove all frequencies above 150 Hz (half of the new sampling rate).

  • Downsample the Signal: After the low-pass filtering step, downsample the signal by selecting every M-th sample, where M is the downsampling factor.

Mathematical Standard for Downsampling:

fnew = fold / M

Where:

  • fnew is the new, lower sampling rate.
  • fold is the original, higher sampling rate.
  • M is the downsampling factor.

 

2. Aliasing during Upsampling (Interpolation)

Upsampling, or interpolation, involves increasing the sampling rate of a signal. During upsampling, additional samples are inserted between the existing samples to increase the sample rate, but the frequency content of the signal does not change. Upsampling itself doesn't cause aliasing directly, but it can introduce artifacts if not handled properly.

Aliasing in Upsampling occurs due to:

  • The introduction of high-frequency components (above the Nyquist frequency of the new sampling rate) into the signal after the interpolation process. This can happen because interpolation can generate frequencies higher than the Nyquist frequency of the target sampling rate.

Example:

Suppose your original signal has a sampling rate of 200 Hz, and you upsample to 800 Hz.

The Nyquist frequency of the original signal is 100 Hz (half of 200 Hz), so the signal may have frequencies between 0 Hz and 100 Hz.

After upsampling to 800 Hz, the Nyquist frequency is 400 Hz.

If the signal is upsampled by inserting samples, the interpolated signal may introduce high-frequency components (between 100 Hz and 400 Hz) that could cause aliasing.

How to Prevent Aliasing during Upsampling:

  • Zero Padding: Insert M-1 zeros between each original sample. For example, if you want to upsample by a factor of M = 3, insert two zeros between each original sample.
  • Apply Interpolation Filter: After zero padding, apply a low-pass filter (such as an FIR filter) to remove any high-frequency components that might have been introduced during the interpolation process. This filter should have a cutoff at the Nyquist frequency of the new sampling rate.

Mathematical Standard for Upsampling:

fnew = M × fold

Where:

  • fnew is the new, higher sampling rate.
  • fold is the original, lower sampling rate.
  • M is the upsampling factor.

 

Summary of Aliasing:

  • Downsampling (decimation): Aliasing occurs when the signal contains frequency components above the Nyquist frequency of the new sampling rate, which will fold back into the lower frequencies. Low-pass filtering (anti-aliasing filter) before downsampling is necessary to avoid aliasing.
  • Upsampling (interpolation): Aliasing occurs if the interpolation introduces high-frequency components that exceed the Nyquist frequency of the new sampling rate. This can be avoided by using a low-pass filter to remove any high-frequency components before or after interpolation.

 

Try the Interactive Online Simulator to Understand Aliasing

Use the Online Nyquist Simulator to See the Effects of Aliasing





Contact Us

Name

Email *

Message *

Popular Posts

Design of CMOS Flip-Flops (SR, D, JK)

Design of CMOS Flip-Flops (SR, D, JK) A flip-flop or latch is a circuit with two stable states, used to store state information. It is the basic storage element in sequential logic and a fundamental building block in digital electronics systems, including computers and communication devices. Flip-flops and latches act as data storage elements for states, pulse counting, and synchronization of variably-timed input signals to a reference clock. Flip-flops can be transparent/opaque (latches) or clocked (synchronous, edge-triggered). Latches are level-sensitive, while flip-flops are edge-sensitive. In sequential logic, the output depends on current inputs and previous states. Fig.1 shows a sequential circuit combining a combinational block and a memory element. ...

Q-function in BER vs SNR Calculation (with Simulation)

Q-function in BER vs. SNR Calculation In digital communications and signal processing, the Q-function plays a significant role in predicting system reliability. It allows engineers to quantify the probability that Gaussian noise will exceed a specific threshold, causing a bit error. What is the Q-function? The Q-function is a mathematical function representing the tail probability of the standard normal (Gaussian) distribution. It is the complementary cumulative distribution function (CCDF) of a standard Gaussian distribution. Q(x) = (1 / √(2Ï€)) ∫â‚“∞ e^(-t² / 2) dt Q-Function Interactive Simulator Move the slider to see how the "Tail Probability" (the area in red) changes. This area represents the Probability of Error (BER) . Threshold Distance ( x ) — (Simulates Increasing SNR) x = 1.0 Q(x) = 0.1587 ...

Pulse Width Modulation (PWM)

Pulse-width modulation (PWM), or pulse-duration modulation (PDM), is a method of controlling the average power delivered by an electrical signal.   Fig: An example of PWM in an idealized inductor driven by a blue line voltage source modulated as a series of sawtooth pulses, resulting in a red line current in the inductor.    Generating a PWM Signal The simplest way to generate a PWM signal is the intersection method, which requires only a sawtooth or a triangle waveform (easily generated using a simple oscillator) and a comparator. When the value of the reference signal is more than the modulation waveform, the PWM signal (magenta) is in the high state; otherwise, it is in the low state.      Duty cycle A low duty cycle equates to low power because the power is off for most of the time; the word duty cycle reflects the ratio of "on" time to the regular interval or "period" of time. The duty cycle is measured in percent, with 100% representing full o...

BER vs SNR for M-ary QAM, M-ary PSK, QPSK, BPSK, ...(MATLAB Code + Simulator)

Bit Error Rate (BER) & SNR Guide Analyze communication system performance with our interactive simulators and MATLAB tools. 📘 Theory 🧮 Simulators 💻 MATLAB Code 📚 Resources BER Definition SNR Formula BER Calculator MATLAB Comparison 📂 Explore M-ary QAM, PSK, and QPSK Topics ▼ 🧮 Constellation Simulator: M-ary QAM 🧮 Constellation Simulator: M-ary PSK 🧮 BER calculation for ASK, FSK, and PSK 🧮 Approaches to BER vs SNR What is Bit Error Rate (BER)? The BER indicates how many corrupted bits are received compared to the total number of bits sent. It is the primary figure of merit f...

FFT Butterfly Method Explained (with Example of 4-point DFT)

  FFT Using Butterfly Method Given: x[n] = {0, 1, 2, 3} Step 1: Split into Even & Odd Even indices: x e = {0, 2} Odd indices: x o = {1, 3} Step 2: 2-point DFT For any {a, b}: DFT = {a + b, a - b} Even Part: E = {0+2, 0-2} = {2, -2} Odd Part: O = {1+3, 1-3} = {4, -2} Step 3: Combine Using Butterfly X[k] = E[k] + W k O[k] X[k + N/2] = E[k] - W k O[k] For N = 4: W 0 = 1 W 1 = -j Final Calculations X[0] = 2 + 4 = 6 X[2] = 2 - 4 = -2 X[1] = -2 + (-j)(-2) = -2 + 2j X[3] = -2 - (-j)(-2) = -2 - 2j Final Answer: X[k] = {6, -2 + 2j, -2, -2 - 2j} Try Interactive Online Simulations Interactive FFT Online Simulator (For understanding Fundamentals)  Interactive FFT Online Simulator (Analyze .CSV, .MP3, .MP4, etc. Further Reading Fourier Transform OFDM Return to Fourier Transform Main Page →

AM Modulation Online Simulator

Amplitude Modulation Simulator s AM (t) = A c [1 + k a m(t)] cos(ω c t) where, ω = 2πf & k a = Amplitude Sensitivity Modulation index, μ = k a A m Message Frequency (fm): Carrier Frequency (fc): Carrier Amplitude (Ac): Modulation Index (m = Am / Ac):

Channel Impulse Response (CIR) (with MATLAB + Simulator)

📘 Overview & Theory 📘 How CIR Affects the Signal 🧮 Online Channel Impulse Response Simulator 🧮 MATLAB Codes 📚 Further Reading What is the Channel Impulse Response (CIR)? The Channel Impulse Response (CIR) is a concept primarily used in the field of telecommunications and signal processing. It provides information about how a communication channel responds to an impulse signal. It describes the behavior of a communication channel in response to an impulse signal. In signal processing, an impulse signal has zero amplitude at all other times and amplitude ∞ at time 0 for the signal. Using a Dirac Delta function, we can approximate this. Fig: Dirac Delta Function The result of this calculation is that all frequencies are responded to equally by δ(t) . This is crucial since we never know which frequenci...

Online Simulator for ASK, FSK, and PSK

Interactive Digital Signal Processing (DSP) Tutorial and Simulator for ASK, FSK, and BPSK modulation techniques. Try our new Digital Signal Processing Simulator!   •   Interactive ASK, FSK, and BPSK tools updated for 2025. Start Now Digital Modulation Visualizer: ASK, FSK, & BPSK Simulator Learn and visualize binary modulation techniques (ASK, FSK, BPSK) in real-time with adjustable carrier and sampling parameters. Perfect for DSP students and engineers. 📡 ASK Simulator 📶 FSK Simulator 🎚️ BPSK Simulator 📚 More Topics ASK Modulator FSK Modulator BPSK Modulator More Topics 1. ASK (Amplitude Shift Keying) Simulat...