0
0
RosConceptBeginner Β· 3 min read

What is Undersampling: Definition and Examples in Signal Processing

In signal processing, undersampling means taking fewer samples of a signal than the usual rate required to capture all its details. This can cause aliasing, where different signals become indistinguishable, but it can be useful to reduce data size or focus on specific frequency ranges.
βš™οΈ

How It Works

Imagine you want to record a song but only take a few snapshots of the sound instead of many. If you take too few snapshots, you might miss important parts or mix up sounds, making the recording unclear. This is what happens in undersampling: the signal is sampled at a rate lower than the standard called the Nyquist rate, which is twice the highest frequency in the signal.

When undersampling happens, high-frequency parts of the signal can appear as lower frequencies, a problem called aliasing. It's like seeing a spinning wheel in a movie that looks like it’s turning backward because the camera frame rate is too low. However, undersampling can be useful if you want to reduce the amount of data or if you know the signal has certain properties that allow safe undersampling.

πŸ’»

Example

This example shows how undersampling a simple sine wave can cause aliasing, changing the signal's appearance.
python
import numpy as np
import matplotlib.pyplot as plt

# Original signal parameters
fs_original = 1000  # Original sampling rate in Hz
f_signal = 100      # Signal frequency in Hz
t = np.arange(0, 0.05, 1/fs_original)  # Time vector

# Original signal: sine wave
signal = np.sin(2 * np.pi * f_signal * t)

# Undersample the signal (sampling rate less than 2*f_signal)
fs_undersample = 150  # Undersampled rate
indices = np.arange(0, len(t), int(fs_original/fs_undersample))
t_undersample = t[indices]
signal_undersample = signal[indices]

# Plot
plt.figure(figsize=(8,4))
plt.plot(t, signal, label='Original Signal (1000 Hz sampling)')
plt.stem(t_undersample, signal_undersample, linefmt='r-', markerfmt='ro', basefmt='k-', label='Undersampled Signal (150 Hz sampling)')
plt.title('Effect of Undersampling on a 100 Hz Sine Wave')
plt.xlabel('Time (seconds)')
plt.ylabel('Amplitude')
plt.legend()
plt.tight_layout()
plt.show()
Output
A plot showing a smooth sine wave sampled densely in blue and red dots showing fewer samples that distort the wave shape due to undersampling.
🎯

When to Use

Undersampling is used when you want to reduce the amount of data collected or processed, especially if the signal has known properties that prevent aliasing. For example, in some communication systems, undersampling can help capture signals at high frequencies using lower-speed hardware.

It is also used in machine learning to balance datasets by reducing samples from a majority class to avoid bias. However, in signal processing, undersampling must be done carefully to avoid losing important information.

βœ…

Key Points

  • Undersampling means sampling below the Nyquist rate.
  • It can cause aliasing, mixing frequencies and distorting the signal.
  • Useful to reduce data size or hardware requirements if done carefully.
  • Not suitable when full signal detail is needed.
βœ…

Key Takeaways

Undersampling samples a signal at a rate lower than twice its highest frequency, risking aliasing.
Aliasing causes different signals to look the same, leading to distortion.
Use undersampling to reduce data or hardware needs only when signal properties allow it.
Always check if undersampling will lose important information before applying it.