brian.comeau
Jan 7 2003, 13:11
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
DigitalMan
Jan 7 2003, 14:11
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.
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.
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..
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? ).
DigitalMan
Jan 7 2003, 14:52
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.)
QUOTE(DigitalMan @ Jan 7 2003 - 08:52 PM)
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"..)
Dimension
Jan 7 2003, 15:36
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.
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>
DigitalMan
Jan 7 2003, 16:23
QUOTE(Dimension @ Jan 7 2003 - 01:36 PM)
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.
brian.comeau
Jan 7 2003, 16:35
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
DigitalMan
Jan 7 2003, 16:53
@ 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.
QUOTE(brian.comeau @ Jan 7 2003 - 05:35 PM)
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?
Dimension
Jan 8 2003, 00:06
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.
<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)
2Bdecided
Jan 8 2003, 07:33
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.
indybrett
Jan 8 2003, 09:58
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.
Maybe due to the lowpass used during the mp3 encoding, if the waves clipped are of relatively high frequency.
indybrett
Jan 8 2003, 10:35
QUOTE(KikeG @ Jan 8 2003 - 11:25 AM)
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.
outscape
Jan 9 2003, 01:15
>>>'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
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.
Dimension
Jan 9 2003, 17:45
QUOTE(smok3 @ Jan 8 2003 - 02:11 AM)
<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?
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.
brian.comeau
Jan 9 2003, 22:10
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
I think that when a sample at the max. volume (or maybe some consecutive samples?) is found the signal is considered to be clipping.
Volcano
Jan 10 2003, 04:14
QUOTE(KikeG @ Jan 10 2003 - 10:22 AM)
I think that when a sample at the max. volume (or maybe some consecutive samples?) is found the signal is considered to be clipping.
Really? I would have thought that it somehow detects if the MP3 file contains peaks greater than 100% (which would be clipped off on decoding of course), like VorbisGain and ReplayGain for MPC do. (For example, VorbisGain stores values like "REPLAYGAIN_ALBUM_PEAK=1.01247013".)
I don't quite understand how that's possible, to be honest - I understand that upon decoding, everything beyond 100% is clipped off. But don't the ReplayGain programs actually
decode the files to determine the peaks and the average volume? How can they detect peaks beyond 100% then, if the output from the decoder doesn't contain the beyond-fullscale audio data? (I guess that the decoder actually
reads the samples greater than 100% and "knows" they're there, but then I don't understand how other programs can access that information, if all they receive from the decoder is the clipped output stream.)
Perhaps someone could enlighten me
NumLOCK
Jan 10 2003, 04:29
I think you know already how it works :-)
If I'm not mistaken, mp3gain can access the output of the mp3 decoder (in either high-precision integer or floating-point, I don't know), BEFORE the samples are truncated to 16 bits. So it can be sure that the samples are clipping. For this reason, It should not need to use heuristics (such as, more than two samples at full scale means clipping) at all.
Volcano
Jan 10 2003, 04:49
Ah, thanks, that makes sense.
brian.comeau
Jan 10 2003, 11:47
NumLOCK:
QUOTE
If I'm not mistaken, mp3gain can access the output of the mp3 decoder (in either high-precision integer or floating-point, I don't know), BEFORE the samples are truncated to 16 bits. So it can be sure that the samples are clipping. For this reason, It should not need to use heuristics (such as, more than two samples at full scale means clipping) at all.
Now I am getting confused...I understand what you are saying with regard to samples being pushed to clipping during the decoding process. But...
How does MP3Gain detect a clipped sample that orginates from the mastering/mixing of the original CD? If You rip a wave that has numerous samples hitting 100% full scale amplitude (32,768) and encode it to MP3 how does MP3Gain (or Cool Edit for that matter) know whether or not the sample is engineered to hit 100% volume, or is clipped. I think an early poster alluded to this (insofar as not knowing with 100% accuracy if a sample is meant to hit 100% or is clipped) and I missed his point.
Does anyone know how the clip detection process works? Samples at 32,768 are considered clipped and samples at 32,767 (for example) are not??......
brian
Pio2001
Jan 10 2003, 16:22
QUOTE(indybrett @ Jan 8 2003 - 07:35 PM)
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?
Clipping only given frequencies doesn't make sense. A given frequency can't be clipped. You must undertsand that "frequency" is synonymous with "unclipped sinewave". If you clip a sinewave, you don't have a frequency anymore, but a buch of different frequencies.
Generate a 500 Hz sine at -6 db
Perform a frequency analysis : one frequency is displayed : 500 Hz
Rise the volume by +12 db : it clips
Perform a frequency analysis : a lot of frequencies appear : 500, 1500, 2500, 3500, 4500, 5500, 6500 etc...
If you lowpass them, you progressively remove the clipping until you lowpass at 1000 Hz and completely restore the original frequency.
indybrett
Jan 10 2003, 17:18
So, are you saying that most likely the clipped frequencies are harmonics?
It would be interesting to lowpass the original WAV file and have a look at the result. Is there a program that I can pass a WAV file through and have a lowpassed WAVfile come out the other end?
Edit: <A given frequency can't be clipped> Sure it could, if the engineer was completely braindead and boosted the high end frequencies past 0db with his little tone control. I understand that when you clip a sinewave that square waves create a lot of harmonics, typically of lesser amplitude. I used to work a lot in audio in a previous life.
But you can clip part of a high frequency part of the wave, I mean, like a transient, and *maybe* nothing happens. But I'n not sure now...
QUOTE(Volcano @ Jan 10 2003 - 11:14 AM)
Really? I would have thought that it somehow detects if the MP3 file contains peaks greater than 100% ...
I guess you're right, I meant on the stage of decoding, sorry.
You asked how MP3gain knows when a sample is clipped...
As I understand it, it has a MP3 decoder with >32767 positive full scale and <-32768 negative full scale (i.e. it's more than 16 bits) and can determine the actual value that would be decoded in an extended decoding range. If this is greater than +32767 or less than -32768, it knows the sample would come out clipped. Because it has the actual value and works out the highest and lowest samples in the whole file, it also knows the maximum loudness at which the track is not clipping (display MaxNoClipGain which is a zero-width column, by default, between clip(Radio) and Album Volume columns, so you can expose it by dragging the boundary between those columns).
The same is true of the decoder for ReplayGain in OggVorbis, where the replay gain values for track, album and peak value, are only stored in the header. The user of the player (e.g. WinAmp) gets to decide how to use the information at playback time (so you can switch it to Radio Gain for doing a compilation, Album for listening to whole albums, or general no-messing, simply use it to avoid clipping or turn it off entirely).
For me, Album gain (89 dB) works very well. I've found one Rachmaninov EAC > Lame APS encoding which was already at 89.4 dB album volume straight from the rip, but displayed marginal clipping in loud transients which is inaudible to me, but I still knocked it down by a further 3 dB (taking album volume to 86.3, target = 87.0 dB) to be on the safe side and allow the full magnificent dynamic range to shine through.
As no gain had been applied, the marginal clipping was entirely caused by the modification of frequency components and phases in the encoding process (such as bandwidth limitation).
(Classic Masterpieces, RACHMANINOV, Rhapsody on a Theme of Paganini, Op.34, Piano Concerto No.2 in C minor, Op.18, London Symphony Orchestra conducted by Wyn Morris, Piano: David Golub, PCD903)
Regards,
Dick Darlington
DJ-Didi
Jan 13 2003, 18:46
Hi there,
you are talking about clipping indications within mp3gain. I'm just updating my MP3 Files on track Level to a gain of 95 dB.
Why i'm doing this, thus i see clipping in nearly every track???
I ripped about 700 CD's (mostly Rock/Pop) to MP3 in the last year. I never had problems in hearing noises/clipping or whatever.
Now i'm going to bring alle the tracks (about 12000) to the same TRACK Volume (i don't need same volume on Album level for my purposes) When analyzing the tracks with mp3gain, I see that all tracks of CD's pressed after 1997 have a volume between 95 dB to 99 dB. About 80% of these tracks show clipping. CD's older than 1997 show volumes between 84 dB and 95 dB and about 30 % of the show clipping. i assume with 89 dB, 95 % of alle tracks would be "clipping free".
No i adjusted all my tracks to 95 dB. Thus nearly 97% of the tracks show clipping now, i don't hear any "sound-problems"!!! And if so, i can decrease the gain in the mp3-player in -3dB steps
As we learned from other forum members mp3gain doesn't change the signal of the track at all. So, if the origin ripped MP3 had clipping, also the gain adjusted mp3 will have clipping. If the origin ripped mp3 had no clipping, the adjusted file may have clipping also now. But the signalvalues stored in the files are stil the same without change and are still correct!
The signal is decoded in a MP3 Player (by use of SW and the SoundCard) or in a CD Burn Software (SW converting to CDA Files). On most players you can adjust the gain in the equalizer or have also limiter functions installed. I assume, that the output-gain of a decoded sample is calculated by follwoing rule (so i would do as an developer):
Value of real sample signal-value muliplied by the value of the sample-gain-field in the MP3 file plus or minus the value of the gain setting in the player.
So the signal send to the soundcard will have no clipping, if i adjust the gainvolume in the player right. Because my MP3 Player (BPM Studio) only supports negative gain-control (-3db to -12 db) i decided to adjust all my
tracks to 96 db. This has for me follwing advantages:
- i can raise gain in the players to satisfy the input level of my external DJ- Mixer (bring it to 0dB to + 3dB) in every case.
- have enough adjustment reserves on my mixer for special needs.
- and (main reason) having a larger signal/noise gap between music-signal and the unavoidable noise signal fom the soundcard, audio cables, mixer and power amplifier. This reduces noise, that could be heard at quite music passages or on mute. Having signals with lower gains make it necessary to raise the gain-level on the external mixer or the power-amplifier with result, that unwanted noise signals from the PC/SoundCard/Cables are unintentionally amplified.
May be i will run into problems when writing Audio CD with my 96 dB Files. I don't now, because i think the most CD burn software's don't have the possibility to adjust the output gain like MP3 players have.
The problem i have at all and this let me write this message:
I don't want, is to have any unacceptbale clipping problems, thus i cann't here any differences to the original files.
So any comments to my statements above are welcome!!!
Thanks and best regards!
Didi
Volcano
Jan 14 2003, 02:45
QUOTE(DJ-Didi @ Jan 14 2003 - 01:46 AM)
CD's older than 1997 show volumes between 84 dB and 95 dB and about 30 % of the show clipping.
Good god! Increasing a 84dB track (which may very well peak at 90-something percent) to 95dB can cause
real hard clipping on loud passages. What you're doing is absolutely senseless and destroys the quality of dynamic recordings.
QUOTE
- and (main reason) having a larger signal/noise gap between music-signal and the unavoidable noise signal fom the soundcard, audio cables, mixer and power amplifier. This reduces noise, that could be heard at quite music passages or on mute. Having signals with lower gains make it necessary to raise the gain-level on the external mixer or the power-amplifier with result, that unwanted noise signals from the PC/SoundCard/Cables are unintentionally amplified.
This is plain BS. Any half-decent equipment will handle 89dB level tracks without *any* audible increase of noise. If that's not the case, you have a bad setup.
89dB is not too quiet, however many people complain about it - they are all just used to over-compressed, loud CDs.
[EDIT] Spotted a typo...
[/EDIT]
_Shorty
Jan 14 2003, 03:05
I was surprised at how many of my favourite recordings from the mid to late 80's and early 90's ended up having average loudness figures right around 89dB when looked at in mp3gain. It is truly disgusting how horribly compressed most stuff is today.
2Bdecided
Jan 14 2003, 03:46
QUOTE(DJ-Didi @ Jan 14 2003 - 12:46 AM)
I assume, that the output-gain of a decoded sample is calculated by follwoing rule (so i would do as an developer):
Value of real sample signal-value muliplied by the value of the sample-gain-field in the MP3 file plus or minus the value of the gain setting in the player.
Nope - not on most players, CD burners etc etc.
For example, in Winamp 2, by default you have a 16-bit decoder, which will happily clip everything above digital full scale. The output of this decoder is fed to the EQ and any plug-ins you have. But they're receiving a clipped signal.
If you set the EQ preamp to -6dB, it just means that the hard clipped peaks of the waveform will be halved in amplitude - but they'll still be clipped. You won't magically get back the missing waveform that should have been above digital full scale.
If you can't hear the clipping, then don't worry. It might even sound nice to you on some music! But it is there. You can remove mp3 induced clipping using mp3gain, or the MAD decoder. I think mp3trim can do a similar thing if you set the options right. Media Jukebox can also use a MAD-like algorithm to reduce playback level BEFORE truncation to prevent clipping. But every other piece of software and hardware I know of will just clip - reducing the level afterwards will not help at all!
As you say, if the CD clipped, you can't "undo" this - even if you can make mp3gain show no clipping, you still have the "sound" of the CD clipping within the mp3 files, even if the the signal no longer hits digital full scale, and even if the clipped waveform has been smoothed by the mp3 encoding. However, it's still best to get mp3gain to "remove" clipping, because at least the additional clipping introduced by mp3 en/decoding will be removed.
If you can't hear it, it doesn't matter. The desire to remove clipping came about because some people can hear it, and because scaling the audio before mp3 encoding is unpredictable, and if done at 16-bit resolution will actually reduce the audio quality.
Hope this helps,
Cheers,
David.
Gabriel
Jan 14 2003, 03:50
DJ-Didi
Jan 14 2003, 09:34
Hi,
thanks to all of you for your comments and well ment hints!
Gabriel,
i have checked your url now, thanks. But no i'm completely confused.
I interprete a time domain as that part of the player-programm,which decodes the sample and gain values from MP3 to normal uncompressed data (WAV or else) and the frequency domain is the equalizer. Or are this components only internal programm parts from the mp3 decoder itself and the equalizer does frequency based amplification/absorption seperately from the decoding process, as stated by "2Bdecided"?
I can not decide now, that my intentional clipping can be compensated by the pre amp delimiter / equalizer of the Player or not. If so, i have to reduce my MP3 gain to a more moderate level.
The question is, where is delimiting done, outsite or insite the decoder or perhaps different, depending of the Player SW?
Can you give a me a very short coaching and comment the hint of member "2Bdecided"?
Thanks and kind regards to all!
Didi