The Cambridge AS & A‑Level Computer Science syllabus is divided into a series of thematic blocks (Data Representation, Communication, Hardware, System Software, Security & Ethics, Algorithms & Data Structures, Programming, Software Development, and the optional A‑Level extensions). The topic “Sound Representation and Encoding” belongs to the Multimedia sub‑topic of the Data Representation block (Section 1.2). Mastery of this material supports:
Later A‑Level extensions (e.g. data‑compression algorithms, floating‑point representation, networking protocols) build directly on the concepts introduced here.
Sound is a mechanical longitudinal wave that propagates through a material medium (air, water, solids) as alternating compressions and rarefactions of pressure. In the physical world it is a continuous analogue signal; computers can only store and manipulate discrete digital values, so the analogue waveform must be sampled and quantised.
\(f{s} > 2\,f{\max}\)
where fmax is the highest frequency component present.
\(f{N}=f{s}/2\)
\(\text{DR}=6.02\,n+1.76\ \text{dB}\)
Assume a full‑scale sinusoid ranging from –1 V to +1 V.
| Bit depth | Levels \(2^{n}\) | Step size (V) | Peak‑to‑Peak SNR (dB) |
|---|---|---|---|
| 8 bits | 256 | \(2/256 = 0.0078\) | ≈ 49.9 dB |
| 16 bits | 65 536 | \(2/65 536 = 3.05\times10^{-5}\) | ≈ 96.3 dB |
| 24 bits | 16 777 216 | \(2/16 777 216 = 1.19\times10^{-7}\) | ≈ 144.5 dB |
The table shows how each additional 8 bits roughly doubles the number of quantisation steps and improves the signal‑to‑noise ratio by about 48 dB.
When PCM samples are stored in a file, the order of the constituent bytes matters:
Understanding endianness is essential for AO3 tasks that involve writing code to read or write raw audio data.
| Format | Compression type | Typical sample rates | Typical bit depths | Typical compression ratio* | Typical use‑case |
|---|---|---|---|---|---|
| WAV | Uncompressed (PCM) | 8 kHz – 192 kHz | 8, 16, 24, 32‑bit | 1 : 1 | Professional recording & editing (Windows) |
| AIFF | Uncompressed (PCM) | 8 kHz – 192 kHz | 8, 16, 24, 32‑bit | 1 : 1 | Apple ecosystem, studio work |
| MP3 | Lossy (psychoacoustic masking) | 16 kHz – 48 kHz | Variable (bit‑rate 64–320 kbps) | ≈ 10 : 1 – 12 : 1 (at 128 kbps) | Streaming, portable devices |
| AAC | Lossy (advanced psychoacoustic model) | 16 kHz – 48 kHz | Variable (bit‑rate 64–256 kbps) | ≈ 12 : 1 – 15 : 1 (at 128 kbps) | Modern streaming services (e.g., YouTube, Spotify) |
| FLAC | Lossless | 8 kHz – 192 kHz | 16, 24‑bit | ≈ 2 : 1 – 3 : 1 | High‑fidelity archiving, audiophile distribution |
*Compression ratio = original uncompressed size ÷ compressed size.
Given:
Data rate:
\(\text{Data rate}=f_{s}\times n \times \text{channels}=44{,}100\times16\times2=1{,}411{,}200\ \text{bits/s}\)
File size:
\(\text{Size}= \dfrac{\text{Data rate}\times t}{8}= \dfrac{1{,}411{,}200\times180}{8}\approx31{,}752{,}000\ \text{bytes}\approx30.3\ \text{MiB}\)
Using the theoretical formula \(\text{SNR}=6.02\,n+1.76\) dB:
These values give a quick way to decide whether a higher bit depth is needed for a particular application.
.wav.| Syllabus Sub‑topic | Relevant AO(s) |
|---|---|
| Definition of sound as a mechanical wave | AO1 |
| Sampling, sample rate & Nyquist theorem (including aliasing & anti‑aliasing filter) | AO1, AO2 |
| Quantisation, bit depth, dynamic range, SNR, quantisation error (numeric example) | AO1, AO2 |
| Endianness & byte ordering of PCM data | AO2, AO3 (code implementation) |
| PCM encoding pipeline | AO1, AO2, AO3 (design a simple encoder/decoder) |
| File formats, typical parameters and compression ratios | AO1, AO2 |
| Lossless vs. lossy compression & psychoacoustic masking | AO1, AO2 |
| File‑size and SNR calculations | AO2 (apply mathematics) |
| Practical checklist for project planning | AO3 |
| Laboratory activity (record → compress → evaluate) | AO3 (design, implement, evaluate) |
Flowchart of the audio‑encoding pipeline – Analogue signal → Anti‑aliasing filter → ADC (sampling + quantisation) → PCM data (byte‑ordered) → Optional compression (lossless or lossy) → Final audio file (WAV/AIFF/MP3/AAC/FLAC…).
Your generous donation helps us continue providing free Cambridge IGCSE & A-Level resources, past papers, syllabus notes, revision questions, and high-quality online tutoring to students across Kenya.