Studio LOOS Audio Lab • The Hague
100% IN-BROWSER
đź”’ Zero Audio Uploads: Audio files are decoded & processed in your local browser RAM via Web Audio API. No sound data ever leaves your device.

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:

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:

$$\text{Bitrate (bps)} = f_s \times B \times C$$
Uncompressed PCM bitrate equation where \(f_s\) is sample rate, \(B\) is bit depth, and \(C\) is channel count

Evaluating this formula across standard production formats:

WAV (RIFF) vs. AIFF (IFF) Containers

WAV and AIFF are not audio compression formats; they are header wrapper containers for storing raw PCM audio:

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:

  1. Block Partitioning: The incoming PCM stream is broken into discrete frames of 1,152 to 4,096 samples.
  2. 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!
  3. 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!
  4. 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.
đź’ˇ The Bit-for-Bit Identity Proof

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):

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:

5. The Audible Artifacts of Lossy Codecs

When audio is pushed through aggressive lossy encoding, several distinct acoustic distortions emerge:

  1. 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.
  2. 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.
  3. 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.
🎛️ Related Studio LOOS Production Tools

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.

ADVERTISEMENT • STUDIO SPONSOR
Support Studio LOOS open web acoustic laboratory • High-grade pro audio gear & plugins
← Back to Knowledge Base Index Explore Web Audio Suite →