Sound is a smooth, continuous wave, but a computer can only store whole binary numbers. Sampling measures the wave at regular intervals and stores each measurement. The sampling rate and the sampling resolution decide how faithful the recording is and how big the file becomes.
Sound is analogue data: it varies continuously. To store it, an analogue-to-digital converter samples the amplitude of the wave at regular intervals and stores each sample as a binary integer, giving digital data made of discrete values. The sampling rate is the number of samples taken per second (measured in hertz). The sampling resolution is the number of bits used for each sample, giving 2n possible amplitude levels. Raising either one makes the recording more accurate but the file larger. File size = sampling rate × sampling resolution × time (× number of channels) bits.
Fig. 1: the wave is measured at regular intervals and each sample is stored as a binary number
Section 01
Analogue to digital.
In the lab, watch one millisecond of a sound wave being sampled. Lower the sampling rate and the resolution and see how badly the rebuilt wave fits the original.
Analogue data: continuous, with infinitely many possible values, like the changing air pressure of a sound wave or the voltage from a microphone.
Digital data: discrete values stored in binary.
Sampling: measuring the amplitude of the analogue signal at regular time intervals.
Encoding: each sample is rounded to the nearest available level and stored as a binary integer with a fixed number of bits. The file is the sequence of these samples (plus a header holding the sampling rate and resolution).
Examiner trap
Say what is measured: the amplitude (height) of the wave. "Sampling records the sound" is too vague to earn the mark.
Section 02
Rate and resolution.
The two settings control accuracy in two different directions: rate is about time (left to right), resolution is about amplitude (up and down).
Increase the ...
Effect on accuracy
Effect on file size
Sampling rate (samples per second)
Samples are closer together in time, so quick changes in the wave are captured and the playback is closer to the original
More samples per second, so larger
Sampling resolution (bits per sample)
More amplitude levels (2n), so each sample is rounded less and the dynamic range is greater
More bits per sample, so larger
Typical values: CD audio uses 44 100 samples per second at 16 bits in two channels (stereo); telephone speech uses about 8000 samples per second.
Trade-off: choose the lowest settings that still give acceptable quality for the purpose, to save storage and transmission time.
Examiner trap
Sampling resolution is not the same as sampling rate. Resolution is bits per sample; rate is samples per second. Mixing them up loses marks in every part of the question.
Stage 1 · Learn
Check what the sim just showed you
Four quick checks. Each correct answer earns XP and records this skill on your profile.
Quick check+10 XP
What is meant by the sampling rate?
Quick check+10 XP
In the lab, what happens to the rebuilt wave when the sampling resolution is increased?
Quick check+10 XP
How many amplitude levels does a 4-bit sampling resolution give?
Quick check+10 XP
Which describes analogue data?
Section 03
Calculating file size.
Multiply samples per second by bits per sample by the number of seconds, and by 2 for stereo. Then convert the bits into the unit asked for.
Worked example CD-quality minute
Calculate the size of 60 seconds of mono sound sampled at 44 100 Hz with a 16-bit resolution, in MiB.
Bits: 44 100 × 16 × 60 = 42 336 000 bits.
÷ 8 = 5 292 000 bytes.
÷ 1 048 576 = 5.05 MiB (2 d.p.).
Answer: about 5.05 MiB (twice that in stereo)
Worked example Working backwards
A 5 MiB limit is set for a mono recording at 16 000 Hz and 16 bits. What is the longest whole number of seconds that can be recorded?
Bytes per second: 16 000 × 16 ÷ 8 = 32 000 bytes.
5 MiB = 5 × 1 048 576 = 5 242 880 bytes.
5 242 880 ÷ 32 000 = 163.84 seconds.
Answer: 163 seconds
Your turn
Calculate the size in bytes of 10 seconds of mono sound sampled at 8000 Hz with 8-bit resolution.