Sound: Sampling and File Size
From Sound Waves to Digital Data
Sound in the real world is an analogue signal — a continuous wave of air pressure that varies smoothly over time. Computers can only store discrete binary values, so to record sound digitally, the continuous wave must be converted into a series of snapshots. This process is called sampling.
An analogue-to-digital converter (ADC) is the hardware component that performs sampling. It reads the amplitude (height) of the sound wave at a fixed rate and stores each reading as a binary number. On playback, a digital-to-analogue converter (DAC) reconstructs the wave from those stored numbers. The reconstructed wave is an approximation — how close it is to the original depends on how often measurements are taken and how precisely each one is stored.
Sample Rate (Sampling Frequency)
The sample rate (or sampling frequency) is the number of samples taken every second, measured in hertz (Hz). A sample rate of 44,100 Hz (44.1 kHz) means 44,100 measurements are recorded every second — this is the standard for CD-quality audio.
A higher sample rate captures more of the original wave shape, which means the reconstructed audio sounds closer to the original. Low sample rates — say 8,000 Hz used in some telephone systems — make audio sound “tinny” or robotic because the measurements are too sparse to faithfully reproduce high frequencies.
CD-quality audio uses a sample rate of 44,100 Hz and a bit depth of 16 bits per sample. Common sample rates to know: 8,000 Hz (telephone), 22,050 Hz (radio quality), 44,100 Hz (CD audio), 48,000 Hz (professional video). Higher rates mean better quality but larger file sizes.
Bit Depth (Sample Resolution)
Each sample is stored as a binary number. The bit depth (also called sample resolution) determines how many bits are used for each measurement. More bits means more possible amplitude values:
- 8-bit — \(2^8 = 256\) possible amplitude levels. Sufficient for voice recording but noticeably “hissy”.
- 16-bit — \(2^{16} = 65{,}536\) amplitude levels. Standard for CD audio.
- 24-bit — \(2^{24} \approx 16.7\) million levels. Used in professional studio recording.
A higher bit depth reduces quantisation error — the difference between the actual analogue amplitude and the nearest stored value. With only 8 bits, the “staircase” approximation is quite coarse; with 16 bits it is so fine the ear cannot detect the steps.
Calculating Sound File Size
The formula for the uncompressed size of a digital audio file is:
File size (bits) = sample rate (Hz) × bit depth (bits) × number of channels × duration (seconds)
Divide by 8 to get bytes, then by 1024 to get kilobytes, and so on. Number of channels is 1 for mono and 2 for stereo. Stereo doubles the file size compared to mono because two separate streams of samples are recorded simultaneously.
A 3-minute stereo recording at CD quality (44,100 Hz sample rate, 16-bit depth). Calculate the uncompressed file size in megabytes.
Step 1: Convert duration to seconds: 3 × 60 = 180 seconds.
Step 2: Total bits = 44,100 × 16 × 2 (stereo) × 180 = 254,016,000 bits.
Step 3: Bytes = 254,016,000 ÷ 8 = 31,752,000 bytes.
Step 4: Kilobytes = 31,752,000 ÷ 1024 = 31,007.8 KB.
Step 5: Megabytes = 31,007.8 ÷ 1024 = 30.3 MB (approximately).
An MP3 file of the same track might be around 3–5 MB — lossy compression reduces it to roughly one-tenth the size, at the cost of some quality.
The two key variables that affect audio quality are sample rate (how often per second the wave is measured) and bit depth (how precisely each measurement is stored). Increasing either improves quality but increases file size proportionally. A stereo file is always twice the size of the equivalent mono file.
Misconception 1: “Sample rate and bit depth are the same thing.” — They are not. Sample rate is how often per second a measurement is taken (Hz). Bit depth is how precisely each individual measurement is stored (bits). They are independent: you could have a high sample rate with a low bit depth, or vice versa.
Misconception 2: “Stereo doubles the quality.” — Stereo doubles the file size by recording two channels simultaneously (left and right speaker). Quality (how faithfully the sound is captured per channel) is set by the sample rate and bit depth, which are the same for both channels.
Misconception 3: “Higher sample rate always sounds better.” — Human hearing tops out at around 20,000 Hz. The Nyquist theorem states that a sample rate of at least twice the highest frequency is needed to reproduce it. At 44,100 Hz, all frequencies up to around 22,050 Hz can be captured — above the human hearing limit. Increasing further has diminishing returns for human listeners.