GoalExplain how a sound wave is sampled, what the sample rate is, and why a higher rate gives a more accurate recording.
New words
sample · a measurement of a sound wave at one moment in timesample rate · the number of samples taken each secondaccurate · close to the original
Explanation
To store a sound wave, the computer measures it at regular moments. Each measurement is a sample, and each sample is stored as a binary number. The sample rate is the number of samples taken each second. Between two samples the computer knows nothing about the wave, so it keeps the last value until the next sample. When the samples are played in order they form a stepped copy of the wave. A higher sample rate puts the measuring moments closer together, so the copy follows the wave more closely and the recording is more accurate. The price is more data to store. A recording for music uses tens of thousands of samples every second, so we use smaller numbers in our examples.
Sound wave in the airmicrophone→Samples measured at regular momentscomputer→Each sample stored as a binary number
Worked examples
Sampling a wave at 13 moments, 0 to 12. The line is the original height. The bars show what the computer keeps if it takes a sample every 4 moments, at moments 0, 4, 8 and 12 (heights 3, 12, 2 and 10): it holds each value until the next sample. Notice how far the bars are from the line, for example at moments 2 and 6.
Sample taken every
Samples stored
Total gap from original
4 moments
4
44
2 moments
7
14
1 moment
13
0
Comparing three sample rates on the same wave. For each moment, find the gap between the original and the held value, and add the gaps. Sampling every 4 moments gives a total gap of 44. Sampling every 2 moments gives 14. Sampling at every moment copies the wave exactly, so the gap is 0, but 13 values must be stored instead of 4.
Sample
Height
4-bit binary
at moment 0
3
0011
at moment 4
12
1100
at moment 8
2
0010
at moment 12
10
1010
From samples to numbers. Suppose the heights are stored as 4-bit binary numbers. The four samples from example 1 are stored as 0011, 1100, 0010 and 1010. The number of samples in a recording is the sample rate times the time. A recording with a sample rate of 8 000 per second and a length of 5 seconds has 8 000 × 5 = 40 000 samples. If the rate is doubled to 16 000, the same 5 seconds need 80 000 samples.
Class activity
Sample a wave on paper (no computer). On squared paper draw a smooth wave that goes up and down three times, over 24 squares across. First take a sample every 6 squares: mark the height at each sample, then draw the stepped copy, holding each height until the next sample. On a second sheet, take a sample every 3 squares. Lay both stepped copies over the original and decide which is closer. Write how many samples each used. If you have a computer or tablet, an adult can help you copy your two sets of heights into a spreadsheet and draw a chart of each.
Practice
1
Work out the number of samples in each recording: sample rate times length. Complete the table.
A wave has the heights shown. A sample is taken every 4 moments. (a) Write the held values. (b) Work out the total gap from the original. (c) The same wave is sampled every 2 moments, which gives a total gap of 15. Which rate is more accurate, and what is the cost?
Moment
0
1
2
3
4
5
6
7
8
Original height
4
8
12
9
5
2
6
11
7
Held value (sample every 4)
4
?
?
?
5
?
?
?
7
(a) 4, 4, 4, 4, 5, 5, 5, 5, 7. (b) 0 + 4 + 8 + 5 + 0 + 3 + 1 + 6 + 0 = 27. (c) Every 2 moments is more accurate (gap 15 is smaller than 27). The cost is more samples to store: 5 instead of 3.
3
Write each sample height as a 4-bit binary number.
Sample height
4-bit binary
5
?
9
?
14
?
2
?
5 = 0101; 9 = 1001; 14 = 1110; 2 = 0010.
4
Recording A uses a sample rate of 4 000 per second and recording B uses 20 000 per second, for the same song. Which one will sound more like the original, and which file will be bigger? Explain.
B has more samples each second, so its stepped copy follows the wave more closely and is more accurate. B also has more samples to store, so its file is bigger.