The idea
Measure the wave, then store numbers
A real sound wave is continuous. A computer stores a list of numbers instead. Two settings control quality:
- Sampling frequency — how many times per second we measure the wave (more samples → closer shape).
- Resolution (bits) — how many height steps each sample can use (more bits → smoother loudness).
TipThe rectangles are a sample-and-hold view: each sample keeps its height until the next sample.
ExampleThis demo tone
tone.txtSignal
wave sine, 440 Hz (note A) window 8 ms of the wave samples set by the frequency slider levels 2^bits height steps
Try a low sample rate or 2-bit resolution — the rectangles pull away from the smooth curve.
Interactive
Sample the wave
Move the sliders. Watch the rectangles. Press play to hear the difference.
Wave · samples · levelslab
Ready
Use the sliders, or press Step to walk through the lab.
Shortcuts: Space play/pause · → step · ← back · R reset
Remember
Three ideas
What sampling always does.
Time
Sampling frequency
Measures the wave many times per second. Too few samples and the rectangles miss the curve.
Height
Bit resolution
Rounds each measure to the nearest allowed height. Fewer bits make big, blocky steps.
Sound
Play what was stored
The computer only has the sample list. Playing it rebuilds a stepped wave from those numbers.