Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Necessary WAV headroom to prevent mp3 clipping (Read 9010 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Necessary WAV headroom to prevent mp3 clipping

Hi guys,

I've had a search through the forums but couldn't find an answer. From what I gather, if I encode an mp3 from a WAV at 0.00dB then the encoding process will cause clipping. I was wondering how much headroom would be optimal in the WAV to avoid this? Cheers for any replies.

Necessary WAV headroom to prevent mp3 clipping

Reply #1
Merzbow, "I Lead You Towards Glorious Times (live)" + LAME 3.98.4 -V5: track peak = 2.729135 ( = 8,72 dB).

10 dB should be enough, I suppose...

Necessary WAV headroom to prevent mp3 clipping

Reply #2
Do not apply it to the wav. Instead encode the unmodified wav and apply mp3gain or replaygain to the mp3. This way there is no guessing.

Necessary WAV headroom to prevent mp3 clipping

Reply #3
I was wondering how much headroom would be optimal in the WAV to avoid this?
This depends on what is inside the WAV. Before I had a replay-gain capable MP3 player, I just encoded the files, checked the maximum (album) peak on the encoded files (replay-gain scan in Foobar 2k) and then encoded them a second time (using the WAV sources again) with LAME option of "--scale X" where X is (1/measured peak on encoded files). This worked most of the time (sometimes even this produced peaks over 1.0 in the MP3 files so I had to decrease the scale a bit and encode again). This gets boring pretty quickly, however.

Necessary WAV headroom to prevent mp3 clipping

Reply #4
I think it should be demonstrated through double-blind tests that this is actually a problem.  My personal opinion is that reducing the level of a track to accommodate for something people cannot hear is silly.

Necessary WAV headroom to prevent mp3 clipping

Reply #5
I think the usual cause of clipping when encoding to lossy, is that the original wav file was already clipped, so like greynol I doubt that the additional clipping is going to be any more obvious than what is already there.

Necessary WAV headroom to prevent mp3 clipping

Reply #6
Doesn't LAME do a little attenuation of the signal on its own?

Necessary WAV headroom to prevent mp3 clipping

Reply #7
Doesn't LAME do a little attenuation of the signal on its own?

What makes you think that?


Necessary WAV headroom to prevent mp3 clipping

Reply #9
It might attenuate the signal sonically (audibly) but it does exactly the opposite WRT signal's wafeform/peak. If you filter out the higher frequencies of a square wave it's likely to result in overshoot.

Necessary WAV headroom to prevent mp3 clipping

Reply #10
I just remember something from a while back about multiplying the signal by 0.95 or something like that. Maybe I'm babbling.


Necessary WAV headroom to prevent mp3 clipping

Reply #12
How do you do double-blind tests on portable devices that don't have replaygain capability or floating-point decoders able to process files with 1.0+ levels? I'd be interested in the validity of such tests.
Infrasonic Quartet + Sennheiser HD650 + Microlab Solo 2 mk3. 

Necessary WAV headroom to prevent mp3 clipping

Reply #13
You don't have to if your goal is transparency; and this is where I suggest you start.

Clipping as a result of encoding should be treated the same as any other lossy artifact.

If you're still interested in comparing a decoded mp3 that clips with one that doesn't, here's something I presented a while back.
http://www.hydrogenaudio.org/forums/index....st&p=558514

I've covered this on more than one occasion but always run into static because it seems that some people would rather listen with their eyes than with their ears.

Necessary WAV headroom to prevent mp3 clipping

Reply #14
Quote
That was like 3.95 or something. It's not being done anymore.


No, LAME still attenuates input signal  in cbr/abr mode (and for bitrate less than 240 kbps).

Necessary WAV headroom to prevent mp3 clipping

Reply #15
Interesting.

My test sample indicates that it attenuates by almost 0.5 dB.
That was idiotically presumptuous.  Let me rephrase:  Lame 3.98 with -b128 it attenuated a -9dB 1kHz test tone by almost 0.5dB.

Shouldn't this affect one's ability to ABX?