8.2 Digital Audio Sampling, Bit Depth, and Audio File Formats

Key Takeaways

  • The Nyquist-Shannon Sampling Theorem dictates that accurately digitizing and reconstructing an analog signal requires a sampling rate at least twice the highest frequency component present ($f_s \ge 2 \times f_{\max}$).
  • Sampling rate defines the reproducible frequency bandwidth, whereas bit depth establishes amplitude quantization resolution and dynamic range (approximately 6 dB per bit, yielding 96 dB for 16-bit and 144 dB for 24-bit).
  • Frequencies exceeding the Nyquist frequency ($f_s / 2$) fold back into the audible spectrum as dissonant aliasing artifacts, requiring analog anti-aliasing low-pass filters prior to Analog-to-Digital Conversion.
  • Uncompressed audio is formatted as linear Pulse Code Modulation (PCM) in WAV or AIFF containers, while lossless codecs (FLAC, ALAC) compress data by ~50% without sample loss, and lossy codecs (MP3, AAC, Opus) discard psychoacoustically masked data.
  • Uncompressed PCM file size is calculated as: File Size (bytes) = (Sample Rate in Hz × Bit Depth × Channels × Time in seconds) / 8.
Last updated: September 2026

8.2 Digital Audio Sampling, Bit Depth, and Audio File Formats

Digital audio engineering bridges continuous physical acoustics and discrete binary computation. Understanding how continuous electrical voltages are transformed into numerical bitstreams enables media educators and technicians to select appropriate recording settings, avoid digital distortion artifacts, and manage storage budgets across instructional projects.


Analog-to-Digital Conversion (ADC) and Digital-to-Analog Conversion (DAC)

In the physical realm, sound manifests as a continuous, infinitely variable voltage generated by a microphone transducer. A computer cannot process continuous analog curves directly; it can only store finite binary numbers (0s and 1s).

[ Analog Acoustic Wave ] 
           │
           ▼
[ Analog Anti-Aliasing Low-Pass Filter ]  (Removes frequencies > Nyquist)
           │
           ▼
[ Sample-and-Hold Circuit ]               (Measures voltage at discrete time intervals fs)
           │
           ▼
[ Quantizer ]                             (Snaps voltage to nearest discrete binary value)
           │
           ▼
[ Binary Pulse Code Modulation Bitstream ] ---> [ Storage / DAW Processing ]

The ADC Conversion Pipeline

  1. Anti-Aliasing Filtration: The incoming analog signal passes through a steep analog low-pass filter (brickwall filter) to remove all acoustic frequencies exceeding half the digital sampling rate.
  2. Sampling (Sample-and-Hold): An electronic circuit measures the instantaneous voltage of the analog signal at precise, unvarying time intervals governed by a high-precision quartz master clock. The voltage is captured and held stable during the measurement window.
  3. Quantization: The measured continuous voltage is mapped to the nearest available discrete numerical level permitted by the system's binary bit depth.
  4. Binary Encoding: The quantized values are converted into binary numbers, outputting an uncompressed digital audio bitstream.

The DAC Reconstruction Pipeline

To play digital audio back through monitor speakers or headphones, a Digital-to-Analog Converter (DAC) executes the reverse operation. The DAC reads binary numerical words at the system sampling rate, converting each value into a corresponding electrical voltage step. This creates a stepped, stair-cased electrical waveform. The signal then passes through an analog reconstruction low-pass filter (smoothing filter) that strips away high-frequency sampling images, restoring a smooth, continuous analog voltage wave.


Pulse Code Modulation (PCM) Architecture

Pulse Code Modulation (PCM) is the foundational architecture of uncompressed digital audio in modern computing. In a linear PCM stream, the continuous analog signal is represented directly by a sequence of coded binary words indicating instantaneous amplitude values at regular time slices. PCM audio undergoes no mathematical data compression, preserving the complete digitized waveform without perceptual degradation. Linear PCM serves as the raw internal data format within Digital Audio Workstations, Compact Discs, and uncompressed audio containers such as WAV and AIFF.


Sampling Rate and the Nyquist-Shannon Sampling Theorem

The Sampling Rate ($f_s$) is the number of discrete digital snapshots captured per second, expressed in Hertz (Hz) or kilohertz (kHz). While bit depth dictates amplitude resolution (the vertical axis), the sampling rate dictates temporal resolution and the reproducible frequency bandwidth (the horizontal axis).

Continuous Analog Curve:      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Digital Samples (fs snapshots/s):   *     *     *     *     *     * 
                                   |     |     |     |     |     |
Discrete Time Intervals:          t0    t1    t2    t3    t4    t5

The Nyquist-Shannon Theorem

Formulated by Harry Nyquist and mathematically proven by Claude Shannon, the Nyquist-Shannon Sampling Theorem establishes the fundamental mathematical criterion for lossless signal digitization:

fs≥2×fmax⁡f_s \ge 2 \times f_{\max}

To completely capture and accurately reconstruct a band-limited analog signal without informational loss or distortion, the digital sampling rate must be at least twice the highest frequency component present within the analog input signal.

The Nyquist Frequency

The theoretical upper limit of audio frequencies that can be reproduced by a digital system operating at a given sampling rate is known as the Nyquist Frequency ($f_N$):

fN=fs/2f_N = f_s / 2

Any frequency below the Nyquist threshold can be completely captured and reconstructed into a smooth analog wave without harmonic alteration.

Aliasing Artifacts and Foldover Distortion

If an analog signal enters an Analog-to-Digital Converter containing frequency components that exceed the Nyquist frequency ($f_{\text{input}} > f_N$), the converter cannot capture enough sample points per cycle to define the waveform. Instead of simply disappearing, the undersampled high frequency folds over the Nyquist cutoff and reflects back into the audible spectrum as an inharmonic, highly discordant phantom frequency:

falias=∣fs−finput∣f_{\text{alias}} = |f_s - f_{\text{input}}|

For example, consider an ADC operating at the standard Audio CD sampling rate of 44.1 kHz, yielding a Nyquist frequency of 22.05 kHz. If an ultrasonic signal of 26 kHz enters the converter without filtration:

falias=∣44,100 Hz−26,000 Hz∣=18,100 Hz=18.1 kHzf_{\text{alias}} = |44,100\text{ Hz} - 26,000\text{ Hz}| = 18,100\text{ Hz} = 18.1\text{ kHz}

The inaudible 26 kHz ultrasonic tone reappears as an audible, harsh metallic squeal at 18.1 kHz. Because aliasing artifacts are inharmonic (not mathematically related to the musical notes performed), they cannot be removed via postproduction EQ. To prevent aliasing, converters employ steep anti-aliasing low-pass filters that eliminate all frequencies above $f_N$ before the sampling stage.

Industry Standard Sampling Rates

  • 44.1 kHz (Audio CD Standard): Standardized in 1980 by Sony and Philips for the Red Book Compact Disc. Because human hearing extends to 20 kHz, the Nyquist minimum is 2 × 20 kHz = 40 kHz. The extra 4.1 kHz provides a transition band (from 20.0 kHz to 22.05 kHz) allowing analog brickwall filters to roll off without causing phase distortion in the audible band. Historically, 44.1 kHz was also selected because it aligned with both NTSC (29.97 fps) and PAL (25 fps) U-matic video tape PCM recording adapters (storing 3 audio sample pairs per video line).
  • 48 kHz (Professional Video and Cinema Standard): The global standard for television broadcast (ATSC), cinema sound, digital video recording, and DVD/Blu-ray media. The 48 kHz rate synchronizes cleanly with video frame rates: exactly 2,000 audio samples per frame at 24 fps, 1,600 samples per frame at 30 fps, and 800 samples per frame at 60 fps.
  • 96 kHz and 192 kHz (High-Resolution Studio Mastering): Common in professional studio tracking, sound design, and archiving. While humans cannot hear frequencies above 20 kHz, oversampling provides a transition band spanning dozens of kilohertz, allowing gentle, phase-linear digital reconstruction filters. Furthermore, recording at 96 kHz allows extreme time-stretching and pitch-shifting in postproduction without pushing high-frequency processing artifacts into the audible band.

Bit Depth, Dynamic Range, and Quantization

While the sampling rate dictates frequency bandwidth along the time axis, Bit Depth dictates amplitude resolution along the vertical voltage axis.

Vertical Axis (Bit Depth):        Quantization Levels
    0 dBFS (Maximum Digital Level)   11111111 (Level 255 for 8-bit)
                                     11111110 (Level 254)
                                     ...
                                     10000000 (Zero Crossing / Reference)
                                     ...
  -96 dBFS (16-bit Floor)            00000001 (Level 1)
                                     00000000 (Level 0)

Discrete Amplitude Quantization Levels

Bit depth represents the number of binary bits allocated to encode the amplitude value of each individual sample snapshot. An $N$-bit system provides $2^N$ discrete numerical steps:

  • 8-bit Audio: 2^8 = 256 discrete amplitude steps.
  • 16-bit Audio: 2^16 = 65,536 discrete amplitude steps.
  • 24-bit Audio: 2^24 = 16,777,216 discrete amplitude steps.
  • 32-bit Floating-Point Audio: Uses a sign, exponent, and significand to represent an enormous numerical range. Floating-point DAW buses can preserve values above 0 dBFS for later gain reduction, but analog converters, fixed-point stages, plugins, and final exports can still clip; the format does not make an entire recording chain unclippable.

Dynamic Range Formula

Dynamic Range is the ratio between the loudest undistorted peak signal a system can accommodate (0 dBFS) and the quietest signal detectable above the system's internal noise floor, expressed in decibels. The mathematical relationship between bit depth and dynamic range is:

Dynamic Range≈6.02×N dB\text{Dynamic Range} \approx 6.02 \times N\text{ dB}

Every additional bit of depth provides approximately 6 dB of additional dynamic range:

  • 16-bit System: 16 × 6.02 ≈ 96.3 dB of dynamic range.
  • 24-bit System: 24 × 6.02 ≈ 144.5 dB of dynamic range.

16-Bit vs. 24-Bit in Production

While 16-bit audio provides sufficient dynamic range (96 dB) for commercial playback on Compact Discs, it is restrictive during multitrack recording. If a vocalist is recorded at conservative input levels to avoid clipping unexpected spikes, the signal utilizes only 10 to 12 of the available 16 bits, pushing quiet passages close to the digital noise floor.

In theory, integer 24-bit PCM has about 144 dB of quantization dynamic range. Real converters and analog electronics achieve less because their own noise and distortion dominate the least significant bits. Even so, the extra resolution relative to 16-bit delivery formats lets engineers record conservative nominal levels, often around −18 to −12 dBFS, while keeping quantization noise well below the analog noise floor.

Quantization Error and Dithering

  • Quantization Error: When an analog voltage falls between two discrete binary quantization levels, the quantizer rounds the value to the nearest integer. This rounding discrepancy—quantization error—manifests in low-amplitude signals as correlated, harsh harmonic distortion ("quantization distortion").
  • Dithering: When down-converting a high-resolution 24-bit audio file to a 16-bit distribution master, simply truncating the lowest 8 bits generates audible quantization distortion on quiet passages and reverb tails. Dither is the intentional addition of an extremely low-level, un-correlated pseudo-random noise signal (typically shaped triangular dither at the level of the least significant bit) prior to bit reduction. Dithering decorrelates the quantization error from the audio waveform, converting harsh harmonic distortion into a smooth, benign, imperceptible analog-style noise floor.

Digital Audio File Formats

Digital audio file formats are categorized into uncompressed, lossless compressed, and lossy compressed containers.

1. Uncompressed Audio Formats

  • WAV (Waveform Audio File Format): Developed by Microsoft and IBM, WAV is based on the RIFF (Resource Interchange File Format) container architecture. It encapsulates raw, uncompressed linear PCM audio. It is universally compatible across Windows, macOS, and Linux, serving as the standard working format in Digital Audio Workstations.
  • Broadcast WAV (BWF): An extension of standard WAV established by the European Broadcasting Union (EBU). BWF incorporates a specialized bext (Broadcast Extension) metadata chunk containing timecode position timestamps, scene/take information, and author metadata. This enables non-linear video editing software to automatically sync audio clips to timeline timecode.
  • AIFF (Audio Interchange File Format): Developed by Apple Computer in 1988, based on Electronic Arts IFF. Like WAV, AIFF stores raw uncompressed linear PCM audio without quality loss. Supported natively across Apple environments.

2. Lossless Compressed Formats

Lossless compression algorithms reduce audio file sizes without discarding a single bit of acoustic data. When decompressed during playback, the audio stream is bit-for-bit identical to the uncompressed PCM original.

  • FLAC (Free Lossless Audio Codec): An open-source, royalty-free codec. FLAC utilizes linear predictive analysis and Rice entropy coding to compress PCM audio file sizes by 40% to 60%. Widely adopted for digital audio archiving and high-resolution music distribution.
  • ALAC (Apple Lossless Audio Codec): Apple's proprietary lossless codec (open-sourced in 2011), packaged within the .m4a container. Delivers compression ratios comparable to FLAC; supported across iOS and macOS ecosystems.

3. Lossy Compressed Formats

Lossy audio compression achieves substantial file size reductions (typically 80% to 90%) by discarding audio data that human hearing cannot perceive, grounded in the science of psychoacoustics:

  • Psychoacoustic Masking Principles:
    • Simultaneous Frequency Masking: A high-amplitude sound at a specific frequency renders quiet adjacent frequencies inaudible to the human ear.
    • Temporal Masking: A loud transient sound masks quieter sounds that occur immediately before (pre-masking, ≈ 5 ms) and immediately after (post-masking, ≈ 50 to 100 ms) the transient event.
    • Lossy encoders analyze audio using Modified Discrete Cosine Transforms (MDCT) and strip away sounds falling beneath the dynamic psychoacoustic masking threshold.
  • MP3 (MPEG-1 Audio Layer III): Introduced in 1993 by the Fraunhofer Institute. Compresses audio to data rates typically between 128 kbps and 320 kbps. Highly compatible across legacy hardware, but its older transform filters can introduce pre-echo artifacts and smearing on sharp percussive transients.
  • AAC (Advanced Audio Coding): Standardized under MPEG-2 and MPEG-4; designed as the direct technical successor to MP3. Employs 1024-point MDCT filter banks (compared to MP3's 576), improved temporal noise shaping, and superior coding efficiency. Delivers noticeably higher acoustic fidelity than MP3 at identical bitrates (e.g., 256 kbps AAC matches or exceeds 320 kbps MP3); standard audio codec for YouTube, Apple Music, and mobile streaming.
  • OGG Vorbis: A patent-free, open-source lossy audio format maintained by Xiph.Org. Provides fidelity superior to MP3 at low-to-medium bitrates; heavily utilized in video game engines (Unity, Unreal) and streaming platforms (Spotify).

Calculating Raw Uncompressed Audio File Size

Calculating the storage footprint of uncompressed PCM audio requires calculating the product of sampling rate, bit depth, channel count, and duration:

File Size (bytes)=Sample Rate (Hz)×Bit Depth (bits)×Channels×Duration (seconds)8\text{File Size (bytes)} = \frac{\text{Sample Rate (Hz)} \times \text{Bit Depth (bits)} \times \text{Channels} \times \text{Duration (seconds)}}{8}

  • Sample Rate (Hz): Snapshots per second (e.g., 44,100 or 48,000).
  • Bit Depth / 8: Converts bits per sample into bytes (16-bit = 2 bytes; 24-bit = 3 bytes).
  • Channels: Monophonic = 1; Stereophonic = 2; 5.1 Surround Sound = 6.
  • Duration: Total running time converted into seconds (minutes × 60).

Step-by-Step Worked Calculation Example

Problem: Calculate the raw uncompressed file size in megabytes (MB) of a 5-minute stereophonic studio recording captured at 24-bit / 48 kHz.

  1. Identify the Given Variables:

    • Sample Rate = 48,000 Hz
    • Bit Depth = 24 bits (24 / 8 = 3 bytes per sample)
    • Channels = 2 (stereo)
    • Duration = 5 minutes × 60 seconds/minute = 300 seconds
  2. Calculate Total Bytes: Bytes=48,000×3×2×300\text{Bytes} = 48,000 \times 3 \times 2 \times 300 Bytes=144,000×2×300=288,000×300=86,400,000 bytes\text{Bytes} = 144,000 \times 2 \times 300 = 288,000 \times 300 = 86,400,000\text{ bytes}

  3. Convert Bytes to Megabytes:

    • Decimal System (SI / Base 10, standard for drive storage): Size=86,400,000 bytes1,000,000=86.4 MB\text{Size} = \frac{86,400,000\text{ bytes}}{1,000,000} = 86.4\text{ MB}
    • Binary System (IEC / Base 2, mebibytes, standard in OS file explorers): Size=86,400,000 bytes1,024×1,024=86,400,0001,048,576≈82.40 MiB\text{Size} = \frac{86,400,000\text{ bytes}}{1,024 \times 1,024} = \frac{86,400,000}{1,048,576} \approx 82.40\text{ MiB}

Audio Sampling Rates, Bit Depths, and Formats Comparison Matrix

Specification / FormatTechnical ClassificationBit Depth & Sample RateDynamic Range / BitrateCompression TypePrimary Industry Use Case
Audio CD (Red Book)Uncompressed Linear PCM16-bit / 44.1 kHz96 dB / 1,411 kbpsNone (Raw PCM)Commercial music CD distribution
Broadcast WAV (BWF)Uncompressed Linear PCM24-bit / 48 kHz144 dB / 2,304 kbpsNone (RIFF container with bext timecode)Film, television, broadcast video, commercial audio mixing
High-Resolution MasterUncompressed Linear PCM24-bit / 96 kHz or 192 kHz144 dB / 4,608 to 9,216 kbpsNone (Raw PCM)High-end studio mastering, sound design time-stretching, archival
FLACLossless Compressed16-bit or 24-bit / up to 192 kHzUp to 144 dB / ~600–1,200 kbpsLossless (~50% size reduction via linear prediction)Audiophile music distribution, digital audio archiving
AAC (MPEG-4)Lossy PerceptualAccepts PCM input at supported sample rates; decoded output is PCMCommon delivery rates vary by profile and useLossy transform coding and psychoacoustic maskingWeb/media streaming and mobile playback
MP3 (MPEG-1/2 Audio Layer III)Lossy PerceptualSupports defined MPEG sample rates; decoded output is PCMCommon music delivery rates include 128–320 kbpsLossy hybrid filter-bank/MDCT codingLegacy media playback, downloads, and podcasts
OpusLossy PerceptualFull-band / up to 48 kHzPsychoacoustic / 6–510 kbpsLossy (Hybrid SILK / CELT algorithms)WebRTC real-time voice, WebM web video, Discord, interactive streaming
Test Your Knowledge

An ideal band-limited audio signal contains frequencies up to 22 kHz. Which option represents twice that highest frequency—the theoretical Nyquist boundary used in basic sampling calculations?

A
B
C
D
Test Your Knowledge

Why is 24-bit integer PCM commonly preferred over 16-bit PCM while tracking and mixing, even though real converters do not achieve the full theoretical range?

A
B
C
D
Test Your Knowledge

Before exporting a finalized 24-bit / 48 kHz studio multitrack mix to a 16-bit / 44.1 kHz audio file for distribution, an audio engineer applies dithering. What is the primary technical function of dithering in this workflow?

A
B
C
D