A CD stores music as a list of numbers, 44,100 of them every second. Between those numbers there is nothing at all. So how does a smooth violin note come back out? And why does a tone that is too high for the list come back as a different note?
Sound is air pressure wobbling up and down. To store it digitally, a recorder measures the pressure at fixed, equal moments and writes down each reading. That is sampling. A CD takes 44,100 readings per second for each of its two channels.
Plot those readings as dots and you get a dot-to-dot picture with no lines drawn. The dots alone could belong to many different curves. The trick is that only one of those curves is slow and smooth enough to count, and that is the one the player draws.
Think of a single pure tone. One full wobble has a peak and a trough, so you need to catch it at least twice per wobble to know it is wobbling at all. Harry Nyquist worked out the idea for telegraph signals in the 1920s, and Claude Shannon proved the general form in 1949: sample more than twice per second as fast as the highest frequency you want to keep, and the original can be rebuilt exactly.
Half the sample rate is the Nyquist limit. For 44,100 samples per second that is 22,050 Hz. Young ears reach to about 20,000 Hz, so the limit sits just above everything we can hear.
The lime wave below is the real tone. The white dots are the samples a recorder keeps, and the orange wave is the slower curve those dots seem to trace. Drag the wave sideways, use the slider or tap a preset. Watch what the dots do once the tone passes the halfway marker.
Strip at the bottom: the left half is the safe zone. Past the marker the tone folds back like a flipped page.
Above the Nyquist limit, the dots stop being able to tell the tone from a slower impostor. The rule is simple. Measure how far the real tone is from the nearest whole multiple of the sample rate. That distance is the pitch the samples claim.
A 30,000 Hz tone sampled at 44,100 per second sits 14,100 Hz below the sample rate, so the dots say 14,100 Hz. A 25,000 Hz tone, which no human can hear, becomes 19,100 Hz, which can be heard. The names for this are aliasing and folding: the high tone has put on a low tone's name.
At exactly the sample rate, the tone completes a whole number of wobbles between every pair of readings. Every dot lands at the same height, and the samples draw a flat line: silence, or a steady offset.
The same thing fools your eyes at the cinema. Film shows 24 pictures a second, and a wheel turning at nearly the right speed gets sampled once per spoke. It appears to crawl, stand still or roll backwards. That is the wagon-wheel effect, and it is the same folding with a wheel instead of a wave.
Folding means anything above 22,050 Hz must be removed before sampling, or it will land on top of the music as extra notes. The part that removes it is an anti-aliasing filter. A perfect filter would pass 20,000 Hz and block 20,001 Hz at once, and no real one can. Real filters need room to slope down. Choosing 44,100 gave them a gap of 2,050 Hz between the edge of hearing and the Nyquist limit.
The exact number came from video tape. Early digital audio was stored by recording it as a black-and-white pattern on a video recorder, with three samples per video line. In the PAL system that is 294 usable lines per field times 50 fields per second times 3, and in black-and-white NTSC it is 245 lines times 60 fields times 3. Both give 44,100.
The phone network made a different trade. It samples speech 8,000 times a second, so the limit is 4,000 Hz. Speech keeps its meaning, which is why a voice on the phone is clear but a flute sounds dull. Tap the 8 kHz button above and try a 5 kHz tone to see what the network does to anything higher.
Sampling loses nothing below half the rate and breaks everything above it. Digital audio works because the sample rate is chosen so that the music fits in the safe half, and everything else is filtered out first.