Skip to main content

Topic: A question from Italy (Read 3725 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
A question from Italy
Ciao from Italy.

My english is not so good. I hope You'll understand what i mean !!

I know that when i encode from wave to MP3, the maximum level of any sample can exceed the value 2exp16 (32768).

To avoid this i should low the volume of the master wave.

The question is this.

Is this audible ?

Is this always audible or is it audible only when i re-convert from mp3 to wave ?

If i play my over-32768 mp3 on my car mp3compatible cdplayer, can the hardware decoder go over the 32768 level ?
For example, can the hardware decoder play a sample placed at level 32800 ?

I hope you can understand my question.

Thank you !

  • indybrett
  • [*][*][*][*][*]
  • Members (Donating)
A question from Italy
Reply #1
You probably want to use MP3gain. It will prevent your mp3's from clipping when decoded.
  • Last Edit: 03 December, 2004, 06:11:54 PM by indybrett
flac>fb2k>kernel streaming>audiophile 2496>magni>dt990 pro

A question from Italy
Reply #2
You probably want to use MP3gain. It will prevent your mp3's from clipping when decoded.
[a href="index.php?act=findpost&pid=257676"][{POST_SNAPBACK}][/a]

Thaks !

But...i want to know if the clipping is caused by the encoder or by the decoder.

The over-32768 data is lost when the decoder meet a 32768level or is the decodere that "can't understand" a over-32768 value ?


  • indybrett
  • [*][*][*][*][*]
  • Members (Donating)
A question from Italy
Reply #3
I am pretty sure it is the decoder.
flac>fb2k>kernel streaming>audiophile 2496>magni>dt990 pro

  • kwanbis
  • [*][*][*][*][*]
  • Developer (Donating)
A question from Italy
Reply #4
afaik, the clipping is caused because of the limits on the way the music is  defined

  • oudalrich
  • [*][*]
A question from Italy
Reply #5
Have a look at this perfect little post (I think this should be put in the FAQ somewhere) for a very concise description of how MP3 works.
When the data is converted back to the temporal domain (decoded), the result is an approximation of the original PCM values (ranging from -32768 to 32767 in the case of 16 bits precision). But since it is only an approximation, some sample values may exceed the scale: a sample that should decode to 32800 will be represented as 32767 (a deviation of this magnitude will not be audible, though). One way to avoid this is to allow for some headroom while decoding. The MAD software decoder does this, AFAIK, but I have never heard of hardware decoders with this capability. Foobar2000 takes another approach: it decodes to a 32 bit floating point format where the scale has no (practical) limitation. The "normal" scale goes from -1 to 1, but samples can exceed the scale without a problem. Clipping will occur only at the end of the processing pipeline, when the data is converted to the fixed-point format the soundcard requires (like the usual 16 bits) - unless you've been clever enough to use something like foobar's soft clipping or advanced limiter DSPs. They will scale parts of the signal in a sensible way so that it stays within the limits of the scale and doesn't clip.
Another possibility to avoid clipping MP3s is to use MP3gain, as indybrett has already pointed out. MP3gain decodes your MP3s and if it detects clipping, it can (losslessly) reduce the volume of the file to the point where no clipping occurs.
Now for audibility: I think the clipping introduced by an MP3 decoder should not be audible for most people (and certainly not when driving a car!). As has been pointed out many times before, many of the (pop/rock) CDs you can buy today have been clipped to death anyway due to bad mastering/production. The clipping may get worse (and audible), however, if the decoded signal is run through a DSP (like an equalizer).
If you want to know what clipping sounds like, get foobar2000 with the VU meter visualization component: whenever the top bar (labeled "Peak") turns red, foobar has detected clipping. You can cause more clipping by dragging the preamp sliders in Preferences/Playback to the right (note that for the changes to become effective playback has to be restarted).

  • k.eight.a
  • [*][*][*][*]
A question from Italy
Reply #6
Some useful links for you pecosbill76:

Wavegain vs. MP3Gain
Sorry for my poor English, I'm trying to get better... ;)
"The greatest trick the Devil ever pulled, was convincing the world he didn't exist."

A question from Italy
Reply #7
Long story short, it's indeed the *decoder* that causes clipping.

When you encode sound to MP3, the process will cause some peaks to be higher than they were before, which means that some may surpass 2^15. This is no problem for MP3 because MP3 isn't limited by the 16-bit scale like WAV's are.
But when you listen to an MP3, it is decoded to WAV which is piped through your soundcard, and the WAV will clip if there are peaks that surpass 2^15.
The solution is to use MP3Gain to lower the volume of the MP3 so that there are no longer any peaks above 2^15.

[Edit]Thanks, Precisionist[/Edit]
  • Last Edit: 28 December, 2004, 10:10:57 AM by NeoRenegade

A question from Italy
Reply #8
Some wrong math in this thread... 
2*e^16=2*exp(16) = ~1,777*10^7
Please write 32 768 = 2^15
I know that I know nothing. But how can I then know that ?