What is Undersampling: Definition and Examples 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
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()
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.