Sampling
مُقدَّم| English | المعنى |
|---|---|
| Nyquist criterion | معيار نايكويست |
| aliasing/ˈeɪlɪəsɪŋ/ | الاختلاط |
| anti-alias filter | فلتر منع الاختلاط |
| guard band | guard band |
Wheels that turn backwards
- In films, a car's wheels sometimes seem to spin slowly backwards. The camera takes 24 frames a second, and the wheel turns almost a full spoke between frames.
- A digital audio channel samples sound the same way. This lesson shows when samples capture a signal exactly and when they lie.
Sampling copies the spectrum
- Sampling multiplies $x(t)$ by a train of impulses every $T$ seconds. In frequency, that copies the spectrum to every multiple of $f_{s} = \dfrac{1}{T}$.
- If the copies do not overlap, a low-pass filter can pick out the original and rebuild $x(t)$ exactly.
Sampling at f_s places copies of the signal's spectrum at every multiple of f_s.
الصعوبة 1/5 · 100 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
Multiplying by an impulse train in time convolves the spectrum with an impulse train in frequency, which copies it to each $kf_{s}$.
The Nyquist criterion
- A signal with no content above $f_{max}$ is recoverable if $f_{s} > 2f_{max}$: the Nyquist criterion 奈奎斯特准则.
- Below that rate the copies overlap. A frequency above $\dfrac{f_{s}}{2}$ folds back into the band as a false lower one: aliasing 混叠.
A sensor signal has content up to 150 Hz. What sampling rate must be exceeded, in Hz?
الصعوبة 2/5 · 140 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
$f_{s} > 2f_{max} = 300$ Hz. In practice, sample comfortably above it to leave a guard band.
Worked example: the 4 kHz alias
- A 4 kHz tone sampled at 6 kHz: $4 > \dfrac{6}{2} = 3$, so it aliases to $|4 - 6| = 2$ kHz.
- Check the samples: $\cos\left(2\pi \cdot \tfrac{2}{3}n\right) = \cos\left(2\pi \cdot \left(-\tfrac{1}{3}\right)n\right) = \cos\left(2\pi \cdot \tfrac{1}{3}n\right)$. The two tones give identical samples.

A 4 kHz tone is sampled at 6 kHz. It appears as
الصعوبة 1/5 · 100 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
4 kHz is above $\dfrac{f_{s}}{2} = 3$ kHz, so it folds to $|4 - 6| = 2$ kHz. The samples are identical to a real 2 kHz tone.
A 7 kHz tone is sampled at 10 kHz. At what frequency does it appear, in kHz?
الصعوبة 2/5 · 140 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
7 kHz exceeds $\dfrac{f_{s}}{2} = 5$ kHz, so it folds to $10 - 7 = 3$ kHz.
The anti-alias filter
- Once a tone has folded, no later processing can tell it from a real low tone. So an anti-alias filter 抗混叠滤波器 must remove everything above $\dfrac{f_{s}}{2}$ before the sampler.
- The guard band 保护频带 between $f_{max}$ and $\dfrac{f_{s}}{2}$ is the room the filter has to roll off in.
Where must the anti-alias filter go?
الصعوبة 1/5 · 100 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
An aliased tone is indistinguishable from a real one once sampled, so it must be removed before sampling.
Worked example: CD audio
- Content to 20 kHz, sampled at 44.1 kHz: $\dfrac{f_{s}}{2} = 22.05$ kHz. A 23 kHz interference tone would alias to $44.1 - 23 = 21.1$ kHz, inside the audio band.
- The guard band is only 2.05 kHz, which needs a steep filter. Studios sample at 96 kHz (a 28 kHz guard band) so a gentle filter will do.
Audio to 20 kHz, sampled at 96 kHz. How wide is the guard band?
الصعوبة 1/5 · 100 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
$\dfrac{96}{2} - 20 = 28$ kHz, against 2.05 kHz at 44.1 kHz. The anti-alias filter can be far gentler.
Three common slips
- Treating $f_{s} = 2f_{max}$ as safe. The inequality is strict; at equality a sine can be sampled at its zero crossings and vanish.
- Filtering after sampling. The alias is already inside the band.
- Expecting upsampling to restore detail. What was never sampled was never recorded.
A digital low-pass filter after the sampler can remove an alias.
الصعوبة 1/5 · 100 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
The alias lands inside the band, at a frequency real content may also have. No filter can separate the two once they share a frequency.
Recap
- Sampling copies the spectrum at multiples of $f_{s}$.
- Need $f_{s} > 2f_{max}$; above $\dfrac{f_{s}}{2}$, frequencies fold back as aliases.
- The anti-alias filter goes before the sampler, within the guard band.