AQA GCSE Computer Science (8525), section 3.3.7 (Representing sound)
Analogue and digital
Real sound is analogue: it varies continuously. A computer can only store digital (binary) data, so sound must be converted to digital before it can be stored or processed.
Sampling
To convert, the analogue signal is sampled. A sample is a measure of the amplitude (height) of the sound wave at one point in time. Samples are taken at regular intervals, and each is stored as a binary number.
Sampling rate and sample resolution
- Sampling rate: the number of samples taken per second, measured in hertz (Hz). 1 Hz is 1 sample per second. CDs use 44 100 Hz.
- Sample resolution: the number of bits used for each sample. CDs use 16 bits.
| Increase... | Effect on sound | Effect on file size |
|---|---|---|
| sampling rate | closer to the original (more samples) | larger |
| sample resolution | each sample more accurate | larger |
Lower values give a smaller file but poorer quality.
File size calculation
Example: a 60 second recording sampled at 44 100 Hz with 16 bits per sample:
- Bits: bits.
- Bytes: bytes.
- That is about 5.3 MB.
Another example
Sampling at 8000 Hz with 8-bit samples for 10 seconds: bits, which is bytes kB.
Why sound is sampled
Computers only use binary, so the smooth wave must be turned into a list of numbers. The more samples, and the more accurate each one, the closer the digital version is to the original.
Common mistake: mixing up sampling rate (how many samples per second) and sample resolution (how many bits each sample uses). Also, remember to divide by 8 to convert bits to bytes.
Exam tip: write the formula, substitute, and give the unit at each stage. If asked to describe the effect of changes, mention both quality and file size.
Check yourself
What is a sample?
A measurement of the amplitude of the sound wave at one point in time.
Calculate the size in bits of 10 seconds of sound at 1000 Hz with 8-bit samples.
1000 × 8 × 10 = 80 000 bits.
What is the effect of a higher sampling rate on file size?
The file size increases, because more samples are stored.