Sampling Rate vs Sample Resolution in Sound Files
Learn the difference between sampling rate and sample resolution in digital sound files, with a GCSE Computer Science example and an exam mistake to avoid.
Sampling rate is how many times per second a sound is measured. Sample resolution is how many bits are used to store each measurement. Sampling rate affects how often the sound is recorded; sample resolution affects how precisely each measurement is stored.
How sound is sampled
A microphone produces a continuously changing signal. To make a digital sound file, a computer takes measurements called samples at regular intervals. The sampling rate is measured in hertz (Hz), meaning samples per second. For example, a rate of 8,000 Hz8{,}000\,\text{Hz}8,000Hz gives 8,0008{,}0008,000 samples each second. A higher sampling rate can capture more rapid changes in the sound, including higher frequencies, but creates more data.
Each sample also needs a value to represent the signal’s amplitude, which relates to how strong the signal is. Sample resolution, also called bit depth, is the number of bits available for that value. With 888-bit resolution, a sample can have 28=2562^8=25628=256 possible values. With 161616-bit resolution, it can have 216=65,5362^{16}=65{,}536216=65,536 possible values. More values allow the amplitude to be represented more precisely, reducing the error introduced when a measurement is rounded to an available value.
On a graph of the sound wave, sampling rate controls how closely spaced the measurement points are along the time axis. Sample resolution controls how many levels are available for the height of each point. Both can affect sound quality, but they change different parts of the recording.
Worked example
For one second of mono sound at 8,000 Hz8{,}000\,\text{Hz}8,000Hz and 888-bit resolution, the uncompressed sample data uses:
8,000 samples×8 bits per sample=64,000 bits.8{,}000\ \text{samples} \times 8\ \text{bits per sample}=64{,}000\ \text{bits}.8,000 samples×8 bits per sample=64,000 bits.Doubling the sampling rate gives twice as many samples. Doubling the resolution uses twice as many bits per sample. Either change doubles the size of this uncompressed sample data, but for a different reason.
Exam mistake to avoid: Do not describe sample resolution as the number of samples taken each second. That is the sampling rate. Resolution describes the bits used for each sample.