A tone and a clock
A tone generator makes a 1000 Hz tone: x(t) = sin(2π·1000·t) volts. It repeats 1000 times a second, so one cycle lasts 1 ms. The question: how often must we measure it to keep it?
A clock tells the converter (ADC) when to measure. At fs = 8000 samples a second it ticks every 125 µs: 8 samples in each 1 ms cycle. Each sample flies to memory as a number.
Can the numbers alone give the wave back? A rebuilder (DAC) draws the smoothest wave through the dots: the one with no frequency above fs/2 = 4000 Hz. It lands exactly on the 1 kHz tone.
How slow can we go?
Slow the clock to 2500 samples a second: only 2.5 samples per cycle. The dots look far too few, yet the smoothest wave through them is still exactly the 1 kHz tone.
A spectrum shows which frequencies a signal holds. The samples hold the 1 kHz tone plus copies at fs ± 1 kHz: 1.5 kHz, 3.5 kHz and more. The rebuilder keeps only 0 to fs/2 = 1.25 kHz.
At exactly 2000 a second, 2 samples per cycle, every tick here lands on a zero crossing. All samples read 0.00 and the rebuild is silence. The copy at fs − 1 kHz now sits on the tone and cancels it.
At 1500 a second (1.5 per cycle) the copy at fs − 1 kHz = 500 Hz falls below fs/2 = 750 Hz. The rebuilder plays a 500 Hz tone, not 1 kHz. This false tone is an alias.
The rule
The rule: sample faster than twice the highest frequency in the signal, fs > 2·fmax. That limit, 2·fmax, is the Nyquist rate: 2000 a second for our tone. Half the sampling rate, fs/2, is the Nyquist frequency.
Phone voice reaches about 3.4 kHz and is sampled 8000 times a second; its Nyquist rate is 6800. CDs cover hearing up to 20 kHz at 44,100 a second, above 40,000. The gap leaves room for a filter.
In code
In Python with numpy, sample the tone at fs = 2000: n = np.arange(5), then x = np.sin(2*np.pi*f*n/fs). Every value is about 1e-16: zero plus floating-point rounding. The tone has vanished.
The working
# step 1/10 · tone x(t) = sin(2π·f·t) V f = 1000 Hz (cycles per second) T = 1/f = 1 ms per cycle peak = 1 V plot: 4 ms = 4 cycles sampling = measuring x(t) at evenly spaced instants (lesson "Sampling: taking snapshots") motion in the figure: slowed down a lot
The 1000 Hz, 1 V tone and the four clock rates are chosen examples. Every value, dot and curve in the figure is computed from the model: the rebuilt wave by Whittaker–Shannon (sinc) interpolation of 8001 samples, the spectrum as the DTFT of 40 ms of Hann-windowed samples. The motion is slowed down a great deal: the real clock ticks thousands of times a second.