Sound Representation
Sound in the real world is an analogue, continuous signal. To store and process it on a computer, the signal is measured at regular intervals and converted into binary values. Two key factors are sampling rate and sample resolution (bit depth).
Learning Objectives
- 11.1.1.9 Describe the digital representation of sound in terms of sampling rate and resolution
- 11.1.1.10 Explain why analogue sound data needs to be converted to binary digits
- 11.1.1.11 Calculate the size of an audio data file
From Analogue Sound to Binary
The conversion process
- Sample: measure the amplitude of the analogue waveform at regular time intervals.
- Quantise: map each measurement to one of the available amplitude levels.
- Encode: represent the chosen level as a binary number.
Why convert analogue sound to binary?
Computer systems store, process and transmit data digitally. Converting the analogue waveform into binary sample values allows the sound to be stored in memory/files, processed by software, copied and transmitted using digital systems.
Sampling Rate
One measurement of the waveform amplitude at a particular moment.
The number of samples taken every second.
The unit used for samples per second; 1 kHz = 1000 samples per second.
Example
44.1 kHz
= 44,100 Hz
= 44,100 samples per second per channel| If sampling rate increases... | Effect |
|---|---|
| Samples per second | Increases |
| Time detail captured from the waveform | Can increase |
| Uncompressed file size | Increases if all other factors stay the same |
Extension: why sample fast enough?
If the sampling rate is too low, a digital recording may fail to represent high-frequency changes correctly. In more advanced study this is related to the Nyquist sampling rule and aliasing.
Sample Resolution / Bit Depth
Number of possible amplitude levels
= 2^(bit depth)Examples
3-bit sample resolution
= 2³
= 8 possible amplitude levels
8-bit sample resolution
= 2⁸
= 256 possible amplitude levels
16-bit sample resolution
= 2¹⁶
= 65,536 possible amplitude levels| If bit depth increases... | Effect |
|---|---|
| Possible amplitude levels | Increases |
| Size of quantisation steps | Decreases |
| Accuracy of amplitude representation | Can improve |
| Uncompressed file size | Increases if all other factors stay the same |
Sampling rate ≠ bit depth
Sampling rate describes how often measurements are taken. Bit depth / sample resolution describes how precisely each measurement's amplitude can be represented.
Mono and Stereo Channels
| Audio type | Channels | Effect on raw data size |
|---|---|---|
| Mono | 1 | One stream of samples |
| Stereo | 2 | Two streams of samples → twice the raw data of mono at the same settings |
Per channel
A sample rate of 44.1 kHz means 44,100 samples per second for each channel. Stereo therefore stores two sample values for every sampling instant.
Calculating Audio Data Size
size in bits
= sample rate × bit depth × number of channels × duration (seconds)1 44.1 kHz, 16-bit, stereo, 60 seconds
Sample rate = 44,100 samples/s
Bit depth = 16 bits/sample
Channels = 2
Duration = 60 s
Size in bits
= 44,100 × 16 × 2 × 60
= 84,672,000 bits
Size in bytes
= 84,672,000 ÷ 8
= 10,584,000 bytes
Size in MiB
= 10,584,000 ÷ 1024 ÷ 1024
≈ 10.09 MiB2 22.05 kHz, 8-bit, mono, 30 seconds
Size in bits
= 22,050 × 8 × 1 × 30
= 5,292,000 bits
Size in bytes
= 661,500 bytes
Size in KiB
= 661,500 ÷ 1024
≈ 646.0 KiBUnit conversion
This page uses 1024 bytes = 1 KiB and 1024 KiB = 1 MiB. If the exam gives a different conversion, use the conversion stated in the question.
Raw audio size vs real audio file size
The formula above calculates uncompressed sample data. Real files may include headers/metadata, and compressed formats such as MP3 or AAC can be much smaller. Use the assumptions stated in the question.
Quality–Storage Trade-off
| Change | Possible benefit | Cost |
|---|---|---|
| Increase sample rate | More frequent measurements / more time detail | More samples to store |
| Increase bit depth | More amplitude levels / smaller quantisation steps | More bits for every sample |
| Use stereo instead of mono | Separate left and right channels | Twice as many sample values at the same settings |
Interactive Labs
1. Sampling Rate Challenge
2. Bit Depth Challenge
3. Audio Size Calculator
4. Predict the Effect
Common Pitfalls
Confusing sampling rate and bit depth
Sampling rate = samples per second. Bit depth = bits used for each sample value.
Forgetting the number of channels
Stereo uses two channels, so the raw data size is twice that of mono at identical sample rate, bit depth and duration.
Using kHz as though it were Hz
44.1 kHz = 44,100 Hz, not 44.1 samples per second.
Forgetting bits → bytes
The formula gives bits. Divide by 8 to obtain bytes.
Comparing the formula directly with an MP3 file
The basic formula describes uncompressed sample data; compressed audio uses a different storage model.
Graded Tasks
Define sampling rate and sample resolution / bit depth.
Explain why analogue sound needs to be converted to binary before it can be stored and processed by a computer.
Convert 48 kHz into samples per second.
Calculate the number of possible amplitude levels for 8-bit and 16-bit sample resolution.
Explain the effect of increasing sampling rate while keeping all other settings unchanged.
Explain the effect of increasing sample resolution while keeping all other settings unchanged.
Calculate the uncompressed size in bytes of 10 seconds of 8 kHz, 8-bit, mono audio.
Compare 44.1 kHz, 16-bit mono with 44.1 kHz, 16-bit stereo for the same duration. Explain the effect on stored data size.
Exam Practice
Q1: Describe the terms sampling rate and sample resolution. [2]
Reveal marking points
Q2: Explain why analogue sound is converted into binary data for use in a computer system. [2]
Reveal marking points
Q3: A recording uses a sampling rate of 20 kHz and 8-bit sample resolution. It is mono and lasts 5 seconds. Calculate the size in bytes. [3]
Reveal marking points
Q4: A mono recording and a stereo recording use the same sample rate, bit depth and duration. Explain the difference in uncompressed data size. [2]