Explaining aliasing with spectral folding
Aliasing happens because sampling creates periodic copies of the original spectrum spaced by the sampling frequency; if the signal contains frequencies above the Nyquist frequency (fs/2), these copies overlap and fold back into the baseband, causing indistinguishable alias frequencies. An analog frequency f0 above fs/2 appears as an alias at f_alias = |f0 - k fs| within the baseband (-fs/2, fs/2), illustrating spectral folding. A simple ASCII depiction can show the original spectrum as a block and multiple overlapping repeats spaced by fs, highlighting how higher frequencies fold into lower ones.
When you take a continuous–time signal (x(t)) and sample it every (T_s) seconds, its Fourier transform is no longer a single band centred at DC, it is replicated at integer multiples of the sampling rate (f_s=1/T_s). Mathematically, for a band–limited (X(f)) the spectrum of the sampled sequence is
[
X_{\text{s}}(f) = \frac{1}{T_s}\sum_{k=-\infty}^{\infty} X!\left(f-k f_s\right),
]
so you get a copy of the original spectrum centred at (0), another centred at (+f_s), another at (-f_s), and so on.
The Nyquist criterion says that if (X(f)) is zero for (|f|>f_s/2), these replications do not overlap. If the original signal contains components above (f_s/2) they will overlap with the baseband copy and add to it. From the discrete–time point of view, the only thing you “see” is the frequency modulo (f_s), so a sinusoid at (f_0) and one at (f_0\pm k f_s) produce the same samples. A convenient way to express the foldback into the primary ([-\tfrac{f_s}{2},+\tfrac{f_s}{2}]) interval is
[
f_{\text{alias}} = \left|,f_0 - k f_s,\right|\quad\text{with }k\text{ chosen so }f_{\text{alias}}\leq \tfrac{f_s}{2}.
]
For example, with (f_s=10\ \text{kHz}) a tone at (6\ \text{kHz}) will show up in the sampled data as a tone at (4\ \text{kHz}), because (6{-}10=-4).
A simple ASCII sketch shows the mechanism. Suppose the continuous spectrum is a lowpass of width (B), but (B>\tfrac{f_s}{2}):
Original X(f):
┌──────┐
│ │
--------┘ └--------
After sampling, copies every f_s:
┌──────┐ ┌──────┐ ┌──────┐
│ │ │ │ │ │
-----┘ └------┘ └------┘ └-----
-f_s 0 f_s 2f_s 3f_s 4f_s
If (B< f_s/2) these boxes do not touch. If (B>f_s/2), the boxes centred at 0 and ±(f_s) overlap, and the overlapping portions “fold” back into the baseband. In normalized frequency, where the Nyquist limits are at ±0.5, the folding looks like this:
Normalized frequency (f/f_s):
folding at 0.5
↓ ↑
| /¯¯¯¯¯¯¯¯¯¯\ |
| / \ |
‑0.5 |___/ \___| 0.5
Everything to the right of 0.5 is mirrored back into ([0,0.5]), and everything to the left of –0.5 is mirrored into ([-0.5,0]), producing aliases in the sampled spectrum.