Skip to main content

HOW MUSIC IS COMPRESSED?

 🎵 What does “compressing music” mean?


Compression means reducing the file size of an audio recording so it takes up less space (for example, turning a 50 MB song into a 5 MB MP3).

This is different from dynamic range compression, which adjusts loudness. Here, you’re asking about data compression (making files smaller).


🎯 How is music compressed? (Digital audio compression)

Most audio compression works by removing information that your ears don’t easily notice, using psychoacoustics—the science of how humans perceive sound.


🔑 Main Steps in Music Compression:

1️⃣ Splitting into frequency bands

  • The sound is broken down into lots of frequency slices (like a prism splitting light into colors).

  • This is called a transform, usually the Modified Discrete Cosine Transform (MDCT).

2️⃣ Psychoacoustic model finds what can be discarded

  • Your ear can’t hear quiet sounds that are masked by loud sounds nearby in frequency (called masking).

    Example: a loud drum hit masks a faint hiss behind it.

  • The encoder analyzes which parts are likely inaudible and marks them to be removed or stored with lower precision.

3️⃣ Quantization

  • The remaining sounds are stored as numbers with fewer bits, reducing precision to save space.

  • Quiet or masked sounds get very coarse resolution.

4️⃣ Entropy coding

  • The encoder looks for repeating patterns and uses smart codes to store them efficiently (like zipping a text file).

    For example, long strings of zeros are compressed into a short instruction: “repeat zero 100 times.”

5️⃣ Packing into frames

  • All this processed data is packaged into chunks called frames, with a bitstream header to tell the decoder how to reconstruct it.


📄 Example: MP3 Compression
An MP3 encoder uses all of the above steps.

  • Original CD-quality audio: 1.4 Megabits per second

  • Compressed MP3: 128–256 Kilobits per second, about 10x smaller


🎧 When you play it back:

  • The decoder reverses the steps: unpacks, decodes, reconstructs the frequency bands, and transforms back into time-domain audio.

  • Because some data was thrown out, this is called lossy compression.


💡 In Short: How music is compressed:
✅ Break sound into tiny frequency parts
✅ Remove or simplify things your ear won’t miss
✅ Store fewer bits for less important sounds
✅ Encode repeating patterns efficiently
✅ Reconstruct it later for playback


Analogy:
Imagine describing a painting to a friend over the phone.

  • Instead of naming every brush stroke, you say:
    “It’s mostly blue sky, with some white clouds here and there.”

  • You’re conveying the essence but omitting tiny details.
    That’s how MP3 and other codecs compress audio.