Digitizing a signal: sampling
Sampling and Shannon's theorem
Turning a continuous signal into numbers
A computer cannot store a continuous curve: it records its value at regular intervals. This is sampling. The sampling frequency Fe is the number of measurements per second (44,100 Hz for an audio CD, for example). Each measurement is a sample.
The crucial question: how many samples?
If you sample too rarely, you miss the fast variations of the signal and distort it. The Shannon-Nyquist theorem gives a precise answer: to faithfully represent a signal whose maximum frequency is Fmax, you must sample at a frequency strictly greater than twice Fmax.
Shannon condition: Fe > 2 x Fmax
(example: the ear hears up to ~20 kHz)
(so Fe > 40 kHz is needed -> CDs use 44.1 kHz, slightly above)
Why the factor of 2
You need at least two points per period of the highest frequency to capture its rise and fall. Below that, two sinusoids of different frequencies can pass through exactly the same samples: they become indistinguishable, and the information is lost forever.
Classic pitfall
The theorem talks about the maximum frequency present in the signal, not the one we are interested in. If a signal contains frequencies above Fe/2 (for example high-frequency noise), they must be removed with a filter BEFORE sampling, otherwise they will pollute the low frequencies — this is the aliasing phenomenon of the next lesson.

