Representing sound: sampling rate and bit depth

Cambridge IGCSE Computer Science (0478) · lesson 7 of 35 · 25 min

Analogue vs Digital Sound

Sound is a continuous (analogue) wave — air pressure varying smoothly over time. Computers can only store discrete (digital) values, so we must sample the analogue wave at regular intervals and store each sample as a binary number.

This process is called Analogue-to-Digital Conversion (ADC). The reverse — converting stored digital values back to sound — is Digital-to-Analogue Conversion (DAC), performed by your speakers or headphones.

Sampling Rate and Bit Depth

CD quality audio: 44,100 Hz sampling rate, 16-bit depth, stereo (2 channels).

Nyquist theorem: To accurately reproduce a sound, the sampling rate must be at least twice the highest frequency in the sound. Human hearing tops out at ~20,000 Hz, so 44,100 Hz is sufficient.

Calculating Audio File Size

File size (bits) = sampling rate × bit depth × channels × duration (seconds)

Worked Example

Calculate the size of 3 minutes of CD-quality stereo audio

Sampling rate = 44,100 Hz, bit depth = 16, channels = 2, duration = 180 s

Bits = 44,100 × 16 × 2 × 180 = 254,016,000 bits

Bytes = 254,016,000 ÷ 8 = 31,752,000 bytes

≈ 30.3 MB uncompressed

(MP3 compression reduces this to ~3–4 MB)

What is the sampling rate of CD-quality audio?

  • 22,050 Hz
  • 44,100 Hz
  • 48,000 Hz
  • 96,000 Hz

Answer: 44,100 Hz
CD standard is 44,100 samples per second.

Increasing bit depth from 8 to 16 will:

  • Double the sampling rate
  • Double the file size
  • Halve the file size
  • Have no effect on quality
  • Answer: 1

File size is proportional to bit depth; 16-bit uses twice the storage of 8-bit. According to the Nyquist theorem, to record sound up to 20,000 Hz you need a sampling rate of at least:

  • 10,000 Hz
  • 20,000 Hz
  • 40,000 Hz
  • 80,000 Hz
  • Answer: 2

Nyquist: sampling rate ≥ 2 × maximum frequency = 40,000 Hz.


Previous lesson: Representing images: pixels, resolution, colour depth
Back to Cambridge IGCSE Computer Science (0478)
Next lesson: Data compression: lossy vs lossless