Sound
Sampling sound
Sound is an analogue wave: it changes smoothly and continuously. A computer can only store binary, so the sound must be turned into numbers.
To do this, the computer measures the height (amplitude) of the wave at regular intervals. Each measurement is a sample, and it's stored as a binary number. Played back, the samples rebuild an approximation of the wave.
The graph shows a sound wave (the curve) and the samples taken from it (the crosses), one every millisecond. Each sample is rounded to the nearest level that can be stored, so the samples don't sit exactly on the wave.
Key terms
Sample rate, duration and bit depth
| Factor | What it is | If it increases... |
|---|---|---|
| Sample rate | The number of samples taken each second, in hertz (Hz). CD-quality sound uses 44,100 Hz | The samples are closer together, so the playback is closer to the original: better quality, bigger file |
| Duration | How many seconds of sound the file holds | More samples are stored: bigger file |
| Bit depth | The number of bits used to store each sample, such as 16-bit | Each sample can be stored more precisely: better quality, bigger file |
Key terms
Sound file size
sound file size = sample rate × duration (s) × bit depth
The answer is in bits.
Example 1: a 5-second sound is recorded at 8,000 Hz with a bit depth of 8 bits. How big is it in kilobytes?
- 8,000 × 5 × 8 = 320,000 bits
- Bits to bytes: 320,000 ÷ 8 = 40,000 bytes
- Bytes to KB: 40,000 ÷ 1,000 = 40 KB
Example 2: 10 seconds of CD-quality sound: 44,100 Hz, 16 bits.
- 44,100 × 10 × 16 = 7,056,000 bits
- 7,056,000 ÷ 8 = 882,000 bytes (882 KB)
Exam tip
Put the duration in seconds (2 minutes is 120 s) and the sample rate in hertz (8 kHz is 8,000 Hz) before you multiply.