CIE AS & A Level Computer Science, section 1.2 (Multimedia)
Analogue and digital sound
Sound is an analogue signal: a continuously varying wave. A computer can only store digital data, so the wave is sampled.
Sampling
- Sampling: measuring the amplitude (height) of the sound wave at regular intervals.
- Sampling rate: the number of samples taken per second, measured in hertz (Hz). CD quality is 44 100 Hz.
- Sampling resolution: the number of bits used to store each sample. CD quality uses 16 bits.
Each sample is stored as a binary number, and the list of numbers is the sound file.
Effects of changing the settings
| Change | Effect on quality | Effect on file size |
|---|---|---|
| Higher sampling rate | More accurate, closer to the original wave | Larger |
| Higher sampling resolution | More accurate amplitude, more detail | Larger |
| Lower sampling rate or resolution | Less accurate, "tinny" or distorted | Smaller |
Estimating the file size
Worked example
Three minutes of stereo (2 channels) sound, sampled at 44 100 Hz with 16-bit resolution:
Common mistake: confusing sampling rate with sampling resolution. The rate is how often (per second) and the resolution is how many bits per sample. Also, remember to include the number of channels for stereo sound and to convert seconds, not minutes.
Exam tip: state both settings when describing quality: "a higher sampling rate and a higher resolution give a more accurate reproduction but a larger file". Show the multiplication in the file-size calculation.
Check yourself
What does sampling rate mean?
The number of samples of the sound wave taken each second.
What is the effect of increasing the sampling resolution?
The recording is more accurate, but the file size increases.
How many bits are needed per second for mono sound at 8 000 Hz with 8-bit samples?
bits.