Speech & Audio AI Lab

Interactive labs for speech recognition, speech synthesis, and audio in general: in-browser DSP experiments, algorithms, datasets, and a learning path, without storing any recording.

43experiments

Bit Depth

Bit Depth

Beginner9 minStage 1

Learning Objectives

  • Compute the number of levels from the bit depth
  • Estimate the theoretical dynamic range in decibels
  • Distinguish between integer and floating-point values in files

Bit depth is the number of bits used to represent each sample, and it determines the number of quantization levels $2^{B}$. A depth of 8 bits gives 256 levels, a depth of 16 bits gives 65,536 levels, and a depth of 24 bits gives 16,777,216 levels.

Each additional bit doubles the number of levels and improves the signal-to-quantization-noise ratio by about 6 decibels. The well-known theoretical relation for a full-scale sinusoid is $\mathrm{SQNR}\approx 6.02B+1.76\ \text{dB}$. Applying it to 16 bits gives about 98 decibels, and to 8 bits about 50 decibels.

In integer files (PCM Integer), the values are integers between $-2^{B-1}$ and $2^{B-1}-1$, for example from $-32768$ to $32767$ at 16 bits. Floating-point files (Float 32) usually store values between $-1$ and $1$. When reading a 16-bit file in a library such as `soundfile`, you get floating-point numbers by default after division by 32768.

The practical takeaway: 16 bits are sufficient for most speech tasks, and greater depth is useful in professional recording and intermediate processing. During processing, take care to avoid clipping, which occurs when the permitted range is exceeded. And increasing the bit depth after recording cannot restore information that was lost in the original quantization.

Audio processing in the experiments takes place inside your browser. Audio, texts, and conversations are not saved on the server. Privacy Policy