Sampling, Aliasing, and Reconstruction
Sampling connects continuous-time signals to discrete-time sequences. A sampler records values at equally spaced times, where is the sampling period and is the sampling angular frequency. The central question is whether those samples contain enough information to recover the original continuous-time signal.
The sampling theorem says exact reconstruction is possible for bandlimited signals when the sampling rate is high enough. If the sampling rate is too low, shifted copies of the spectrum overlap. That overlap is aliasing, and it is not merely a plotting artifact: different continuous-time frequencies produce the same discrete-time samples.
Definitions
Uniform sampling of a continuous-time signal with sampling period produces the sequence
The sampling frequency in cycles per second is
and the sampling angular frequency is
A continuous-time signal is bandlimited to if
Impulse-train sampling models the sampled continuous-time signal as
Using the sifting property,
The Fourier transform of the impulse train is another impulse train:
Therefore multiplication in time produces convolution in frequency, and the sampled spectrum is
The discrete-time frequency corresponding to continuous-time frequency under sampling is
Because DT frequency is periodic with period , continuous-time frequencies separated by integer multiples of map to the same discrete-time frequency.
Key results
The Nyquist sampling condition for a bandlimited signal is
Equivalently,
The number is the Nyquist rate. The frequency is often called the Nyquist frequency. The distinction matters: one is a minimum sampling rate, the other is the highest frequency representable without aliasing at a given sampling rate.
If , the shifted copies of in do not overlap. An ideal lowpass reconstruction filter can isolate the central copy and undo the scale factor . One ideal reconstruction response is
with transition band allowed if .
The time-domain interpolation formula for ideal reconstruction is
where the normalized sinc is
Aliasing occurs when the spectral copies overlap:
A continuous-time sinusoid
sampled at period gives
The sampled sequence cannot distinguish from
or from sign-reflected equivalents created by cosine symmetry. That is why antialiasing filters are placed before analog-to-digital conversion: information lost to aliasing cannot be recovered by later digital processing.
The practical sampling workflow has three stages. First, limit the analog input bandwidth with an antialiasing filter. Second, sample at a rate high enough that the remaining spectral copies do not overlap. Third, if a continuous-time output is needed, use a reconstruction filter to isolate the baseband copy. Each stage has a different job. The sampler creates copies; it does not decide which copy is the original. The reconstruction filter can select a copy only if the copies are separated.
The strict inequality is the clean textbook condition. At exactly , edge cases depend on whether the spectrum is zero at the band edge and on the realizability of the reconstruction filter. In engineering practice, sampling rates are chosen with guard bands because real filters have transition regions and cannot switch from passband to stopband instantly.
Downsampling and upsampling in discrete time mirror the same ideas. Downsampling by an integer factor compresses the effective frequency axis and can create aliasing unless a digital lowpass filter removes high-frequency content first. Upsampling by inserting zeros creates spectral images that must be removed by an interpolation filter. These operations are discrete-time versions of the same spectral-copy logic.
Aliasing can sometimes be used intentionally, as in bandpass sampling, but only when the spectral bands and sampling rate are chosen so that shifted copies land without overlap. Accidental aliasing is destructive; intentional aliasing is controlled frequency translation.
A final check in sampling problems is to compare pictures in both units. On the continuous-time axis, copies are spaced by rad/s. On the discrete-time axis, all frequencies are folded into a -periodic interval. A continuous-time frequency near may appear near zero after sampling, while a frequency just above may appear as a lower-frequency sinusoid with reversed sign convention. Drawing both axes prevents the mistaken belief that high sampled frequencies always remain high in the sequence.
The sample values alone do not contain the sampling rate. The same numerical sequence can represent different analog frequencies if it is played back or interpreted with a different . Always keep the sampling period attached to the data when moving between continuous-time and discrete-time descriptions.
Visual
No aliasing: spectral copies do not overlap
copy baseband copy
--------/\-------------/\-------------/\--------> omega
-ws 0 ws
Aliasing: copies overlap
overlap overlap
-----------/\/\---/\/\---/\/\----------> omega
-ws 0 ws
| Quantity | Meaning | Formula |
|---|---|---|
| Sampling period | seconds per sample | |
| Sampling angular frequency | radians per second | |
| Bandlimit | largest nonzero CT frequency | |
| Nyquist rate | minimum ideal sampling rate | |
| DT frequency mapping | CT to DT frequency | |
| Spectrum copies | sampled CT spectrum |
Worked example 1: checking the sampling theorem
Problem: A continuous-time signal is bandlimited to
It is sampled at
Determine whether ideal reconstruction is possible.
Method:
- Convert the bandlimit to hertz:
- Compute the Nyquist rate:
- Compare with the actual sampling rate:
- Since the sampling rate is below the Nyquist rate, shifted copies of the spectrum overlap.
Checked answer: Ideal reconstruction is not possible from these samples alone. Aliasing occurs. An antialiasing filter would need to reduce the analog bandwidth to below
before sampling.
Worked example 2: finding an aliased sinusoid
Problem: The signal
is sampled at
Find the discrete-time frequency and an equivalent aliased continuous-time frequency in the baseband interval .
Method:
- Convert the sinusoid frequency to hertz:
- The sampling period is
- The discrete-time radian frequency is
- Discrete-time frequency is periodic modulo . Bring into :
- A cosine is even, so
- Convert back to hertz:
Checked answer: The 700 Hz sinusoid sampled at 1000 Hz aliases to a 300 Hz cosine in the sampled data. The sequence is
Code
import numpy as np
import matplotlib.pyplot as plt
fs = 1000.0
f0 = 700.0
T = 1 / fs
n = np.arange(0, 40)
x_samples = np.cos(2 * np.pi * f0 * n * T)
x_alias = np.cos(2 * np.pi * 300.0 * n * T)
print("samples match aliased 300 Hz:", np.allclose(x_samples, x_alias))
t = np.linspace(0, 0.01, 2000)
fig, ax = plt.subplots(figsize=(8, 3))
ax.plot(t, np.cos(2 * np.pi * f0 * t), label="700 Hz analog")
ax.plot(t, np.cos(2 * np.pi * 300.0 * t), label="300 Hz alias", alpha=0.7)
ax.stem(n * T, x_samples, linefmt="k-", markerfmt="ko", basefmt=" ")
ax.set_xlim(0, 0.01)
ax.legend()
ax.grid(True)
plt.tight_layout()
plt.show()
Common pitfalls
- Confusing Nyquist rate with Nyquist frequency. The Nyquist rate is ; the Nyquist frequency for a sampler is .
- Forgetting that an ideal reconstruction theorem requires bandlimiting before sampling.
- Assuming a high digital sampling rate fixes aliasing after it has already occurred. Aliasing is created at the sampling operation.
- Mixing angular frequency in rad/s with ordinary frequency in Hz without the factor .
- Thinking sample values remember the original continuous-time frequency. Frequencies separated by multiples of produce identical samples.