Representing Sound
How an analogue wave becomes a stream of numbers, what sample rate and sample resolution each control, and how to calculate a sound file size without losing a mark on the conversions.
From analogue to digital
Sound in the real world is a continuous wave of changing air pressure. It is analogue: at every instant it has some value, and between any two instants there are infinitely many more.
A computer cannot store something infinite, so the wave has to be sampled. Sampling means measuring the height of the wave at regular intervals and recording each measurement as a binary number.
The result is a staircase that follows the shape of the original wave without ever exactly matching it. Playing the file back reconstructs a wave from those measurements, and how close that reconstruction is to the original depends entirely on how often you measured and how precisely you recorded each measurement.
Sample rate controls how often you measure, which is detail across time. Sample resolution controls how precisely each measurement is recorded, which is detail in amplitude. Questions expect both, and expect you to know which is which.
- Sound is a wave: a smooth, continuous change in air pressure.
- A computer cannot store smooth. It measures the height at intervals.
- Sample more often and the shape you recorded is closer to the original.
- Bit depth is how finely each measurement is rounded.
Sample rate and sample resolution
Sample rate
Sample rate is the number of samples taken each second, measured in hertz.
| Sample rate | Typical use |
|---|---|
| 8000 Hz | Telephone speech |
| 22050 Hz | Basic voice recording |
| 44100 Hz | CD quality music |
| 48000 Hz | Video soundtracks |
A higher sample rate means narrower steps in the staircase, so the digital version follows the original wave more closely and higher frequencies survive. It also means proportionally more samples to store.
Sample resolution
Sample resolution, also called bit depth, is the number of bits used to store each individual sample. AQA uses the term sample resolution, so use it.
- 8 bits gives 256 possible levels for a sample's height.
- 16 bits gives 65536 levels.
Every measured height has to be rounded to the nearest available level, and the difference between the true height and the recorded one is the error introduced by digitising. More bits means more levels, so smaller rounding, so a more faithful recording.
Increasing the sample rate does not give a finer measurement of loudness, and increasing the resolution does not capture higher frequencies. Mark schemes distinguish them carefully.
Calculating sound file size
The formula AQA expects is:
file size in bits = sample rate x sample resolution x duration in seconds
If the recording is in stereo, multiply by 2 for the two channels.
A worked example
A 3 minute recording at 44100 Hz with a sample resolution of 16 bits, in mono.
duration = 3 x 60 = 180 seconds
size in bits = 44100 x 16 x 180 = 127 008 000 bits
size in bytes = 127 008 000 / 8 = 15 876 000 bytes
size in kB = 15 876 000 / 1000 = 15 876 kB
size in MB = 15 876 / 1000 = 15.876 MBIt is the single most common error on this question. The formula uses seconds, and a question that says three minutes is testing whether you noticed.
Why quality costs so much
Doubling the sample rate doubles the file. Doubling the resolution doubles it again. Recording in stereo doubles it once more. That is why a few minutes of uncompressed CD quality audio runs to tens of megabytes, and why almost all music is distributed compressed.
File size calculator
Work out the size of an image, a sound file or a block of text, one conversion at a time. This tool needs JavaScript, so turn it on to use it. Everything you need to answer the exam question is explained in the text above.
- Image: width × height × colour depth. Every pixel costs the colour depth in bits.
- Sound: sample rate × bit depth × seconds, and × 2 for stereo.
- Text: number of characters × bits per character. ASCII uses 8.
- Divide by 8 to turn bits into bytes, then by 1,000 for each step up.
Key terms you must be able to define
- Analogue
- A continuously varying signal, which has a value at every instant.
- Sampling
- Measuring the height of an analogue wave at regular intervals and recording each measurement as a number.
- Sample rate
- The number of samples taken per second, measured in hertz.
- Sample resolution
- The number of bits used to store each individual sample.
- Duration
- The length of the recording in seconds, used in the file size calculation.
- Channel
- One stream of audio. Mono has one, stereo has two.
Flashcards
Say the definition out loud before you flip the card. Retrieving it from memory is what builds recall, reading it again is not.
Reach the top grade on this topic
Almost every mark beyond the basics on this topic comes from keeping the two controls straight and from careful arithmetic.
Say which control does what, in the same sentence as its effect. "A higher sample rate takes more measurements each second, so rapid changes in the wave are captured and higher frequencies are preserved." That is a complete answer. "Better quality" is not.
Name the price alongside the benefit. Every improvement in quality has a proportional cost in file size, and questions asking you to evaluate a choice want both sides plus a decision.
Convert to seconds before anything else. Write it as the first line of your working so you cannot forget it.
Mistakes that cost marks here
- Leaving the duration in minutes when the formula needs seconds.
- Confusing sample rate with sample resolution.
- Forgetting to multiply by two for a stereo recording.
- Forgetting to divide the total bits by eight to get bytes.
- Saying that sampling captures the wave exactly. It approximates it, and the difference is the error introduced by digitising.
CD audio uses 44100 samples a second because of a rule from signal theory: to reconstruct a wave you must sample at more than twice its highest frequency. Human hearing tops out near 20000 Hz, so 44100 leaves a margin.
Knowledge check
Exam-style questions
Five written questions in the style of the real paper. Write a full answer, then let the marker check it against the mark scheme.
- LThe number of bits used to store each sample
Sample resolution is the number of bits used to store each individual sample taken from the sound wave.
- LConverts 4 minutes to 240 seconds
- LMultiplies sample rate by resolution by duration
- LDivides by 8 to get bytes
- LGives approximately 21.168 MB
Four minutes is 4 times 60, which is 240 seconds. The size in bits is 44100 times 16 times 240, which is 169344000 bits. Dividing by 8 gives 21168000 bytes, dividing by 1000 gives 21168 kilobytes, and dividing by 1000 again gives 21.168 megabytes.
- LSample rate is how many samples are taken each second
- LA higher sample rate captures rapid changes and higher frequencies
- LSample resolution is how many bits are used for each sample
- LA higher resolution gives more levels, so each height is recorded more accurately
Sample rate is the number of measurements taken from the wave each second, measured in hertz. Raising it means the measurements are closer together in time, so rapid changes in the wave are captured and higher frequencies survive into the recording. Sample resolution is the number of bits used to store each individual measurement. Raising it increases the number of levels a sample can take, so each measured height is rounded by a smaller amount and the recorded amplitude is closer to the true one. The two controls therefore improve different things: the rate improves detail across time and the resolution improves detail in loudness, and both increase the file size in direct proportion.
- LIt could reduce the sample rate
- LThis reduces the file size in proportion but loses higher frequencies
- LIt could reduce the sample resolution
- LThis gives fewer levels, so loudness is recorded less accurately and the sound is noticeably worse
- LIt could send mono rather than stereo, halving the data
- LReaches a reasoned conclusion about the trade off for this situation
The first change is to reduce the sample rate, for example from 44100 Hz to 22050 Hz. That halves the number of samples and therefore halves the data sent, but it also halves the highest frequency that can be reconstructed, so cymbals and consonants sound dull and the recording loses its brightness. The second change is to reduce the sample resolution, for example from 16 bits to 8. That also halves the data, but it cuts the number of available levels from 65536 to 256, so every measured height is rounded much more coarsely, which is heard as a hiss behind quiet passages. A third option is to send mono rather than stereo, which halves the data again without touching the accuracy of any individual sample, at the cost of losing the sense of position in the mix. For a user on a slow connection the sensible order is to drop to mono first, because the loss is the least noticeable on phone speakers or a single earpiece, then reduce the sample rate, and only reduce the resolution as a last resort since that is where the audible damage is worst. Better still is to offer several quality levels and let the player choose automatically, so the user gets the best the connection can carry.