Sound representation: sampling, sample rate and bit depth
Computers are digital — they store everything as binary numbers. Sound, however, is an analogue phenomenon: a continuous wave of air pressure. To store sound digitally, it must be converted from analogue to digital using a process called sampling. OCR J277 tests sampling concepts and file size calculations.
How analogue sound is digitised
The analogue-to-digital conversion process
- A microphone converts sound waves into an analogue electrical signal (a continuous wave).
- An ADC (Analogue-to-Digital Converter) samples the amplitude (height) of the wave at regular time intervals.
- Each sample is stored as a binary number representing the amplitude at that moment.
- The result is a series of numbers — a digital approximation of the sound wave.
Playback (digital-to-analogue)
- On playback, a DAC (Digital-to-Analogue Converter) converts the digital numbers back into an analogue electrical signal.
- A speaker converts the electrical signal back into sound waves.
Key concepts
Sample rate (sampling frequency)
- The number of samples taken per second (measured in Hz or kHz).
- Higher sample rate → more samples per second → more accurate representation → better quality sound.
- CD quality: 44,100 Hz (44.1 kHz) — captures all frequencies audible to humans (up to 20 kHz).
- Phone quality: 8,000 Hz — adequate for speech but not music.
- Professional audio: 48,000 Hz or 96,000 Hz.
Bit depth (sample resolution)
- The number of bits used to store each sample — how precisely each amplitude value is recorded.
- Higher bit depth → more possible amplitude values → smoother, more accurate sound → better quality.
- 8-bit audio: 2⁸ = 256 possible amplitude levels.
- 16-bit audio (CD standard): 2¹⁶ = 65,536 possible levels.
- 24-bit audio (studio quality): 2²⁴ = 16,777,216 possible levels.
Channels
- Mono: 1 channel (one speaker).
- Stereo: 2 channels (left + right speakers) — doubles the file size compared to mono.
Calculating audio file size
Formula:
File size (bits) = sample rate x bit depth x duration (seconds) x number of channels
File size (bytes) = file size (bits) / 8
Worked example
A 3-minute stereo audio recording at CD quality (44,100 Hz, 16-bit):
- Duration: 3 x 60 = 180 seconds
- Sample rate: 44,100 samples/second
- Bit depth: 16 bits/sample
- Channels: 2 (stereo)
Size = 44,100 x 16 x 180 x 2 = 254,016,000 bits
= 254,016,000 / 8 = 31,752,000 bytes
= 31,752,000 / 1,000,000 ≈ 31.75 MB
Trade-offs
| Increase | Effect on quality | Effect on file size |
|---|---|---|
| Higher sample rate | Better (more accurate) | Larger |
| Higher bit depth | Better (smoother) | Larger |
| More channels (stereo vs mono) | Better (spatial) | Larger |
- Compression (e.g. MP3) reduces file size by discarding some audio data (lossy) or using algorithms that reduce redundancy (lossless — e.g. FLAC).
Common OCR exam mistakes
- Confusing sample rate with bit depth — sample rate = samples per second; bit depth = bits per sample.
- Forgetting to multiply by the number of channels for stereo.
- Forgetting to divide by 8 to convert bits to bytes.
- Saying "higher sample rate makes the sound louder" — it makes it more accurate/higher quality; volume is not affected.
AI-generated · claude-opus-4-7 · v3-ocr-computer-science