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: Digital clipping - how much is too much? (Read 11447 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Digital clipping - how much is too much?

Hi there,

I am interested in opinions as to how much digital clipping in music is acceptable. As near as I can figure out we will end up with some clipping, on newer CD's, whether we want it or not.

I have searched through lots of old posts here, and googled the usenet groups trying to understand the whole thing and I now do understand digital clipping (I think). I also have read many posts where people are lamenting the, relatively, new practice of pushing today's music to the point where it clips.

I use a Turtle Beach Audiotron and so all my music is Lame MP3 encoded to 256K & 320K. I have also been playing with MP3Gain and trying to find a some suitable gain level for all my music. ( I prefer Track gain on the whole lot of songs)

I just recently encoded the following CD's: Shania Twain's new double set, Elvis Presely #1 Hits, U2's newest, Van Morrison's Skiffle Sessions, & Santana's newest - they all clip and all are pushed to gains of 95-99 db.

I downloaded the Cool Edit Pro trial and loaded some songs in and checked the statistics on clipping. Some of the songs have as much as 12% of their samples clipped, others are as low as 4-5%, and some are less than 1% ( I checked the wav's ripped from the CD before encoding to MP3)

Question - how many clipped samples does MP3Gain have to detect before it flags a song as clipping?? Are these cummulative samples in the whole song, or consecutive samples in the song? Is there an industry standard as to number of samples that defines clipping?

Question - Is there any value in reducing the gain on a song that is already clipping when ripped straight from the CD? If I understand digital clipping correctly then I am not sure I recover anything by reducing the gain to below clipping levels. If, during the mastering of the CD, the amplitudes of the sample were pushed beyond the maximum digital value and the waveform was clipped off then that audio information, above the 32,768 mark, is forever lost. If enough consecutive sample are clipped then the waveform should be a flat line at a value of 32,768 for a few milliseconds. If I reduce the overall gain 5-10 db I still end up with a waveform that has clipped off peaks, but simply at a lower volume level - the information above the maximum digital amplitude cannot be restored.

Question - are there any rules of thumb for how many consecutive clipped samples it would take before a human ear could detect it? - surely no one can detect a single sample, since it last 1/44,100 of a second in duration. Any rules of thumb as to the percent of clipped sample in a complete song that becomes audible?

thnx,



brian

Digital clipping - how much is too much?

Reply #1
Good questions -
The audibility of the clipping will be highly dependent on the program material in my experience.  I have seen clipping (in Sound Forge) that I couldn't hear.  So if the program material is pretty "loud" then you may not be able to notice it.

You are correct that once the WAV file is clipped you can't recover the lost peak.  There are some applications (like in Sound Forge) that will round off clipped waveforms to greatly reduce the audibility - kind of like a software limiter (after the fact).

I suspect that clipping is different in the MP3 domain because there is a gain figure for each data block.  I'm getting close the edge of my knowledge of MP3 here, but my understanding is that the MP3 data doesn't necessarily "clip" like the WAV file would - rather that the output of the decoder would be out of range with the given scale/volume level for that block of MP3 data.  So, by reducing the gain for that block you could put the decoded waveform in the range of the decoder (within 16 bit dynamic range, for example).  I think this is why MP3Gain can correct for some clipping issues.

I readily defer to the MP3Gain folks on any errors or omissions in my n00bie description.
Was that a 1 or a 0?

Digital clipping - how much is too much?

Reply #2
check this thread http://www.hydrogenaudio.org/forums/index....=ST&f=12&t=5060

@digital man: imho you are correct about the fact that decoder clipping can be avoid during decoding with the appropriate gain for the format, replaygain should be (ab)used for that.
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

Digital clipping - how much is too much?

Reply #3
yup...


just adding..

i resently remastered a EP. from a band here in norway..
on two track`s.. there was so much dissortion.. that it was on the edge to
"waste" a normal loudspeaker...OSV-

the task in getting the peak back at a "normal" level.. was almost inpossible..
even now.. the parts.. have extreme level.. but try out the L2 limiter.. from waves..
it makes miracles..

and another thing...
gaining a mp3... dosn`t always produce a clipp-free pcm.. 




Digital clipping - how much is too much?

Reply #4
Quote
gaining a mp3... dosn`t always produce a clipp-free pcm..

if the clipping was there in original nothing can be done since there is no information beside the limits afaik. ( i guess limiter/compressor might help to audibly hide the defects? ).
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

Digital clipping - how much is too much?

Reply #5
smok3 Posted on Jan 7 2003 - 12:47 PM
Quote
if the clipping was there in original nothing can be done since there is no information beside the limits afaik. ( i guess limiter/compressor might help to audibly hide the defects? ).


Agree.

@ N68: Yes, Waves is a terric set of software.  Somewhat expensive for the casual user, but tres powerful (limiter, noise shaper, etc.)
Was that a 1 or a 0?

Digital clipping - how much is too much?

Reply #6
Quote
smok3 Posted on Jan 7 2003 - 12:47 PM
Quote
if the clipping was there in original nothing can be done since there is no information beside the limits afaik. ( i guess limiter/compressor might help to audibly hide the defects? ).


Agree.

@ N68: Yes, Waves is a terric set of software.  Somewhat expensive for the casual user, but tres powerful (limiter, noise shaper, etc.)

yup...


if you liked the L1 limiter..
you will be extatic about the L2..

btw.. i only wish that replygain could be implemented in
burning software.. (as track and album.. profiles..)
(after etc.. decoding.. but before "feeding"..)




Digital clipping - how much is too much?

Reply #7
There are two different kinds of clipping.  What you're talking about is clipping in the source CD.  MP3Gain exists to reduce clipping imposed by MP3 decoding itself.  As you seem to understand, MP3Gain isn't going to pull something out of nothing.  It can't fix source clipping.  MP3Gain is still a good thing to use, though.

So, you give an example of a sample that clips at 32,768.  When your source WAV's are clipping, that means that the source samples are hitting 32,768.  Technically, there is a chance that 32,768 was the intended value of the music (although this is obviously quite rare).  When you have something like Cool Edit Pro check for clipping in a WAV, what it's doing is telling you when samples are hitting the max sample value.

Clipping imposed by MP3 decoding is different.  MP3 is a lossy format, and therefore a value of 32,000 will not always be decoded as 32,000.  Perhaps it will be decoded as 33,000.  This gives you clipping, since your max sample is 32,768.  If you have a little clipping in your source WAV's, you'll have even more clipping in your MP3, because there will be some samples that were below the clipping point in the original but then when decoded they exceed the clipping value.

Floating point numbers are stored with a value (called the significand) and an exponent.  For example, a 32-bit floating point number is actually a 24-bit number that is multiplied by 2^-127 to 2^128.  MP3's are stored similarly, in that each sample has a value and a gain that it is multiplied by.  When an MP3 is encoded, a global gain value is applied before quantization (Huffman coding).  When you play an MP3 back, each block is decoded then played at the given global gain for that block.  While Huffman data can't be changed without re-encoding and lowering the MP3's quality, the global gain value for each block can be changed.  Lowering this gain can eliminate all clipping imposed by MP3 decoding.

As far as I know, MP3Gain will detect clipping as soon as one sample exceeds the clipping value during decoding.  In high quality MP3's, you generally just have to lower the gain a tiny bit to remove the clipping.

So yes, there is value in reducing the gain on a song that is already clipping.  That's really just a bonus, though, because the main use of MP3Gain is to make all your albums the same volume.  It gives you the ability to mix old CD's with new CD's without having your eardrums ruptured when a new song follows an old one.

You said:

I have also been playing with MP3Gain and trying to find a some suitable gain level for all my music. ( I prefer Track gain on the whole lot of songs)

Track gain is an exceedingly bad idea (except for a batch of singles).  Track Gain will ruin an album, and you won't be able to fix it unless you kept logs of all changes.

For example, I've got Pink Floyd - Momentary Lapse of Reason in front of me, having been normalized to 90.0 dB Album Gain.  The individual tracks range from 83.4 dB to 92.0 dB.  That's the way it's supposed to be.  If you apply Track Gain to an album, you'll end up with a quiet introduction track that's the exact same volume as a loud heavy guitar track. 

I personally normalize everything to 90.0 dB.  Out of 500+ albums, that keeps all my encodes from clipping, except just a couple that I had to manually lower a few more dB.  I chose 90.0 dB just because it worked out fine, and that way I'm a little less likely to have to turn down the volume if I switch to the radio in my car.  There's really no reason not to just use the 89.0 dB default in MP3Gain, though, if you're going to normalize all your MP3's.  If it's not convenient to normalize everything you listen to, you might want to try a higher volume to keep the difference down between normalized and non-normalized albums.

Digital clipping - how much is too much?

Reply #8
nice post
Quote
If you apply Track Gain to an album, you'll end up with a quiet introduction track that's the exact same volume as a loud heavy guitar track.

<rumble>
true, but considering that music or any audio mix is supposed to be listened to at the exact same volume and conditions as it was mixed and that cant be easily achieved in home enviroment i dont see the use of track gain on albums as really a huge sin. (the only format that tryed to fix that basic problem at least to some degree is dolby digital afaik with its selectable level of dynamics).</rumble>
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

Digital clipping - how much is too much?

Reply #9
Quote
I personally normalize everything to 90.0 dB.  Out of 500+ albums, that keeps all my encodes from clipping, except just a couple that I had to manually lower a few more dB.  I chose 90.0 dB just because it worked out fine, and that way I'm a little less likely to have to turn down the volume if I switch to the radio in my car.  There's really no reason not to just use the 89.0 dB default in MP3Gain, though, if you're going to normalize all your MP3's.  If it's not convenient to normalize everything you listen to, you might want to try a higher volume to keep the difference down between normalized and non-normalized albums.

@ Dimension:
Thanks for the additional insight.  We do need to be very careful, though, with the word "normalize."  This word is often used to referring to adjusting the gain of an audio file until the maximum sample is 32,768 or "peak normalization."  What you are really referring to is "loudness normalization" where the gain of the entire album is adjusted together so that there is no clipping and the overall perceived "loudness" is close to an arbitrary target (like 89.0dB).

We need to be clear so that somebody doesn't use a "peak normalize" feature (in EAC, Sound Forge, etc.) and think it is doing the same thing as "loudness normalization."

I quote from the MP3Gain Help file:
Quote
Peak Normalization
Most programs that "normalize" sound files do so by adjusting all the samples so that the loudest single sample is at some specified value. This is not a good way to make all the files actually have the same loudness. First of all, the human ear does not hear the loudness of single samples. It averages out sounds over time. Secondly, today's popular music CDs are heavily compressed. The sound engineers making the CD raise the average level so that it sounds much louder, while compressing the loudest parts so that they don't distort. A typical uncompressed sound file might look like this:

[image omitted]

A typical compressed sound file might look like this:

[image omitted]

Both of these files have a peak sample at about 100%, but the compressed file has a much louder average level. It sounds much louder when played back. So to do actual loudness normalization instead of peak normalization, we need to calculate how loud the file actually sounds. MP3Gain uses the Replay Gain algorithm to calculate this loudness.

Lossless Gain Adjustment

The bad news: MP3Gain can only adjust the volume of your mp3 files in steps of 1.5 dB.

The good news: 1.5 dB is a small enough step for most practical purposes. Most humans can just barely hear a volume change of 1 dB.

The other good news is that this volume adjustment is completely lossless. In other words, if you adjust an mp3 by -6 dB and then change your mind, you can adjust it again by +6 dB and it will be exactly the same as it was before you made the first adjustment.

Here's the technical reason why it's lossless, and also why the smallest change possible is 1.5 dB:

The mp3 format stores the sound information in small chunks called "frames". Each frame represents a fraction of a second of sound. In each frame there is a "global gain" field. This field is an 8-bit integer (so its value can be a whole number from 0 to 255).

When an mp3 player decodes the sound in the frame, it uses the global gain field to multiply the decoded sound samples by 2(gain / 4).

So if you add 1 to this gain field in all the frames in the mp3, you effectively multiply the amplitude of the whole file by 2(1/4) = 119% = +1.5 dB.

Likewise, if you subtract 1 from the global gain, you multiply the amplitude by 2(-1/4) = 84% = -1.5 dB.
Was that a 1 or a 0?

Digital clipping - how much is too much?

Reply #10
Quote
Clipping imposed by MP3 decoding is different. MP3 is a lossy format, and therefore a value of 32,000 will not always be decoded as 32,000. Perhaps it will be decoded as 33,000. This gives you clipping, since your max sample is 32,768. If you have a little clipping in your source WAV's, you'll have even more clipping in your MP3, because there will be some samples that were below the clipping point in the original but then when decoded they exceed the clipping value.


I am not 100% sure I really follow the math, but I will think about it a bit as what you are saying is interesting...

Quote
Track gain is an exceedingly bad idea (except for a batch of singles). Track Gain will ruin an album, and you won't be able to fix it unless you kept logs of all changes.


I rarely listen to my music (400+ albums) an album at a time. Rather, I have large playlist built that the Audiotron reads. For example, I am a big Van Morrison fan and have a 250 song playlist of songs of his that I like. I will often play this playlist in random mode when I want to hear Van Morrison. Consquently, for this style of listening, track is more suitable for my listening habits.

More than any other point, what I have been thinking about this morning is 'how much digital clipping can there be before it sounds bad'. I suspect this is something of a personal choice and will change from person to person.

By nature it seems that MP3 encoding deals with perceptual issues and I am thinking that the presence of digital clipping is also perceptual. At 42 years old my hearing is not what is used to be, and my stereo equipment is merely 'average' in its quality. At some point I will have to sit down and do some listening tests, but my gut feel is that if MP3Gain is flagging a song as 'clipping' because it detected one or two samples that clipped I really doubt that I, or a fair number of 'non-enthusiast' audio listeners, will ever hear the one or two clipped samples. So I am back to wondering, "how much is too much". It would be very interesting if MP3Gain reported some information on the number of samples (consecutive or otherwise) that it found clipping.


brian

Digital clipping - how much is too much?

Reply #11
@ brian.comeau:
Agree with you - hard to tell if the MP3Gain "clipping" flag means one clipped sample that you will never hear or a horribly distorted mess.  For me I do an album gain adjustment on all albums - rarely is there any clipping left.  I haven't heard an audible clipping problem after adjusting gain, but it could be a problem.

In the end I guess it is listener and program dependent - you're on your own.
Was that a 1 or a 0?

Digital clipping - how much is too much?

Reply #12
Quote
So I am back to wondering, "how much is too much".

For me, "any amount" of clipping is considered "too much."  However, that's just my opinion.  As this is subjective, only you can answer that question.  If you think you can hear clipping, then MP3Gain.  If not, then leave the file alone.  Or, if you just want the peace of mind you get from using MP3Gain to reduce clipping (like me), then that's your answer.  I don't think there's an objective right or wrong answer.  Simply enjoy your music..... B) .  You're already light years ahead of the massess when it comes to caring about quality.

Edit:  DigitalMan beat me to it, but we basically say the same thing.

Edit #2:  I use MP3Gain to album gain my collection, but I use the maximum no-clip gain per album feature.  This reduces the clipping on the album to zero while maintaining the volume as close to the original as possible.  If I do any track mixing of favorite songs, I'll create duplicate copies of my MP3's first and then do a track gain to normalize the volume (as discussed with proper terminology).  That makes the track mix at a level volume.  It takes up more space, but hey what are our big hard drives and CD-burners for?

Digital clipping - how much is too much?

Reply #13
I understand what you're saying about Track Gain not being that big a deal.  My point is that regardless of what order you're listening to things, a quiet song is supposed to be quiet, and a loud song is supposed to be loud.  So, with a target volume of 89.0 dB, Album Gain will make sure a quiet song is under 89.0 dB, and a loud song is over 89.0 dB.

Digital clipping - how much is too much?

Reply #14
<some more rumble>
hmm, ok so for example with this 'originals':

a = classical easy melody (from album1)
b = hard rock kinda loud  (from album2)
c = heavily compressed and very loud pop (from album3)

when played in this order you would use album gain? :
b,a,c
what about:
c,b,a
?

imho that would only work if album gain would have a missing parameter and that is what is the current playback loudness to some point.
So this would probably only work when your volume is exactly the same as was intended at mix time, but again every album is different even at mixing stage so your never even close.

example2:
d = song2 from first album
e = song3 from first album

example playback:
d,e,a

what now? (another missing point is bad mastering inside one single album as well, iam sure a lot of them have a broken consistency)
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

 

Digital clipping - how much is too much?

Reply #15
I agree that any clipping is too much, in theory.

In any lossless digital audio file, you don't know if it's clipped. As Dimension said, if you see digital full scale samples, it could be that 32,768 is the true value of the sample, or maybe it should have been higher - maybe much higher. If you can see what looks like a smooth wavewform with the top chopped off at digital full scale, then it's probably clipped! However, if you have individual samples at digital full scale, it's likely that the peaks have been adjusted by some heavy limiting or compression to fall at exactly that level. So they are there, at 32,768, correctly and intentionally - but it's not chance - the gain is adjusted moment by moment to put the peaks as loud as possible.

In the audio industry, meters show "clipping" on playback when 1, 3, or 7 digital full scale samples are encountered.


As for how many is perceptable - yes, that does depend on the individual, but it depends even more on the music. With hard rock, you might not notioce hundreds of clipped samples (though someone once claimed to hear a mere three!); with choral or piano music, 1 or 2 may be audible - though I've never heard any one claim that they can hear 1 clipped sample.


Unless you have good reason, there's no need to allow clipping. However, if you do have it, but can't hear it, don't loose any sleep over it!

Cheers,
David.

P.S. I did a DJ mix once in Cool Edit Pro, and often cross faded or beat mixed two tracks, taken from loud CDs. There was lots of clipping (you could see it), but it wasn't obvious to listen to. Dropping the levels by 6dB (which would have solved it) wasn't acceptable, and correcting for the 6dB drop by 6dB hard limiting sounded terrible where it kicked in.

Digital clipping - how much is too much?

Reply #16
Maybe somebody can explain this.

Rush - Vapor Trails. Classic example of a CD that was mastered too loud. If you rip the CD, and then look at the audio in Cool Edit. There is clipping everywhere. The VU meters will consistently go past 0db.

Here is what I don't understand. If I normalize the CD when I rip it, it just chops off the peaks. The waveform looks like a straight line across the top. WAVgain will have the same effect when applied to the audio.

This, to me, is an example of a CD where the audio is clipped on the CD, and therefore, it's screwed with no chance of fixing the mess.

So then, explain this.

I rip the CD (no normailizing, no WAVgain) to get the audio exactly as it is on the CD. These wav files are clipped, pushing past 0db. I then encode with LAME. I then use mp3gain on the files to get max volume without clipping. Now, here's the fun part. I load that MP3 in CoolEdit, and guess what? No clipping, and the waveform is not chopped off across the top. It's not flat like normalizing and WAVgain did.

How is that possible? There are smooth rolling peaks on the top of the waveform. This is a file that was heavily clipped when it was a WAV file.

I'm stumped, but I'm sure there is an easy answer.
flac > schiit modi > schiit magni > hd650

Digital clipping - how much is too much?

Reply #17
Maybe due to the lowpass used during the mp3 encoding, if the waves clipped are of relatively high frequency.

Digital clipping - how much is too much?

Reply #18
Quote
Maybe due to the lowpass used during the mp3 encoding, if the waves clipped are of relatively high frequency.

Ahhhh, that could be. Makes sense.

Now I'm trying to imagine the engineer mastering that CD, and somehow managing to clip all of the frequencies over 16khz, and nothing below. How in the world could that happen? Still, it does sound like a logical explanation.
flac > schiit modi > schiit magni > hd650

Digital clipping - how much is too much?

Reply #19
>>>'I am interested in opinions as to how much digital clipping in music is acceptable'<<<

no clipping is acceptable. any kind of clipping is unacceptable

>>>'I just recently encoded the following CD's: Shania Twain's new double set, Elvis Presely #1 Hits, U2's newest, Van Morrison's Skiffle Sessions, & Santana's newest - they all clip and all are pushed to gains of 95-99 db.'<<<

did you zoom into the waveform to see if the top is "chopped"? sample values are irrelevent when determining if the recording is clipped. this is because you can have a specific instrument, like cymbal, hitting that 95% mark, while the rest of the peaks in the recording are much lower

and even then, if there are 2 or 3 consecutive samples that clip (either just below full-scale or slightly above it), i doubt this will be audible to most people, but go figure. some say they can actually hear the distortion with 3 samples. higher clipping values, like 20 or 30 consecutive samples with heavy dynamics compression, well thats a different story. let your ears be the judge

>>>'Is there an industry standard as to number of samples that defines clipping?'<<<

i dont think the recording industry have any standards about clipping. if they would, we wouldn't have clipped CDs. but of course, we have plenty of clipped CDs. some clip not by much, while some are heavily clipped and literally distorted, even today, with all the tools and technology we have to prevent clipping
Be healthy, be kind, grow rich and prosper

Digital clipping - how much is too much?

Reply #20
with all the experts, can somebody please check the sample from the guruboolez's thread i posted above, just mppenc and mppdec, and report the results (considering clipping), tnx.
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

Digital clipping - how much is too much?

Reply #21
Quote
<some more rumble>
hmm, ok so for example with this 'originals':

a = classical easy melody (from album1)
b = hard rock kinda loud  (from album2)
c = heavily compressed and very loud pop (from album3)

I see we have an instigator on the forum.

Don't be ridiculous.  There's always going to be an example of things "not working out" no matter what volume you make things, but to bring up the idea of listening to soft classical then immediately go into "hard rock kinda loud" is just dumb. 

Seeing as there is no album database of what the original artists thought the volume should be relative to other music (and there never will be), the best thing you can do is use album gain on your music.  If you want to make a compilation involving Geminiani, Elgar, Bach, Enya, Metallica, Massive Attack and Beastie Boys (OK, actually I have CD's like that), the best solution is still to use Album Gain.  If you don't like the way things turn out, you can adjust the gain on certain albums.

If the options are:

1) No ReplayGain
2) Track Gain
3) Album Gain

Then the best option is obviously #3.  You certainly can't be suggesting that you're better off just leaving things the way they are, and there's no way you could say Track Gain (which completely changes the album's dynamic) is better.  All you've really done is prove my point.

Your post is completely irrelevant.  All you've said is that Album Gain isn't perfect, but you certainly haven't given a better option.  What was the point?

Digital clipping - how much is too much?

Reply #22
lol, obviously there are some communication problems..., i really dont want to prove anything..., i mean what for?
my only intention is to learn something new (honest)  , still cant be bored to repeat my post again with different words.
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

Digital clipping - how much is too much?

Reply #23
Outscape:

Quote
did you zoom into the waveform to see if the top is "chopped"? sample values are irrelevent when determining if the recording is clipped. this is because you can have a specific instrument, like cymbal, hitting that 95% mark, while the rest of the peaks in the recording are much lower


I did a bit of zooming in here and there to see what it looks like, but in general I had Cool Edit Pro count the number of samples that are cliped and looked at those results. You raise an interesting point though - how does Cool Edit Pro decide if a sample is clipped...which leads back to one of my original questions - how does MP3Gain tell that a song is clipped??


brian

Digital clipping - how much is too much?

Reply #24
I think that when a sample at the max. volume (or maybe some consecutive samples?) is found the signal is considered to be clipping.