← Back to GCSE guidesCodeBash GCSE Computer Science← PreviousNext →
Data Representation

Sound Sampling

Real sound is a smooth, continuous wave, but a computer can only store discrete numbers. Sampling means measuring that wave's height at regular intervals and storing each measurement. How often you measure, and how precisely, decides how faithfully the recording matches the original.

Section 2

Sample rate: how often we measure

The green curve is the true, continuous sound wave. The dots are samples taken at regular intervals, and the blue line is what gets reconstructed from just those samples. Fewer samples means the reconstruction tracks the original wave far less accurately.

True wave Samples Reconstructed

Samples per waveform

Section 3

Bit depth: how precisely we measure

Same 20 samples every time, same sample rate. This time, each sample's height gets rounded to the nearest available level, exactly like the colour banding you'd see with a low colour depth image. Watch the "staircase" appear as bit depth drops.

True wave Quantised (stored) values

Bit depth

Exam tips

  • Sample rate is measured in Hz (samples per second). CD quality is 44,100 Hz, 44,100 measurements every single second.
  • Bit depth is how many bits are used per sample, more bits means finer amplitude resolution, so less "quantisation error" (the gap between the true value and the nearest storable level).
  • Higher sample rate and higher bit depth both mean better quality, at the cost of a bigger file.
Section 4

What happens if you sample too slowly?

This is a genuinely high-frequency wave, 8 full cycles, sampled only 10 times. Watch what the reconstructed line actually looks like: not a choppy version of the true wave, but a completely different, much slower wave that was never really there. This is called aliasing, and it's why sample rate has a hard minimum, not just a quality dial.

True wave (8 cycles) Samples (only 10) What gets reconstructed
The red line is what a music player would actually reconstruct from these 10 samples: a slow, single wave. The true 8-cycle wave is gone entirely, there's no way to recover it from these samples alone. This is exactly why the Nyquist rule exists: sample rate must be at least double the highest frequency you want to capture, or higher frequencies get misread as completely different, lower ones.

Exam tips

  • The Nyquist rate: to accurately capture a frequency, you must sample at more than double that frequency.
  • Human hearing goes up to roughly 20,000 Hz, which is exactly why CD-quality audio uses 44,100 Hz, comfortably over double.
  • Aliasing isn't just "lower quality", it's a genuine loss of information: once it happens, the original high frequency cannot be recovered from the samples, the data simply isn't there any more.
Section 5

Calculating file size

Exactly the same shape of calculation as bitmap images: sample rate times bit depth times duration times channels, then divide by 8 for bytes.

What that means in practice

Sample rate (Hz)

Bit depth

Duration (seconds)

Channels

Exam tips

  • Mono = 1 channel, stereo = 2 channels (left and right recorded separately, so roughly double the data).
  • This is the uncompressed size (like a WAV file). Formats like MP3 use compression to shrink this considerably.
Section 6

Check your understanding