Storing Sound
How a continuous analogue wave becomes a list of binary numbers, what sample rate and bit depth each control, and the sound file size calculation.
Analogue to digital
Sound in the real world is an analogue wave: a continuously varying change in air pressure. It has infinitely many values at infinitely many moments.
A computer cannot store infinity. So sound must be sampled.
Sampling
Sampling means measuring the amplitude of the sound wave at regular intervals and recording each measurement as a binary number.
- A microphone converts the sound wave into a varying electrical signal.
- An analogue to digital converter measures the amplitude of that signal at fixed intervals.
- Each measurement is rounded to the nearest available level and stored in binary.
The result is a long list of numbers that approximates the original wave.
Sampling is the process of measuring the amplitude of an analogue sound wave at regular intervals and storing each measurement as a binary value.
Because samples are taken at intervals and rounded to fixed levels, the stored version can never be a perfect copy. It can only be a closer or a rougher approximation.
- 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 bit depth
Sample rate
Sample rate is the number of samples taken per second, measured in hertz.
- CD quality is 44,100 Hz, so 44,100 measurements every second
- Telephone quality is about 8000 Hz
A higher sample rate means:
- The samples are closer together, so the digital version follows the shape of the original wave more closely
- Higher frequencies can be captured accurately
- The file is larger
Bit depth
Bit depth is the number of bits used to store each individual sample.
- 8 bit depth gives 28 = 256 possible amplitude levels
- 16 bit depth gives 216 = 65,536 levels
A higher bit depth means:
- Each measurement can be recorded more precisely, because there are more levels to round to
- Quieter details survive rather than being rounded away
- The file is larger
Sample rate is about how often you measure, along the time axis. Bit depth is about how precisely you record each measurement, along the amplitude axis. Questions frequently test whether you know which is which.
| Sample rate | Bit depth | |
|---|---|---|
| Measures | How many samples per second | How many bits per sample |
| Axis | Time | Amplitude |
| Unit | Hertz | Bits |
| Increasing it | Captures the wave shape more accurately over time | Records each amplitude more precisely |
Calculating sound file size
file size (bits) = sample rate x duration in seconds x bit depth
If the recording is in stereo, multiply by 2, because there are two channels.
Worked example
A 3 minute song is recorded at 44,100 Hz with a bit depth of 16, in mono. Calculate the file size in megabytes.
Duration: 3 x 60 = 180 seconds 44,100 x 180 x 16 = 127,008,000 bits 127,008,000 / 8 = 15,876,000 bytes / 1000 = 15,876 KB / 1000 = 15.876 MB
In stereo that would be 31.752 MB.
The quality against size trade off
| Setting | Quality effect | Size effect |
|---|---|---|
| Double the sample rate | Better representation of the wave, higher frequencies captured | Doubles the file |
| Double the bit depth | More precise amplitudes, wider dynamic range | Doubles the file |
| Halve the sample rate | Wave shape reproduced more roughly, sounds duller | Halves the file |
Increasing the sample rate or the bit depth improves the accuracy with which the original analogue wave is reproduced, and therefore the sound quality, but it increases the file size proportionally.
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.
Key terms you must be able to define
- Analogue
- A continuously varying signal, such as a real sound wave, with infinitely many possible values.
- Sampling
- Measuring the amplitude of an analogue signal at regular intervals and storing each value in binary.
- Sample rate
- The number of samples taken per second, measured in hertz.
- Bit depth
- The number of bits used to store each individual sample.
- Amplitude
- The height of the sound wave at a given moment, which corresponds to loudness.
- Analogue to digital converter
- The hardware that measures an analogue signal and outputs binary sample values.
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
The single biggest discriminator on this topic is whether you can explain why a higher sample rate improves quality, rather than just asserting that it does.
Weak: "A higher sample rate means better quality."
Strong: "A higher sample rate means samples are taken closer together in time, so the sequence of stored values follows the shape of the original analogue wave more closely and less detail is lost between samples, which produces a more accurate reproduction."
Do the same for bit depth: more bits means more possible amplitude levels, so each sample is rounded by a smaller amount, which means quieter detail is preserved.
Always state the file size consequence. Every quality improvement on this topic costs storage in direct proportion.
- Explain sampling as a three step process from microphone to binary
- Distinguish sample rate and bit depth in one sentence each
- Calculate a sound file size in the unit asked for, including stereo
- Give a reasoned recommendation for a scenario, such as a podcast versus a music studio
Mistakes that cost marks here
- Swapping sample rate and bit depth. Rate is per second, depth is per sample.
- Forgetting to convert minutes into seconds before calculating.
- Forgetting to double the file size for stereo when the question says stereo.
- Saying digital sound is 'exactly the same' as the original. It is always an approximation.
- Saying a higher sample rate 'makes the sound louder'. It affects accuracy, not volume.
CD audio uses 44,100 samples per second. That specific number exists because early digital recorders stored audio on video tape, and 44,100 fit neatly into the line and frame structure of both PAL and NTSC television.
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 amplitude of the analogue sound wave is measured
- LMeasurements are taken at regular intervals
- LEach measurement is stored as a binary value
Sampling is the process by which a continuously varying analogue sound wave is converted into digital data. The amplitude of the wave is measured at regular fixed intervals, and each of those measurements is rounded to the nearest available level and stored as a binary number. The complete recording is therefore a long sequence of binary values that approximates the shape of the original wave.
- LSample rate is the number of samples taken per second
- LBit depth is the number of bits used to store each sample
- LHigher sample rate captures the shape of the wave over time more accurately
- LHigher bit depth records each amplitude more precisely because there are more levels
Sample rate is the number of samples taken every second, measured in hertz, so it describes how often the sound wave is measured along the time axis. Bit depth is the number of bits used to store each individual sample, so it describes how precisely each measurement is recorded along the amplitude axis. Increasing the sample rate means the measurements are closer together in time, so the stored data follows the shape of the original wave more closely and less detail is lost between samples. Increasing the bit depth means there are more possible amplitude levels available, so each measurement is rounded by a smaller amount and quieter detail is preserved.
- LMultiplies sample rate by duration by bit depth
- LObtains 31,752,000 bits
- LDivides by 8 to obtain 3,969,000 bytes
- LStates approximately 3.97 MB
File size in bits is sample rate multiplied by duration multiplied by bit depth, which is 22,050 x 90 x 16 = 31,752,000 bits. Dividing by 8 gives 3,969,000 bytes, dividing by 1000 gives 3969 kilobytes, and dividing by 1000 again gives approximately 3.97 megabytes.
- LRecommends a relatively low sample rate such as 22,050 Hz or lower
- LSpeech occupies a narrower frequency range than music so a high rate is unnecessary
- LRecommends a bit depth of 16, or justifies 8, for adequate clarity
- LExplains that this keeps the file size small for downloading over mobile data
- LRecommends mono rather than stereo, halving the size
- LAcknowledges the trade off that quality is reduced compared with music standard settings
A sample rate of around 22,050 Hz with a bit depth of 16, recorded in mono, would be a sensible choice. Speech occupies a much narrower frequency range than music, so the very high frequencies that a 44,100 Hz rate is designed to capture are simply not present in a spoken voice, and halving the sample rate therefore halves the file size with almost no audible loss of clarity. A bit depth of 16 keeps the dynamic range wide enough that quiet speech does not become distorted, and dropping to 8 bits would introduce noticeable background hiss on quiet passages. Recording in mono rather than stereo halves the size again, and since a single speaker has no meaningful stereo image there is nothing lost. Together these settings might produce a file around a quarter the size of a CD quality stereo recording, which matters a great deal to listeners downloading episodes over mobile data where both speed and data allowances are limited. The trade off is that the recording would not be suitable if music were included, and a studio producing music would need the full 44,100 Hz stereo settings.
- LFewer samples are taken each second
- LThe reproduction of the original wave is less accurate, so quality falls
- LThe file size is halved
Halving the sample rate means only half as many measurements of the sound wave are taken each second. Because the samples are further apart in time, more of the detail between them is lost and the stored data follows the shape of the original wave less closely, so the playback quality is noticeably lower and the recording tends to sound duller. Since file size is directly proportional to sample rate, the file will be half its original size, which is the benefit being traded for that loss of quality.