Help - Search - Members - Calendar
Full Version: Clipping changes dynamic range irreversibly?
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - Tech
re-dude
Hello all,

I'm new here, and I have an important question about clipping:

Does clipping change the dynamic range irreversibly? Clipping means, that the value for the amplitude of a frame/sample is out-of-range (16 bit), and takes automaticly the maximum value, right? But in that moment the original amplitude-value is lost, isn't it?

A practical example:
File 1 = original source, non-clipping
File 2 = bad encoded file 1, clipping
File 3 = volume-changed file 2 (e.g. with MP3Gain to Max Noclip Gain), non-clipping

Question: is the dynamic range of file 3 the same as at file 1? Differentiate the case (a) when all 3 files are .wav, and the case (b) when file 1 is .wav and file 2,3 are .mp3. I mean, has .mp3 a "physical" limit for the amplitude, or does it store also amplitude-values that would be clipped at .wav?

A second question:

Does clipping also exist for too quiet passages? If the amplitude-value for a frame/sample is lower then the minimal integer and round to 0 = silence...? Is such a case possible, and more important, is it reversibly (with no change in dynamic range)?

General: I mean, you have always a range for the amplitude. But is this range within another, greater range, whose presence allows lossles-clipping-recovery? What when this other, greater range is depassed? Is clipping always reversibly or have we to differentiate "light" clipping (out of the first range) and "extreme" clipping (out of all ranges)?

Thanks! (Nice forum btw)
Garf
QUOTE
Does clipping change the dynamic range irreversibly?


Yes

QUOTE
A practical example:
File 1 = original source, non-clipping
File 2 = bad encoded file 1, clipping
File 3 = volume-changed file 2 (e.g. with MP3Gain to Max Noclip Gain), non-clipping

Question: is the dynamic range of file 3 the same as at file 1?


Not really - the encoding can change the dynamic range (the peaks) a bit, and thus require a lowering of the overall volume to store the loudest peaks without clipping, for a given fixed range such as 16 bits. Note that internally in the mp3 the resolution can be higher and hence there the problem does not happen so early.

QUOTE
I mean, has .mp3 a "physical" limit for the amplitude, or does it store also amplitude-values that would be clipped at .wav?


It has a physical limit that is higher than that for wav.

QUOTE
A second question:

Does clipping also exist for too quiet passages? If the amplitude-value for a frame/sample is lower then the minimal integer and round to 0 = silence...? Is such a case possible, and more important, is it reversibly (with no change in dynamic range)?


It is not reversible, but of much less audible concern than normal clipping. After all, it's happening to the quietest things, while normal clipping happens on the loudest ones.

QUOTE
General: I mean, you have always a range for the amplitude. But is this range within another, greater range, whose presence allows lossles-clipping-recovery? What when this other, greater range is depassed? Is clipping always reversibly or have we to differentiate "light" clipping (out of the first range) and "extreme" clipping (out of all ranges)?


If you use 64 bit floats, you aren't going to run out of range soon smile.gif

As for light vs heavy clipping, if the sample value == the maximal one, but no higher, then we cannot differentiate whether it is clipped or not, however there will not be any actual clipping going on.
metaller
QUOTE
Does clipping also exist for too quiet passages? If the amplitude-value for a frame/sample is lower then the minimal integer and round to 0 = silence...? Is such a case possible, and more important, is it reversibly (with no change in dynamic range)?


If decoded sample has value that does not fit into particular integer data type, then it will be clipped. To preserve quiet passages you should perform dynamic compression before converting samples to integer.

QUOTE
If you use 64 bit floats, you aren't going to run out of range soon


Then clipping will occur during playback (if no dynamic range compression was applied) as DACs are fixed point anyway.
Garf
QUOTE (metaller @ Jun 7 2004, 05:00 PM)
QUOTE
If you use 64 bit floats, you aren't going to run out of range soon


Then clipping will occur during playback (if no dynamic range compression was applied) as DACs are fixed point anyway.

Of course, but at a point that is way below what is audible. And this should be the last processing step, ever, too smile.gif
precisionist
QUOTE
If decoded sample has value that does not fit into particular integer data type, then it will be clipped. To preserve quiet passages you should perform dynamic compression before converting samples to integer.
(metaller)

The standard 16bit resolution has a dynamic range of about 100dB (dither!). This is more than enough for everything, regardless the type of music. Very dynamical recordings (classical) may have 60dB of usable 'RMS' dynamics, then there are still 20dB for each headroom and footroom left. Applying dynamical compression is ridiculous in this case.
metaller
QUOTE
The standard 16bit resolution has a dynamic range of about 100dB (dither!). This is more than enough for everything, regardless the type of music. Very dynamical recordings (classical) may have 60dB of usable 'RMS' dynamics, then there are still 20dB for each headroom and footroom left. Applying dynamical compression is ridiculous in this case.

This is not enough for high quality. Low amplitude signals are represented with less quantization values and thus more distorted. Too bad if you don't hear the difference.
Garf
QUOTE (metaller @ Jun 9 2004, 07:14 PM)
This is not enough for high quality. Low amplitude signals are represented with less quantization values and thus more distorted. Too bad if you don't hear the difference.

Yes, but they are quieter too, causing that exact same quantization noise to be inaudibly quiet!

Try the MAD challenge if you don't believe me - given your claim you should pass it easily.
precisionist
QUOTE (metaller @ Jun 9 2004, 06:14 PM)
QUOTE
The standard 16bit resolution has a dynamic range of about 100dB (dither!). This is more than enough for everything, regardless the type of music. Very dynamical recordings (classical) may have 60dB of usable 'RMS' dynamics, then there are still 20dB for each headroom and footroom left. Applying dynamical compression is ridiculous in this case.

This is not enough for high quality. Low amplitude signals are represented with less quantization values and thus more distorted. Too bad if you don't hear the difference.

I know. Please ABXcompare a recording recorded originally with a high bitdepth and its version with a lower bitdepth. (like 18bit and 16bit) Difference ?
by the way: Create in 18bit a sine wave at 0dB. Normalize down. The quantization distortion becomes audible at around -45dB and lower. (but: sine wave!)

Edit: There was a mistake in this post. Since mostly the source audio is 16bit, 16bit and 14bit or so should be compared.
The sine wave test was also in 16bit.
re-dude
Ok, thank you guys for the good answers. I see, you have rich knownledge.

I have still some questions: you all sure know the program "MP3Gain".

1.) When changing the volume of files, does this program change their dynamic range (e.g. quiet passages louder, loud passages quieter), or does it really change the amplitude of each frame/sample with the same factor? I ask this, because the help file of this progam talks much about "how it sounds to human ear", what does not sound like objective normalizing (it would be OK, when subjective analyzing and objective normalizing)...

2.) This program manipulates the "Global Gain" variable in each frame. Is this variable 100% part of the mp3-standard? I mean, does this program produce 100% mp3-conform files (with ignoring APE-tags)?

3.) My practical example (file 1,2,3) was because of that: I have many mp3s for which MP3Gain shows actual clipping. When I reduce the volume of these files to Max Noclip Gain, the clipping disappears. But is the dynamic range of this non-clipping file the same that it was before the sound was encoded? Or does MP3Gain then only lower the "plateaus" (from the clipping position) that were before curves?

4.) When encoding really lowers the volume to prevent clipping (how Garf explains), how comes that mp3 files are clipping at all???

Thanks a lot - you are great!
Garf
QUOTE
1.) When changing the volume of files, does this program change their dynamic range (e.g. quiet passages louder, loud passages quieter), or does it really change the amplitude of each frame/sample with the same factor?


The latter.

QUOTE
2.) This program manipulates the "Global Gain" variable in each frame. Is this variable 100% part of the mp3-standard? I mean, does this program produce 100% mp3-conform files (with ignoring APE-tags)?


Yes

QUOTE
3.) My practical example (file 1,2,3) was because of that: I have many mp3s for which MP3Gain shows actual clipping. When I reduce the volume of these files to Max Noclip Gain, the clipping disappears. But is the dynamic range of this non-clipping file the same that it was before the sound was encoded? Or does MP3Gain then only lower the "plateaus" (from the clipping position) that were before curves?


The dynamic range of the file is the same. Actually you are gaining at the top (no more loss of dynamics due to clipping) and losing on the bottom (because everything gets quiter). Of course, the top gain is audible, the bottom loss not.

QUOTE
4.) When encoding really lowers the volume to prevent clipping (how Garf explains), how comes that mp3 files are clipping at all???


Uh?!? I think you completely misunderstood what I said:

The encoding of a file can increase the peaks (because it's a lossy process), and thus, if you dont want to have any clipping, you must lower the overall volume to make things fit, which is what mp3gain/replaygain does (not the encoder). MP3 itself can store the data with a larger dynamic range, but you must still decode this and then you'd have the same problem again, if you don't use mp3gain.
metaller
QUOTE
Try the MAD challenge if you don't believe me - given your claim you should pass it easily.

I meant audio that was originally recorded at high bit resolution.
Once I was doing some recordings at studio, there I had a chance to compare 16 bit and 24 bit (16 bit recorded vocals and drums sometimes sounded like shit in the final mix). Too bad I don't have such equipment at home yet sad.gif

BTW I would like to try this MAD challenge (just for curiosity), but it seems link to www.pcabx.com doesn't work mad.gif
[JAZ]
QUOTE (metaller @ Jun 9 2004, 08:09 PM)
Once I was doing some recordings at studio, there I had a chance to compare 16 bit and 24 bit (16 bit recorded vocals and drums sometimes sounded like shit in the final mix).

16 bits of resolution is said to be acceptable for *final* representation (i.e. what you would actually reproduce). It has been said other times in this board that for mixing/manipulating a signal, a higher resolution is desiderable.

Reasons :

a) you most probably will change the volume, which would add quantization noise. (a 32bit floating point representation of a 16bit signal is still 16bits)
b) you will probably equalize (this is a special case of the point a) )
c) you might process this signal with other effects which might amplify the noise caused by quantization (either changing the pitch, adding reberveration...)

In the end, if you want to have trully 16bits at the final mix. you can't start from a 16bit source, so your claim is wrong in part.
re-dude
Thanks all for the good help, I see clearly now. rolleyes.gif

@ Garf: Yes, I misunderstood you. Now it's clear. Thanks a lot for your good and precise help!
precisionist
as for the clipping issue:
perhaps my experience covered in this post helps (the second part).


QUOTE
Once I was doing some recordings at studio, there I had a chance to compare 16 bit and 24 bit (16 bit recorded vocals and drums sometimes sounded like shit in the final mix).
(metaller)

I bet the reason wasn't the lower resolution, but bad mixing & mastering. Did you know which one was which (the 16bit and the 24bit)?

QUOTE
but it seems link to www.pcabx.com doesn't work
(metaller)

Perhaps you like to use winabx.
metaller
QUOTE
I bet the reason wasn't the lower resolution, but bad mixing & mastering. Did you know which one was which (the 16bit and the 24bit)?

Of course, mixing wasn't perfect, it was just a test. But 24 bit was better for uncompressed sound than 16 bit (note that vocal recording without compression is not a normal recording practice).

And thanx for the link, although I found it myself already.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.