AS Level · Topic 1.2
A-Level Computer Science 9618 / Topic 1 / AS

Turning waves into numbers.

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.

The key idea

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.

sampling an analogue wave at regular intervals 0 grey: analogue sound wave red: samples blue: digital version
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.

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 accuracyEffect 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 originalMore 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 greaterMore bits per sample, so larger
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.
  1. Bits: 44 100 × 16 × 60 = 42 336 000 bits.
  2. ÷ 8 = 5 292 000 bytes.
  3. ÷ 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?
  1. Bytes per second: 16 000 × 16 ÷ 8 = 32 000 bytes.
  2. 5 MiB = 5 × 1 048 576 = 5 242 880 bytes.
  3. 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.
Stage 2 · Exam

Exam-style questions

Unlocks once the four checks above are done. Worth more XP, written to AS Paper 1 and Paper 2 standard.

Finish the four checks above to unlock the exam questions
Exam style+20 XP

A mono sound is sampled at 22 050 Hz with 8-bit resolution for 30 seconds. What is the file size?

Exam style+20 XP

Which change would make a recording both more accurate and larger?

Exam style+20 XP

Why might a voice messaging app record at 8000 Hz instead of 44 100 Hz?

Exam style+20 XP

A recording's sampling resolution is changed from 8 bits to 16 bits. What happens to the file size?

Skill unlocked

Sampled sound, mastered.

This skill is now recorded on your profile. Keep the chain going.

-Rank -Level -Score -Topics
Go deeper · practice
Six original Cambridge-style questions
Analogue and digital data, sampling, sampling rate and resolution, and sound file size calculations.