Page 1 of 1

MP3 encoding and clipping

Posted: Sun Nov 16, 2008 4:05 pm
by synnack
Ok so I am stupid.

I was working on packing up my labels free compilation the other day when I noticed that no matter how I encode a wav/aif to MP3, the resulting file has random clipping.

I tried iTunes, Cubase SX, Soundforge. Various bitrates. VBR or not...

No matter what, when I open those files back up in soundforge and hit play they have clipping all over the place.

These wav/aif were all originally mastered and leveled around -0.1 to -0.2 db so they were already pretty hot in the first place but I guess I am stupid that I never realized that encoding them would cause clipping.

Now I wonder if the rest of my collection (i rip cds and put them on the shelf and never touch them again) are clipping.

Is this normal? Via google I see various discussions but no good "best practice" has emerged.

Does this bother anyone else? I think a high bitrate mp3 sounds fine but now that I SAW that in Soundforge I hear more and more distortion in some of the things I've encoded.

Re: MP3 encoding and clipping

Posted: Mon Nov 17, 2008 12:34 am
by Nod
tempus3r wrote:These wav/aif were all originally mastered and leveled around -0.1 to -0.2 db so they were already pretty hot in the first place but I guess I am stupid that I never realized that encoding them would cause clipping.
It's not encoding them, it's the decoder that's causing it, as the decoding process typically adds approx 1db.
Now I wonder if the rest of my collection (i rip cds and put them on the shelf and never touch them again) are clipping.
MP3's of modern releases that are hard limited to around the levels you mention will result in a decoder clip.
Is this normal? Via google I see various discussions but no good "best practice" has emerged.
Yes - as for the solution a 'reference playback level' was proposed:

http://ff123.net/norm.html
Does this bother anyone else? I think a high bitrate mp3 sounds fine but now that I SAW that in Soundforge I hear more and more distortion in some of the things I've encoded.
TBH I wouldn't bother too much - any added noise over an already badly mastered, ie: brickwall limited file, is merely going to be adding to the square waves anyway. If you're really bothered by it a useful utility for setting gain post encoder, iirc it rewrites the header, is MP3Gain:

http://mp3gain.sourceforge.net/

HTH

Posted: Mon Nov 17, 2008 1:10 am
by synnack
These are the conclusions I've reached today from reading more as well.

Also caused me to take another look at FLAC.

Posted: Mon Nov 17, 2008 1:42 am
by leedsquietman
Nod is spot on with his info. Typically, modern music which is already hypercompressed to a degree presents a lot of challenges to the encoder for mp3 files.

You are best off setting your ceiling to around -1.2db or lower for mp3. If you have a limiter plugin, set your output limiter to -1.2 and your input gain to 0, you don't want to try and throw more compression into it. Your mp3 will be a tad quieter, but that is typical and suits the mp3 devices better.

I always make 3 mixes of a song in SOundforge, the CD format .wav file, a 320 Kbps a dB or so less limiting and with an out ceiling of -1.2 dB and a lower bitrate 192 Kbps mp3, where I might also take out some of the really low sub 30Hz and above 12 Khz to prevent that 'underwater cymbal' squirrelly sound you sometimes get with lower bit rate. It definately sounds a lot better than just ripping an mp3 from a .wav with no alterations, you will get more encoding artifacts and clipping if you do nothing.

Posted: Mon Nov 17, 2008 6:31 am
by timothyallan
1.2 db seems a bit much of a reduction no? I once read it was more along the lines of .1db - .15db in order to prevent mp3 clippage.

Posted: Tue Nov 18, 2008 11:14 pm
by leedsquietman
that is only in stuff that is mastered quietly to begin with and not complex, i.e. acoustic guitar and vocals, or classical or jazz stuff which is recorded low (ie has 17db or more of dynamic range, so nothing is overly compressed).

Typically I see spikes of between .5 and 1.1 db with mastered material that is rock (especially cymbal heavy drumming)or heavy electronica.

I would say as a minimum leave 1db of headroom, so the peak waveform is no more than -1db. Personally, I leave -0.3db for CD mastering but -1.2 for mp3 to be absolutely sure of no clipping and I take .5 to 1db out of the mp3 recording so the encoder can deal with it better. And make sure your encoder is on its highest quality settings, not fast or normal, that makes a big difference, the slower and more detailed the encoce, the more faithfully it will be reproduced.