Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is a .wav file created from a .mp3 file much larger in size? [closed]

It is well known that .wav is a format used for uncompressed audio files. On the other hand, .mp3 files are usually the result of audio files after compression. For instance, only the larger of two tones that are too close in frequency (so that they mask each other) are retained after compression. Also, quantization noise is introduced into parts of the time or frequency spectrum that are not perceptually important (such as frequencies that are too high or too low). Clearly, a lot of (perceptually) redundant information is discarded, which allows for the reduction in file size.

My question is: why is a .wav file obtained from a .mp3 much larger in size than the .mp3 file? From an information-theoretic view, no additional information relevant to the song could have been added, so why the increase in size? Is it just a consequence of how data is stored in the .wav format? Any answers/references would be much appreciated. Thanks!

like image 807
sai Avatar asked Oct 04 '22 15:10

sai


1 Answers

The way the two store audio is night and day different. Simply put, a WAV file (which is PCM audio) is storing much more data than the MP3 file is.

PCM audio quantifies the pressure at each sample. There are many samples taken. CD-quality audio uses 44,100 samples per second, per channel. The red lines here are samples:

enter image description here

Graph from: http://en.wikipedia.org/wiki/Sampling_rate

MPEG-1 Layer 3 (and many other lossy audio compression codecs) use a different method for encoding audio. Rather than measuring pressure over time, they measure frequency components over a time. MP3 encoders determine which frequencies are present in a signal for a short period of time, called a frame. A frame may be 576 samples or so long. For those samples, they playback a set of frequencies.

Now, all of this is overly simplified. MP3 has a lot of nice tricks to filter out frequencies that will be masked by others, and some nice smoothing of the playback to make it sound close to the original.

You might find my answer here a bit more in depth: https://video.stackexchange.com/a/635/129

like image 63
Brad Avatar answered Oct 10 '22 04:10

Brad