intermediate

Digital Audio: Sampling, Bit Depth and Latency

Understand how sound becomes numbers: sample rate and the Nyquist limit, aliasing, bit depth and dynamic range, data rates and file sizes, clocks and word clock, converter headroom, buffer size and latency, and calculating digital audio numbers.

60 min

1. From waves to numbers

An analogue-to-digital converter (ADC) measures the voltage of the signal many times a second. Each measurement is a sample. A digital-to-analogue converter (DAC) turns the samples back into a smooth voltage. The method is called PCM (pulse-code modulation).

2. Sample rate and the Nyquist limit

The sample rate is how many samples per second. Common rates are 44.1 kHz (CD), 48 kHz (video and most live consoles) and 96 kHz. The highest frequency that can be captured is half the sample rate, the Nyquist limit: 22.05 kHz at 44.1 kHz and 24 kHz at 48 kHz. Human hearing reaches about 20 kHz, so 48 kHz is enough for live sound.

If a frequency above the Nyquist limit enters the converter, it folds back to a false lower frequency, called aliasing. Converters use steep filters before sampling to prevent it. The folded frequency for an input f at sample rate fs is: take f mod fs; if the result is above fs / 2, the alias is fs minus it.

3. Bit depth and dynamic range

Bit depth is how many bits describe each sample. More bits give finer steps and a lower noise floor. The theoretical dynamic range is about 6.02 x N + 1.76 dB for N bits: 16-bit gives about 98 dB, 24-bit about 146 dB (real converters achieve about 120 dB). Digital audio has a hard ceiling at 0 dBFS (full scale). A signal above it clips harshly, so unlike analogue there is no soft overload. Keep peaks around -18 to -6 dBFS.

4. Data rates and file sizes

Bit rate = sample rate x bit depth x channels. Stereo 48 kHz 24-bit is 48,000 x 24 x 2 = 2,304,000 bit/s, about 2.3 Mbit/s, or 17.3 MB per minute. A 32-channel recording at the same settings is about 36.9 Mbit/s, about 277 MB per minute, so recording a show needs fast disks.

5. Latency

Digital audio is processed in blocks (buffers). The delay of one buffer is samples / sample rate. A 64-sample buffer at 48 kHz is 1.33 ms. A digital console adds converter and processing delay too (typically 1 to 3 ms in total). For singers on in-ear monitors, keep the total round trip small; above roughly 10 ms they begin to hear their own voice as a delay.

6. Clocks

Every device converting audio needs a stable clock. Digital systems designate one clock master (word clock, AES3 or network clock such as Dante’s) and all others slave to it. Two devices on unrelated clocks slowly drift and cause clicks and dropouts.

7. Digital numbers in the shell

Lab: Nyquist, data rate and latency

Work out the Nyquist limit at 48 kHz, the data rate of a 32-channel 48 kHz 24-bit recording in megabits per second, the buffer latency of 128 samples and the dynamic range of 24-bit audio.

Objectives

  • Nyquist limit in hertz for a 48 kHz sample rate.
  • Data rate in megabits per second of 32 channels at 24 bit and 48 kHz.
  • Latency in milliseconds of one 128-sample buffer at 48 kHz.
  • Theoretical dynamic range of 24-bit audio in decibels.
Console - student@audio-pc:~$
Practice terminal: it checks the commands you type and shows example output. It is not connected to a real device.
Work through the objectives on the left.
Stuck? Type "?" to see the current objective, or "hint" to reveal the command.
student@audio-pc:~$

(The outputs above are examples of the format. Real output varies by software version and setup.)

8. On your bench

  1. Record a sine sweep at 48 kHz and look at the spectrum for aliasing artefacts.
  2. Calculate the data rate and disk space for a multitrack recording of your show.
  3. Set your interface buffer size to 64, 128 and 256 samples and compare latency.
  4. Check that every device in your system shows the same clock source and sample rate.
  5. Test headroom by feeding a tone until the converter reaches 0 dBFS and note the analogue level.

9. Hands-on lab: Sampling, aliasing, bit depth, data rate and latency

Nyquist, aliasing, dynamic range, data rate, file size, buffer latency and round trip — Python 3
WHAT TO DO
nyquist_hz(sample_rate_hz): the Nyquist limit in whole hertz: half the sample rate. alias_hz(freq_hz, sample_rate_hz): the frequency that a tone appears at after sampling, in whole hertz: take freq modulo the sample rate; if that is above half the sample rate, return the sample rate minus it, otherwise return it. dynamic_range_x10(bits): the theoretical dynamic range in tenths of a decibel, rounded to the nearest: (6.02 * bits + 1.76) * 10. bitrate_kbps(sample_rate_hz, bits, channels): the data rate in whole kilobits per second (1 kbit = 1000 bits), rounded to the nearest: rate * bits * channels / 1000. mb_per_minute_x10(sample_rate_hz, bits, channels): the size of one minute of audio in tenths of a megabyte (1 MB = 1,000,000 bytes), rounded to the nearest: rate * bits / 8 * channels * 60 / 1000000 * 10. buffer_latency_us(samples, sample_rate_hz): the delay of one buffer in whole microseconds, rounded to the nearest: samples / rate * 1,000,000. round_trip_us(buffer_samples, sample_rate_hz, converter_us): the round trip in whole microseconds: two buffers (input and output) plus the converter delay in us. Round the buffer part to the nearest microsecond before adding. can_reproduce(freq_hz, sample_rate_hz): True when the frequency is strictly below the Nyquist limit, otherwise False.
YOUR CODE (edit here, then press Run)
Ctrl/⌘ + Enter
OUTPUT

10. Common mistakes

Mistake Better
Thinking 96 kHz is always better for live sound 48 kHz is enough and keeps latency and data low
Letting two devices run on their own clocks Choose one clock master
Pushing digital peaks to 0 dBFS Hard clipping is harsh; leave headroom
Confusing bits and bytes in storage maths Divide bits by 8
Ignoring converter delay Buffer plus converter delay both add up
Mixing sample rates in one system Match sample rate on every device
Assuming 24-bit means 144 dB in real life Real converters reach about 120 dB

11. Key takeaways

  • Nyquist limit = half the sample rate; above it, tones alias.
  • Dynamic range = 6.02 x bits + 1.76 dB; 0 dBFS is a hard ceiling.
  • Bit rate = rate x bits x channels; do the maths before recording.
  • Latency = samples / rate per buffer, plus converter delay.
  • One clock master, everyone else follows.
How much disk space does a 90-minute show recorded on 32 channels at 48 kHz and 24 bit need?

Per minute: 48,000 x 3 bytes x 32 x 60 = 276.5 MB. For 90 minutes that is about 24.9 GB, so use a drive with at least 30 GB free, and a fast one to sustain about 4.6 MB per second.

Can You Explain It?

Close the lesson and answer these without looking back. The goal isn't the wording — it's whether you've formed a usable mental model.

  • Explain aliasing and why converters have an anti-alias filter.
  • Describe why digital clipping is worse than analogue overload.
  • Say how buffer size trades latency against stability.

🧪 Want to practise this on your own computer? See how to set up your lab →

🤖

Need clarification? Ask GT

Hi, I'm GT — your AI tutor for Digital Audio: Sampling, Bit Depth and Latency. What would you like to know?
📝

Knowledge Check

1 of 4

What is the Nyquist limit for a sample rate of 48 kHz?

Official References

Report a problem

About: /lessons/snd-digital-audio-sampling-bit-depth-and-latency