Do You Really Understand MP3s?

In this blog post, I’ll explain in simple terms what data compression technology lies behind MP3s and why they allow us to store so many songs on such small devices.

 

Introduction

I still vividly remember the shock I felt when I first saw an iPod box emblazoned with the phrase “1,000 songs in your pocket.” The fact that a palm-sized device could hold so many songs seemed like magic to me, as I was still using only cassettes and CDs at the time, and that experience was what sparked my interest in engineering. Of course, improvements in the storage capacity of portable devices played a part, but the biggest reason is the data compression technology applied to MP3s. In this post, I’ll take a step-by-step look at the core compression principles of MP3s.

 

Basic Principles of Data Compression

The basic idea behind data compression is to reduce storage space by converting redundant or unnecessary information into a simpler form. For example, if text information repeats like “AAAAAAA,” saving it as “A7”—which indicates the number of repetitions—saves significantly more space than storing the entire sequence. Methods like these, which represent information more efficiently, form the foundation of compression.
Compression methods are broadly divided into two categories. One is lossless compression, where decompressing the data yields data that is completely identical to the original. Commonly used ZIP or RAR files fall into this category. The other is lossy compression, which discards some information during the compression process to reduce file size even further. Although the restored result differs from the original due to the discarded information, with proper design, it is difficult for the human senses to perceive the difference.

 

Why did MP3 choose lossy compression?

In cases where data contains many repetitive patterns, such as text files, high efficiency can be achieved even with lossless compression. However, for data that is relatively complex and has little redundancy, such as music or photos, the compression ratio of lossless methods is low. Therefore, lossy compression is necessary to store audio or music files in a small file size, and MP3 uses this very lossy compression method to significantly reduce file size while minimizing sound quality degradation.

 

Compression Focused on Audible Frequencies — Saving Space by Leveraging the Human Ear

Sound can be viewed as an amplitude that changes over time, or as the sum of various frequency components. From a frequency perspective, all sounds are created by combining components of different frequencies. The reason a guitar produces a variety of notes is also because the vibration frequencies of each string combine.
The key point is that the range of sounds the human ear can hear is limited. Generally, humans are sensitive only to frequencies between approximately 16 Hz and 20,000 Hz. MP3 takes advantage of this by preserving the frequency components that are important within the audible range, while removing or representing with lower weighting the extremely low or high frequency components that humans cannot hear well or barely perceive. By selectively reducing these frequency components, the amount of data can be significantly reduced. This process is also the main reason why MP3s suffer from sound quality loss compared to uncompressed WAV files from CDs.

 

Quantization: Losses resulting from the digitization of analog signals

Although sound amplitude exists as a continuous value, computer memory can only store discrete values represented by 0s and 1s. The process of converting these continuous values into digital values is called quantization. Similar to displaying the time on an analog clock as digital numbers, continuous amplitudes are “rounded up” or “rounded down” to numbers at fixed intervals.
During the quantization process, subtle differences in the original amplitudes are lost, resulting in errors.

However, MP3 is designed with very small quantization intervals, maintaining errors at a level that is difficult for the human ear to distinguish, so in most cases, it is hard to notice a difference when actually playing the music.

 

Conclusion: The Balance Between File Size and Quality, and the Future

MP3 minimized the perceived loss in sound quality while significantly reducing file size through two key ideas: removing unnecessary components in the frequency domain and optimizing the quantization process. Thanks to this compromise, it became possible to store hundreds or thousands of songs on a single portable player, and it also had a major impact on the distribution of music via the internet.
However, as the saying goes, “You can’t have your cake and eat it too,” there is always a trade-off between reducing file size and maintaining sound quality. As technology has advanced, more efficient compression standards have emerged, and compression technology continues to evolve, with the development of multimedia standards like MP4 that handle not only audio but also video and documents. In the future, various compression techniques tailored to specific data types will continue to evolve, aiming for higher efficiency and a better user experience.

 

About the author

Cam Tien

I love things that are gentle and cute. I love dogs, cats, and flowers because they make me happy. I also enjoy eating and traveling to discover new things. Besides that, I like to lie back, take in the scenery, and relax to enjoy life.