How does a computer turn a sound wave into a list of numbers?
A song on your phone is only a long list of numbers, and the spoked wheels in films that seem to spin backwards show how that can go wrong.
▶ Start the storyA computer stores a sound as a long list of numbers. In digital audio the sound wave is encoded as numerical samples in a continuous sequence: the system measures the height of the wave again and again, very fast, and writes each measurement down. The method is called pulse-code modulation, or PCM. In a PCM stream the amplitude of the signal is sampled at uniform intervals, and each sample is to the nearest value within a range of digital steps. To play the sound, a digital-to-analog converter turns the numbers back into a smooth electrical signal that goes through an amplifier to a loudspeaker.
Step 1: Analog signal
A microphone gives a smooth electrical wave
Step 2: Sample
Measure its height at uniform intervals
Step 3: Quantize
Round each measurement to the nearest step
Step 4: Store or send the numbers
Copies stay identical
Step 5: Convert back
A DAC rebuilds the wave for the speaker
Two settings decide how faithful the copy is. The sampling rate is how many times per second the wave is measured. The is how many possible values each measurement can take: adding one bit doubles that number. CD audio takes 44,100 samples per second, each with 16-bit resolution, which gives a of about 96 dB.
How fast is fast enough? The Nyquist-Shannon theorem says that, to reconstruct a signal without aliasing, the sampling rate must be at least twice its bandwidth. People are commonly said to hear from 20 to 20,000 hertz, so the rate has to be above 40,000 samples a second. If it is too slow, aliasing creeps in: low frequencies appear that were never in the original. You have seen it in films, where a spoked wheel seems to turn slowly or backwards because the frame rate is too limited. To avoid it, the signal passes through an first.
The payoff is that digital audio allows an infinite number of copies without any degradation, unlike analog copies, which lose quality each time.
Quiz me
0/3
Recap
Sample at more than twice the highest frequency, and use enough bits for each sample.
💡 A trick to remember it · Twice the top note, or the wheel spins back: sample more than double what you want to hear.
Surprising fact · CD audio takes 44,100 measurements a second, each 16 bits.
Sources (6)
No source, no claim. Every fact in this lesson (16 claims) cites at least one of these.