Uncompressed PCM vs Lossless FLAC vs Psychoacoustic MP3/AAC
Every recorded musical sound—from the delicate resonance of a concert grand piano to the explosive transient of a titanium snare drum—enters the digital realm as a stream of raw numbers. However, how those numbers are stored, transmitted over the internet, and decoded by consumer playback devices involves a fundamental technological tension between uncompressed mathematical purity, lossless algorithmic efficiency, and lossy psychoacoustic approximation.
Today, music listeners and audio engineers interact with a dizzying variety of audio formats: WAV, AIFF, FLAC, ALAC, MP3, AAC, and Opus. Yet widespread misconceptions persist across music production: Does FLAC sound worse than WAV? Why do high-bitrate MP3s sound dull and "swishy" on cymbals? And why do lossy files cause clipping when transcoded for streaming platforms? This comprehensive engineering guide explains the exact data architectures, linear predictive coding algorithms, and psychoacoustic masking models behind digital audio compression.
1. The Compression Taxonomy: Three Digital Paradigms
All digital audio formats belong to one of three distinct technological categories:
- Uncompressed Linear PCM (WAV, AIFF): The raw, bit-for-bit electrical voltage measurements captured by an Analog-to-Digital Converter, stored in structured container files without any compression. Zero CPU decoding overhead, but maximum file size.
- Lossless Audio Compression (FLAC, ALAC, WavPack): Specialized audio entropy encoding algorithms that reduce file sizes by 40% to 60% while guaranteeing 100% bit-for-bit mathematical identity upon decompression. Not a single sample or micro-detail is altered.
- Lossy Perceptual Codecs (MP3, AAC, Ogg Vorbis, Opus): Perceptual encoding algorithms that discard massive amounts of acoustic information (achieving 70% to 90% file size reductions) using mathematical models of human ear physiology and psychoacoustic masking. The original data cannot be reconstructed.
2. Uncompressed Linear PCM: The Raw Soundstream (WAV & AIFF)
Pulse Code Modulation (PCM) is the foundational digital representation of analog audio. In linear PCM, the amplitude of the continuous analog sound wave is sampled at uniform time intervals (the sample rate, \(f_s\)) and quantized into discrete binary integers (the bit depth, \(B\)).
Calculating Linear PCM Bitrates & File Sizes
The uncompressed bitstream data rate is calculated by multiplying the three recording parameters:
Evaluating this formula across standard production formats:
- Standard CD Quality (16-bit / 44.1 kHz Stereo): $$\text{Bitrate} = 44,100 \times 16 \times 2 = \mathbf{1{,}411.2\text{ kbps}} \quad (\approx 10.58\text{ MB per minute})$$
- Studio Tracking Standard (24-bit / 48 kHz Stereo): $$\text{Bitrate} = 48,000 \times 24 \times 2 = \mathbf{2{,}304.0\text{ kbps}} \quad (\approx 17.28\text{ MB per minute})$$
- High-Resolution Audiophile (24-bit / 96 kHz Stereo): $$\text{Bitrate} = 96,000 \times 24 \times 2 = \mathbf{4{,}608.0\text{ kbps}} \quad (\approx 34.56\text{ MB per minute})$$
WAV (RIFF) vs. AIFF (IFF) Containers
WAV and AIFF are not audio compression formats; they are header wrapper containers for storing raw PCM audio:
- WAV (Resource Interchange File Format - RIFF): Developed by Microsoft and IBM in 1991. It stores multi-byte binary integers in little-endian byte order (least significant byte first), matching the native architecture of x86 Intel and AMD processors.
- AIFF (Audio Interchange File Format - IFF): Developed by Apple in 1988 for Motorola 68000 microprocessors. It stores data in big-endian byte order. Today, modern computers read both formats transparently with zero sonic difference.
- The 4 GB File Size Limit: Because standard 32-bit RIFF chunk headers use a 32-bit unsigned integer to track byte lengths, standard WAV files cannot exceed \(2^{32} - 1 \text{ bytes} \approx \mathbf{4.29\text{ Gigabytes}}\). For multi-track film recordings or live concert sets, professional DAWs use RF64 (64-bit WAV), which extends the file size ceiling to 16 Exabytes.
3. Lossless Compression: Inside the FLAC Algorithm
Many musicians ask: If ZIP files compress documents, why not just ZIP audio files? Generic compression algorithms (like ZIP, RAR, or GZIP) rely on Lempel-Ziv dictionary algorithms that look for repeating identical character strings. In digital audio, thermal noise and complex harmonic vibrations ensure that identical multi-byte sequences virtually never repeat. Compressing a WAV file with ZIP typically yields an embarrassing 2% to 4% size reduction.
In 2001, Josh Coalson developed FLAC (Free Lossless Audio Codec), an open-source format engineered specifically around the mathematical physics of acoustic sound waves. FLAC achieves 40% to 60% file size reductions using a four-stage digital pipeline:
- Block Partitioning: The incoming PCM stream is broken into discrete frames of 1,152 to 4,096 samples.
- Interchannel Decorrelation: In stereo music, the left and right channels are heavily correlated (sound centered in the mix is identical in both channels). FLAC converts L/R into Mid and Side channels (\(M = (L+R)/2\), \(S = L-R\)). Because the Side channel contains only tiny difference values, its amplitude is minute, requiring far fewer binary bits to encode!
- Linear Predictive Coding (LPC): Because sound waves oscillate smoothly, past audio samples can be used to predict the value of upcoming samples. An auto-regressive FIR filter calculates a mathematical prediction \(\hat{x}[n]\): $$\hat{x}[n] = \sum_{i=1}^p a_i \cdot x[n-i]$$ FLAC subtracts this prediction from the true audio sample, generating a residual error signal \(e[n] = x[n] - \hat{x}[n]\). Because the prediction is remarkably accurate, the residual error values hover close to zero!
- Rice / Golomb Entropy Coding: Rather than allocating fixed 16 or 24-bit slots for numbers, Rice coding uses variable-length binary codes—encoding tiny numbers with just 2 or 3 bits.
When a FLAC file is decompressed during playback, the decoding algorithm adds the Rice-decoded residual errors back to the LPC prediction. The resulting output is 100% mathematically identical to the original uncompressed WAV file down to the exact bit. MD5 checksums verify that not a single bit of acoustic information is lost.
4. Lossy Psychoacoustic Codecs: MP3 & AAC
While lossless codecs save 50% bandwidth, transmitting audio over early cellular networks and streaming to billions of mobile devices required 80% to 90% data reductions. To achieve bitrates of 128 kbps to 320 kbps, lossy codecs discard vast amounts of audio information.
However, lossy codecs do not discard sound randomly. They rely on the Modified Discrete Cosine Transform (MDCT) combined with computational Psychoacoustic Masking Models that mimic the biological limitations of the human auditory system.
1. Simultaneous Frequency Masking
The human inner ear (cochlea) acts as a mechanical frequency analyzer. When a loud pure tone is sounded (such as an 80 dB SPL trumpet note at 1,000 Hz), it creates a physical fluid wave along the basilar membrane. This wave mechanically overwhelms adjacent hair cells. As a result, any quiet sounds (such as a 35 dB SPL acoustic guitar harmonic at 950 Hz or 1,050 Hz) are completely imperceptible to human consciousness.
Lossy encoders calculate the human ear's masking threshold across 24 critical frequency bands (the Bark Scale). Any spectral energy falling underneath the masking threshold curve is ruthlessly discarded with zero bits allocated to it!
2. Temporal Masking (Pre- & Post-Masking)
Human hearing does not respond instantaneously. When hit with an explosive acoustic transient (like a sharp snare rimshot):
- Post-Masking: For 50 to 200 milliseconds after a loud transient, the auditory nerves remain desensitized. Quiet sounds occurring in this window are inaudible and discarded.
- Pre-Masking: For approximately 5 to 20 milliseconds before the brain registers the sound, loud acoustic events retroactively mask preceding quiet sounds!
3. The Ultrasonic Cutoff Shelf
Under the human ear's Absolute Threshold of Hearing (ATH), human sensitivity rolls off steeply above 16 kHz. To conserve precious bits, lossy encoders apply a steep brickwall low-pass filter to the audio:
- MP3 @ 128 kbps: Hard shelf cutoff at 16,000 Hz (all ultrasonic sheen and cymbal harmonics above 16 kHz are eliminated).
- MP3 @ 192 kbps: Hard shelf cutoff at 18,000 Hz.
- MP3 @ 320 kbps: Hard shelf cutoff around 20,000 Hz.
- AAC @ 256 kbps: Retains full bandwidth up to 21,000 Hz with significantly superior high-frequency transparency due to flexible MDCT block switching.
5. The Audible Artifacts of Lossy Codecs
When audio is pushed through aggressive lossy encoding, several distinct acoustic distortions emerge:
- Pre-Echo Smear: Because the MDCT processes audio in fixed temporal blocks, if a sudden percussive transient (such as castanets, a hi-hat, or an isolated snare hit) occurs near the end of a block, the quantization noise of that transient is smeared backward across the entire frame. The listener hears an unnatural "whoosh" or phantom click right before the transient arrives. Advanced codecs (AAC and Opus) eliminate pre-echo by dynamically switching from 2048-sample long blocks down to 256-sample short blocks during transients.
- High-Frequency Swirl ("The Underwater MP3 Sound"): In cymbals, distorted guitars, and applause, thousands of randomized high-frequency partials compete for bits. Under low bitrates, the psychoacoustic bit allocator constantly drops and restores frequency bands from frame to frame. The result is a watery, metallic phase artifact resembling a cheap phaser or flanger.
- Intersample Peak Inflation: As detailed in our True Peak Metering Guide, the lossy MDCT quantization process alters waveform phase envelopes, causing transient spikes to jump by \(+0.5\text{ dB to } +2.0\text{ dB}\). If a master WAV file was limited right up to 0 dBFS, decoding the lossy MP3 or AAC file produces harsh digital clipping distortion!
6. Master Technical Format Comparison Matrix
| Format / Codec | Compression Type | Typical Bitrate (Stereo) | File Size (3-Min Song) | Primary Industry Standard / Application |
|---|---|---|---|---|
| WAV / AIFF | Uncompressed Linear PCM | 1,411 kbps (16/44) to 4,608 kbps (24/96) |
~31.7 MB (16-bit) to ~103.7 MB (24-bit) | Universal recording, mixing, mastering, and studio archive standard. |
| FLAC | Lossless (LPC + Rice) | ~700 to 1,000 kbps (Variable) |
~16.0 MB to ~20.0 MB (55% reduction) | Audiophile streaming (Tidal, Qobuz), Bandcamp lossless downloads, archiving. |
| Apple Lossless (ALAC) | Lossless (M4A container) | ~700 to 1,000 kbps (Variable) |
~16.0 MB to ~20.0 MB | Apple Music Lossless, iOS and macOS native ecosystem. |
| MP3 (MPEG-1 Layer 3) | Lossy (MDCT + Psychoacoustic) | 128 kbps to 320 kbps (CBR/VBR) |
~2.8 MB (128k) to ~7.2 MB (320k) | Legacy consumer distribution, podcasting, SoundCloud free tier. |
| AAC (MPEG-4 Audio) | Lossy (Advanced Perceptual) | 128 kbps to 256 kbps |
~2.8 MB to ~5.7 MB | Apple Music, YouTube, Bluetooth LDAC/AAC codecs; superior to MP3 at identical bitrates. |
| Opus | Lossy (Hybrid SILK / CELT) | 64 kbps to 160 kbps |
~1.4 MB to ~3.6 MB | YouTube audio stream backend, Discord voice, WebRTC telecommunications. |
Inspect lossy transcode shelves and cutoff frequencies with our Audio Spectrogram & Lossless Phase Checker, convert files with zero quality degradation using our MP3 to WAV Converter and WAV to MP3 Converter, or calculate file transfer footprints with the Audio Bitrate Calculator.