Study Guide
Representing Sound
How a computer turns a sound wave into binary by sampling it, what sample rate and sample resolution are, and how each changes the accuracy and the file size of a recording.
Lesson 1.7 Data Representation
For: Cambridge IGCSE Computer Science learners, or anyone who can already convert between binary and denary
Stage: Think
Recording a swing with a notebook
A fictional pupil, Kiran, sits by a playground swing. She wants to record how high the seat goes as it swings, using only a pen and a notebook, so that a friend could redraw the swing’s movement later. The seat moves smoothly: it is at a different height at every instant.
Think it through
Kiran cannot write down every instant. How could she record the movement so that her friend can redraw it? What would make the redrawing closer to the real swing?
- Hint 1: She could look at the swing only at certain moments. When?
- Hint 2: There are two things she could change: how often she looks, and how carefully she measures each height.
Show a model answer
She could measure the height of the seat at regular times, for example once a second, and write each height in a table. Her friend plots the points and joins them up. The redrawing is closer to the real swing if she measures more often, and if she measures each height more precisely, for example to the nearest centimetre and not the nearest metre.
The swing’s height can be any value, with no gaps. Data that varies smoothly like this, so that it can take any value in a range, is analogue data. A sound is analogue too: the air vibrates in a smoothly changing wave, and a microphone turns it into a smoothly changing electrical signal.
A computer cannot store an unending number of values. It stores digital data: a set of separate values, kept as binary numbers. To store a sound, the smooth wave has to be turned into a list of separate numbers. Kiran’s table of heights is a small version of exactly that.
Stage: Discover
Turning a wave into numbers
Think it through
A microphone produces a smoothly changing signal. A computer stores only whole numbers in binary. Using Kiran’s idea, what two things would you do to the signal to turn it into whole numbers?
- Hint 1: One thing is about when to measure.
- Hint 2: The other is about what to do with a measurement that falls between two whole numbers.
Show what happens
First, measure the height of the signal at regular moments. Second, round each measurement to the nearest whole-number level that can be stored. Each rounded measurement is then written in binary.
A measurement of the wave’s height at one moment is a sample, and taking measurements at regular intervals is sampling. The steps are:
Follow one sound through the four stages that turn it into stored digital data.
Microphone
Step 1 of 4: Sound becomes a signal
The air vibrates, and the microphone turns the vibration into a smoothly changing electrical signal. This is analogue data.
Computer
Step 2 of 4: Take samples
At regular, very short intervals, the computer measures the height of the signal. Each measurement is one sample.
Computer
Step 3 of 4: Round each sample
Each sample is rounded to the nearest of a fixed set of levels, because only a fixed number of levels can be stored.
Computer
Step 4 of 4: Store as binary
The number of each level is written in binary, and the binary numbers are stored in order. This is the digital data.
Technical detail: Played back, the numbers are turned into a signal again and sent to a speaker.
Stage: Discover
Encoding some samples
A fictional note is sampled six times. The recorder can store eight levels, numbered 0 to 7.
Think it through
If each sample is stored in 3 bits, how many different levels can the recorder store? How many bits will six samples take in total?
- Hint 1: Remember that n bits make 2ⁿ patterns.
- Hint 2: Six samples, each of the same number of bits.
The six samples, after rounding, are at levels 2, 5, 7, 5, 2 and 0: the note rises to a peak, then falls to silence.
| Sample | Level | 3-bit binary |
|---|---|---|
| 1 | 2 | 010 |
| 2 | ||
| 3 | 7 | |
| 4 | 5 | |
| 5 | 2 | |
| 6 | 0 |
- Write each level as a number of 3 bits using the columns 4, 2 and 1.
- Keep the leading zeros: every sample must be exactly 3 bits.
Show the completed table
| Sample | Level | 3-bit binary |
|---|---|---|
| 1 | 2 | 010 |
| 2 | 5 | 101 |
| 3 | 7 | 111 |
| 4 | 5 | 101 |
| 5 | 2 | 010 |
| 6 | 0 | 000 |
The recording is stored as 010101111101010000: 18 bits, in order. Each sample is a whole number of levels, so the stored wave is a set of separate steps, not a smooth curve.
Check your understanding
Show the answer
Answer: B. 40 bits, because 10 samples × 4 bits = 40.
10 × 4 = 40 bits. The levels (16 of them) say how finely each sample can be measured; the bits per sample say how much is stored for each.
Stage: Predict
How often to measure
Kiran’s two friends measure the same swing for 4 seconds. Mo measures its height 2 times a second, and Zara measures it 10 times a second.
Think it through
Whose table will let you redraw the swing’s movement more closely, and whose table is longer? How many heights is each table likely to hold?
- Hint 1: How many heights does Mo write in 1 second? In 4 seconds?
- Hint 2: Which table has more points to join up?
Show what happens
Zara’s table is closer to the real swing, because there are more points and so less is guessed between them. It is also longer: Mo has 2 × 4 = 8 heights and Zara has 10 × 4 = 40 heights.
The number of samples taken in each second is the sample rate. It is measured in hertz (Hz): one hertz is one sample per second. Mo used 2 Hz and Zara used 10 Hz. Real recordings use thousands: a recording of speech on a phone line may use 8000 Hz, and a music CD uses 44 100 Hz.
The number of samples in a recording is the sample rate multiplied by the length in seconds.
| Sample rate | Length | Number of samples |
|---|---|---|
| 10 Hz | 4 seconds | 40 |
| 100 Hz | 5 seconds | |
| 1000 Hz | 30 seconds | |
| 8000 Hz | 2 seconds |
- Multiply the sample rate by the number of seconds.
Show the completed table
| Sample rate | Length | Number of samples |
|---|---|---|
| 10 Hz | 4 seconds | 40 |
| 100 Hz | 5 seconds | 500 |
| 1000 Hz | 30 seconds | 30 000 |
| 8000 Hz | 2 seconds | 16 000 |
Check your understanding
Show the answer
Answer: A. It follows the original sound more closely, and the file is bigger.
A higher sample rate gives a more accurate recording because there are more samples, and a bigger file for the same reason.
Stage: Predict
How carefully to measure
Now look at how carefully each height is measured. Kiran can record a swing height to the nearest metre, or to the nearest centimetre.
Think it through
Which measurement needs a bigger number to write down? If a computer used only 2 bits for each sample, how many different heights could it store?
- Hint 1: 2 bits make how many patterns?
- Hint 2: Would a swing that goes smoothly up and down look smooth, or stepped, with so few heights?
Show what happens
Centimetres need a bigger number: there are more possible values. 2 bits make 2² = 4 patterns, so only four different heights could be stored. Every measurement would be rounded to one of four steps, and the redrawn swing would look stepped and rough.
The number of bits used for each sample is the sample resolution. With n bits for each sample, there are 2ⁿ levels to round to. More bits give more levels, with smaller steps between them, so each sample is closer to the true height of the wave.
| Sample resolution | Number of levels |
|---|---|
| 1 bit | 2 |
| 2 bits | |
| 4 bits | |
| 8 bits | |
| 16 bits |
- n bits make 2ⁿ patterns, so each extra bit doubles the number of levels.
Show the completed table
| Sample resolution | Number of levels |
|---|---|
| 1 bit | 2 |
| 2 bits | 4 |
| 4 bits | 16 |
| 8 bits | 256 |
| 16 bits | 65 536 |
Check your understanding
Show the answer
Answer: C. There are only 16 levels, so samples are rounded more roughly, and the file is smaller.
With 4 bits there are 2⁴ = 16 levels, against 2⁸ = 256. Samples are rounded to a coarser set of steps, so the recording is less accurate, but each sample needs fewer bits, so the file is smaller.
Stage: Explain
Two settings, two jobs
Think it through
In your own words, how do sample rate and sample resolution differ? Use the swing to explain each, and say which of them is a count of bits.
- Hint 1: One is about how often you measure, the other about how carefully you measure.
Show a model answer
Sample rate is how often the height is measured (samples per second, in hertz). Sample resolution is how carefully each height is measured, and is the number of bits for each sample.
Do not confuse: Sample rate and sample resolution
- How often?Sample rate
- The number of samples taken each second, in hertz (Hz).44 100 Hz means 44 100 samples every second.
- How precisely?Sample resolution
- The number of bits used for each sample, which sets how many levels there are.16 bits means 65 536 levels for each sample.
Raising either one makes the recording more accurate and the file bigger.
Sample rate does not change how loud or how high a sound is. It changes how closely the recording follows the original: a higher rate has more samples, so there is less guessing between them. In the same way, a higher resolution does not make the sound louder: it makes each sample closer to the true height of the wave.
A fictional recorder stores 4000 samples every second, each in 8 bits, for 10 seconds.
- Find the number of samples. 4000 × 10 = 40 000 samples.
- Find the bits. Each sample takes 8 bits, so 40 000 × 8 = 320 000 bits.
- Now change one setting. If the sample rate is doubled to 8000 samples a second, there are 80 000 samples and 640 000 bits: twice the size.
- Change the other. If the resolution is doubled instead, to 16 bits each, there are 40 000 × 16 = 640 000 bits: also twice the size.
Doubling either setting doubles the file size, and makes the recording more accurate. A later lesson turns this working into a formula.
Go deeper Beyond the specification: why a music CD uses 44 100 Hz
Humans can hear sounds up to about 20 000 Hz. A wave can only be followed properly if it is sampled at least twice as fast as its highest frequency. Twice 20 000 is 40 000, and 44 100 Hz is a little above that. Telephone calls need much less: speech is understandable using about 8000 Hz, which is why a phone call can sound dull next to a music recording.
Stage: Apply
Choose settings for a job
A fictional app offers two ways to record. “Voice memo” uses 8000 Hz and 8 bits. “Studio music” uses 44 100 Hz and 16 bits.
Apply it
Show the answer
Answer: B. Voice memo, because speech stays clear at lower settings and the file is smaller.
For speech, the lower settings give a recording that is still clear and a much smaller file, so voice memo is the sensible choice. For music, where more of the detail of the sound matters, the higher settings are worth the extra size.
Apply it
Show the answer
Answer: C. It is half the size, because there are half as many samples at the same bits each.
Halving the sample rate halves the number of samples, so the file is half the size. The recording is less accurate, because less of the wave is measured.
Apply it
Show the answer
Answer: A. The rate counts samples each second; the bits in each sample come from the resolution.
The sample rate and sample resolution are separate settings. 16 000 Hz means twice as many samples each second; 16 bits would be a change of sample resolution.
Stage: Consolidate
Bring it together
Think it through
Without looking back, explain to a friend how a computer stores a sound, and why a recording sampled 10 times a second at 2 bits sounds rougher than one sampled 10 000 times a second at 16 bits.
Show a model answer
The sound wave is analogue. The computer measures its height at regular moments (samples), rounds each to one of a set of levels, and stores each level as a binary number. At 10 samples a second and 2 bits (4 levels), there are very few points and each is rounded coarsely, so the stored wave is a poor copy. At 10 000 samples a second and 16 bits (65 536 levels), there are many points and each is very close to the true height.
Check your understanding
Show the answer
Answer: C. The list of binary numbers that a recorder stores for a sound.
A list of binary numbers is digital: each sample is one of a fixed set of levels. The air pressure and the microphone’s signal are analogue, because they vary smoothly.
- Analogue data varies smoothly and can take any value in a range, like a sound wave. Digital data is made of separate values, stored in binary.
- To store a sound, the wave is sampled: its height is measured at regular intervals, each sample is rounded to a level, and the level is stored as a binary number.
- The sample rate is the number of samples each second, in hertz (Hz). The sample resolution is the number of bits for each sample, and n bits give 2ⁿ levels.
- A higher sample rate or a higher sample resolution makes a recording more accurate, and makes the file bigger. A lower one makes it less accurate and smaller.
- The two settings are separate: one is how often, the other is how precisely. Neither changes how loud a sound is.
Sources and scope
- What this lesson is. The seventh lesson of the Data Representation module, written for this site. It teaches point 2 of Cambridge IGCSE Computer Science 1.2 (sound: sample rate and sample resolution) against the 2026 to 2028 syllabus (version 6). Its curriculum links are provisional: no link has been verified by the site owner. They show where the lesson may help with a course and imply no review or endorsement by any examination board.
- Original material. Kiran and the swing, Mo and Zara, the six samples, the two recording settings and Tariq’s claim are fictional examples written for this lesson. The numbers are chosen to divide cleanly: real recordings use many more samples. The phone and CD values are the usual ones.
- Simplified on purpose. Samples are shown as whole-number levels rounded to the nearest one. How a recording is turned back into sound, the maths of sampling, and stereo (more than one channel) are not taught. Calculating a file size is in Measuring Storage and File Sizes.
Data that varies smoothly and can take any value in a range, such as a sound wave.
The number system with only two digits, 0 and 1, in which each column is worth twice the column to its right.
A single binary digit: 0 or 1. The smallest unit of data a computer stores.
Data made of separate values, stored by a computer as binary numbers.
The unit for how often something happens each second: a sample rate of 1000 Hz means 1000 samples every second.
One measurement of the height of a sound wave, taken at one moment.
The number of samples taken of a sound in each second, measured in hertz.
The number of bits used to store each sample of a sound, which sets how many levels each sample can take.
Your progress on this lesson
Saved in this browser only. It is not sent anywhere, does not follow you to another device, and is lost if you clear this site’s data.
This browser is not allowing the site to save progress, so it will be forgotten when you leave the page.