Take the 2-minute tour ×
Sound Design Stack Exchange is a question and answer site for sound engineers, producers, editors, and enthusiasts. It's 100% free, no registration required.

I know they remove certain sounds, like extreme highs and lows, but how does this really work?

  • What information is decided to be thrown out? Is it just done by frequency and typical human hearing range?

  • Are other types of compression used, like redundancy removal? How do they work?

  • When the resulted file is produced, how are the sound waves encoded digitally? Is there a constant shape of the wave that's being recorded very precisely, or some other way of representing the sound digitally?

share|improve this question

migrated from avp.stackexchange.com Jan 27 at 15:07

This question came from our site for engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation.

2 Answers 2

MPEG-1 Layer 3 is complex stuff. I recommend starting your reading here: http://oreilly.com/catalog/mp3/chapter/ch02.html

Another resource that I found helpful to get started with is at: http://www.mp3-tech.org/

In a nutshell, MP3 encoding works by taking a frame (say, 576 samples, which is the smallest frame size for standard MP3) and making a spectral model of it. Think of a spectrum analyzer showing you the current levels at various bands, only with a lot of bands.

How it does this depends on the types of sound in that frame. There are several psychoacoustic models used. For example, masking can occur as louder sounds end up being much more prevalent than quieter ones. Our ears tend to do this anyway, which is why MP3 often gets away with it if you aren't carefully listening.

Frames with transients are set to the lowest number (576) of samples, and frames without them can be over a thousand samples. (Less precision where it isn't needed.)

As far as which frequencies are thrown out, yes a wide bandpass filter is applied to the sound before encoding. Beyond that, the higher the bitrate generally, the better the frequency response. You can see some graphs here: http://www.mp3-tech.org/tests/pm/MP3-128k.htm Note that the author of those pages was using program material, not test samples. That's why the bass looks so high, but you can definitely see the high-end falloff.

The artifact in MP3 that bugs my ears the most is pre-echo, or transient smear. Basically, since the sample chunk is 576 at its lowest, the sound of attacks on cymbals and such is all sorts of messed up. Even at 320kbit, the smallest frame is 576 samples. To me, it's what really makes the difference between the original and the encoded version. Most of the rest of the encoding loss, I can live with, at least at the higher bit rates.

Also, many MP3 files are encoded in joint stereo. In this mode, most of the bands are in mono, and a handful are left for the left and right channels, where necessary. There are two ways this is done... intensity stereo, and mid/side. You can read more here: http://en.wikipedia.org/wiki/Joint_(audio_engineering)

I hope this is helpful. Please ask more questions if anything is unclear. Also, I am no expert on this... I've just been researching it for awhile. Please suggest corrections if I am wrong about anything.

share|improve this answer
1  
Don't forget about the lossless compression done at the end! –  BlueRaja - Danny Pflughoeft Apr 5 '11 at 3:42

It throws out what we can't hear, to put it simply. To quote the Wikipedia article on MP3 "It uses psychoacoustic models to discard or reduce precision of components less audible to human hearing, and then records the remaining information in an efficient manner." http://en.wikipedia.org/wiki/Psychoacoustics

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.