INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Normalize, analyze, peak level and replay gain  (Read 7541 times)

mhakman

  • World Citizen
  • ***
  • Posts: 206
Normalize, analyze, peak level and replay gain
« on: November 15, 2005, 09:38:36 am »

Hello,

I have some problems with “normalize before encoding” (Encoding, CD-ripping, FLAC) and “analyze audio during ripping” (Devices, CD-ripping) and also peak level.

1.   When I disable both of these then MC still says it is “normalizing” during ripping but no peak level is computed. Then if I analyze the track manually I get, say, peak level of 94%. 
2.   When I enable only the analyze during ripping option then MC says it is normalizing (not analyzing) and I get, for the same track, peak level of 72%. If I reanalyze manually then I get 94% as above.
3.   When I enable both options and set normalize level to 99% then I get peak level 72% automatically and when I reanalyze manually then I get peak level 98%.

Can anybody explain what’s going on here?

The reason for digging into these details is that I’m apparently unable to get approximately the same sound volume when listening to different albums. This is especially pronounced when listening both to rock and to classical music. I don’t mind volume changing between tracks on the same album because this is probably artist’s intention but between albums I would like to have approximately the same perceived sound volume. When I try to use replay gain in various settings (album based, track based, fixed or automatic adjustments) then I either get very low volume even at maximum volume control setting or large volume differences between albums. Without replay gain the volume differences are huge between, say, A Bigger Bang (The Rolling Stones) and Arie e Duetti d’Amore (George Frideric Handel) despite the fact that shown peak levels are about the same. The shown replay gain varies from -16 dB (Stones) to +6 dB (Handel).

The volume differences are not as huge when playing CD’s on ordinary stereo so I assume there must be some processing done during rip or play in MC that enlarges them.

Any ideas?

Thanks/Mikael
Logged

jgreen

  • Citizen of the Universe
  • *****
  • Posts: 2419
Re: Normalize, analyze, peak level and replay gain
« Reply #1 on: November 15, 2005, 11:12:10 am »

I'll give you my personal perspective on this, until others weigh in with their expertise.

I never normalized my encoding, instead relying on replay gain, which I can turn on and off at will.  I agree that replay gain can sometimes make odd choices, although it's right far more than it's wrong.  I think the reason is that the algorythm has to make a choice between max amplitude and average amplitude, whereas we know loud when we hear it.

Barring something technically wrong in your encoding process, I would suggest you try scthom's EQdb plugin.  Using this you can assign individual EQ settings as well as preAmp.  I use this plugin to tweak the dicrepancies you mentioned, for example going from highly percussive (Rock) to highly orchestrated (Classical) tracks.  If you decide to try the plugin (on the plugin page), note that it is still currently in Beta testing.
Logged

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: Normalize, analyze, peak level and replay gain
« Reply #2 on: November 15, 2005, 11:32:45 am »

Do not normalize during ripping. It alters permanently the file volumes and destroys the relative track volume differences inside the albums.

You'll get the most accurate results if you analyze the compressed files after encoding and enable the "Album based" and "Automatic based on current playlist" options on playback. All albums will play at the same maximum volume and the track volume differences inside the albums will be preserved.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: Normalize, analyze, peak level and replay gain
« Reply #3 on: November 15, 2005, 01:18:14 pm »

2. When I enable only the analyze during ripping option then MC says it is normalizing (not analyzing) and I get, for the same track, peak level of 72%. If I reanalyze manually then I get 94% as above.

Actually, this very strange. Since you are using FLAC you should get exactly the same peak level. In any case, the difference should be small even with lossy formats. Could you verify that the same thing happens with APE and wave? It might be a bug.

BTW, the standard question: Your system info?


Edit:  Also, MC should not say anything about normalizing if it is disabled.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

IJAG

  • Member
  • *
  • Posts: 4
Re: Normalize, analyze, peak level and replay gain
« Reply #4 on: November 15, 2005, 01:59:14 pm »

There seems to be a problem with the 11.1 builds with Replay gain. Me and Marko have reported this in the build threads.
Logged

dNj

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 95
  • I might be a porcupine.
Re: Normalize, analyze, peak level and replay gain
« Reply #5 on: November 15, 2005, 02:23:43 pm »

There seems to be a problem with the 11.1 builds with Replay gain. Me and Marko have reported this in the build threads.

Replay Gain does seem a bit dodgy now in 11.1 builds. 
I've been woken up a few times at night now, because all of a sudden the music is so much louder.  I really don't remember having this problem in MC 10. 

mhakman

  • World Citizen
  • ***
  • Posts: 206
Re: Normalize, analyze, peak level and replay gain
« Reply #6 on: November 17, 2005, 03:16:41 pm »

Thanks all for the response.

Do not normalize during ripping. It alters permanently the file volumes and destroys the relative track volume differences inside the albums.

I understand better now what MC does during normalization and I agree with you. My intent was to normalize whole albums so that each album becomes recorded at the same level and uses the whole 16 bit range as much as possible. I never intended to normalize individual album tracks. It looks that until MC implements such album normalization I would have to do it outside MC.

I never normalized my encoding, instead relying on replay gain, which I can turn on and off at will. I agree that replay gain can sometimes make odd choices, although it's right far more than it's wrong. I think the reason is that the algorythm has to make a choice between max amplitude and average amplitude, whereas we know loud when we hear it.

I’m using MC to manage a kind of master library and then I convert files to other formats for distribution to various players in my family. I’m converting (syncing) the files outside MC because MC’s virtual handheld device doesn’t do what I need – I need make-like functionality with syncing done based on timestamps. In this situation MC’s replay gain cannot be easily used.

Actually, this very strange. Since you are using FLAC you should get exactly the same peak level. In any case, the difference should be small even with lossy formats. Could you verify that the same thing happens with APE and wave? It might be a bug.

I agree, very strange. Can it be that MC analyses original wav file when analyzing during rip but it analyses FLAC file without decompressing when analyzing manually? Or does MC analyze before normalization? Or does FLAC normalize when compressing?

I’ll come back concerning the other formats.

BTW, the standard question: Your system info?

Currently MC 11.0.316 runs on a W2K Server, I have also the new alpha version on XP Pro, both os'es with all fix packs.

Edit: Also, MC should not say anything about normalizing if it is disabled.

It does.

Replay Gain does seem a bit dodgy now in 11.1 builds. 
I've been woken up a few times at night now, because all of a sudden the music is so much louder.

I made this experience too but without using replay gain. After listening to some classical music at comfortable for active listening level I played The Rolling Stones - A Bigger Bang. My Lord, that was The Big Bang experience – I was worried not only for the health of my ears but also for my headphones – and I do like loud music!. With replay gain I get very quiet sound and I cannot get maximum volume level from any track however I turn the controls.

Thanks/Mikael
Logged

JONCAT

  • Guest
Re: Normalize, analyze, peak level and replay gain
« Reply #7 on: December 14, 2005, 07:23:27 am »

Marko,

Thanks for the heads up on this:

"You'll get the most accurate results if you analyze the compressed files after encoding and enable the "Album based" and "Automatic based on current playlist" options on playback. All albums will play at the same maximum volume and the track volume differences inside the albums will be preserved."

I do a question regarding RG in general but maybe it releates to the bugginess in the 11.1 builds:

Most of the time I play music from one genre, about 13,000 files from all different albums and ripped vinyl (average rms -10 and peaks around -.3) My question is doesn't RG always shoot for a a db level of -89? If I select Auto On Current Playlist an play a new album like Beck's Guero, the Auto Based On Current Playlist toggle counters the RG redutction i.e. as you said playing at maximum volume. So why if I turn off that toggle does it drop -14db? Is this setting, no adjustment, making it relative to every file in my archive? Even so, shouldn't Replay Gain be shooting for that -89db?

I am trying to add gain with my Emu mixer after it is sent to the Emu fader, so a consatnt -89db would work great . What I observe is usually RG is reducing on average -10db. I can't use a Fixed adjustment because I do have files (a few) that need +db's and also cd's will then be clipping. I want to get more gain out of RG for ALL my tracks simultaneously and do get why RG would be reducing the same track different amounts when a constant -89db is expected.

I can only gather my expectation is wrong and this is not how RG operates.

Dr.C
Logged

JONCAT

  • Guest
Re: Normalize, analyze, peak level and replay gain
« Reply #8 on: December 14, 2005, 07:28:40 am »

I have tried what Marko suggeted and it may be doing what I wanted actually; need to check it out more.

thanks for your endless tirade of MC knowledge Marko!

Dr. C
Logged

mhakman

  • World Citizen
  • ***
  • Posts: 206
Re: Normalize, analyze, peak level and replay gain
« Reply #9 on: December 16, 2005, 09:34:36 am »

Replay gain as implemented today in MC doesn’t work well as indicated on both this and other threads here. As pointed out above the volume level is heavily reduced for all tracks when using RG. This means that one is losing some details in the music and introduces distortion due to limited precision of quantization. At 16 bit (most common D/A on sound cards and also resolution of CD music) there are only 65636 steps to represent audio signal. Humans hear well better than that. Reducing digital level to 50% leaves only 32768 steps. Furthermore, feeding this weak signal into your analog path makes you turn up your analog volume control in order to achieve appropriate sound pressure. This in turn decreases signal to noise ratio – not a very good thing to do.
   
In my opinion there should be 2 ways of controlling output level when playing audio, one based on peak level and one based on perceived loudness (replay gain). By peak level I mean maximum value of non-averaged signal, mathematically max(abs(s(t))) assuming signed quantization. By perceived loudness I mean the value that is computed by MC in its current replay gain algorithm or alike.

1. Controlling output level based on peak level should have the following sub options.

a) Play a track adjusting gain so that adjusted peak level for the track will be as specified. Most often the specified value will be 100%. Percentage is specified in relation to possible range given actual quantization resolution. For 16-bit signed quantization the maximum is 32767 and minimum is 32768. 100% means that either or both of these values are produced at the corresponding signal extreme points. If audio analysis hasn’t been done for the current track then it could be done just before playing or the user could be alerted that current replay settings cannot be maintained for that track.

b) Play a track adjusting gain so that adjusted peak level for whole album will be as specified. This requires that audio analysis has been done for all tracks within the album, alert user otherwise.

c) Play a track adjusting gain so that adjusted peak level for whole playlist will be as specified. This requires that audio analysis has been done for all tracks on the playlist, alert user otherwise.

d) Play a track adjusting gain so that adjusted peak level for all tracks in the library will be as specified. This requires that audio analysis has been done for all tracks in the library, alert user otherwise.

2. Controlling output level based on perceived loudness – I leave description of this topic to others on this forum because it isn’t clear to me what the user wants to achieve in this case. Should all tracks within chosen group (a, b, c, d above) play with the same perceived level? Or should the chosen group as a whole play with the same perceived loudness level as the other groups but keep loudness differences within the group? What other groups? The groups, especially playlists, need not to be disjoining so how do you asses that information?

In my opinion controlling based on peak level is more important and useful. It can also be implemented quite easily and scientifically exactly. Perceived loudness is more difficult to compute and there are many different opinions on how to do it. None of these, in some cases quite advanced algorithms, reproduce what humans actually perceive. This is because our perception and signal processing in our brain is even more advanced and also depends on the actual environment in which we hear the music and on what we do/did/hear/heard during and before the actual track.

/Mikael
Logged

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: Normalize, analyze, peak level and replay gain
« Reply #10 on: December 16, 2005, 10:11:25 am »

You'll get the most accurate results if you analyze the compressed files after encoding and enable the "Album based" and "Automatic based on current playlist" options on playback. All albums will play at the same maximum volume and the track volume differences inside the albums will be preserved.

- also, the Overflow handling: Clip Protection option should be enabled.

This just works. The files will play up to 100%, but do not clip. Digital clipping is worse than a small inaudible reduction of S/N.

MC uses 32-bit internal signal processing. I have set the output to 24-bit because my soundcard can handle that at max. The output is noise free even at the highest volume levels.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

mhakman

  • World Citizen
  • ***
  • Posts: 206
Re: Normalize, analyze, peak level and replay gain
« Reply #11 on: December 19, 2005, 06:41:05 am »

I do not object to RG as implemented today in MC. Except perhaps any eventual bugs. However, for my purposes, a peak level based RG as described above would be more useful. Because this kind of RG is very easy to implement then there are no reasons not to have both possibilities.

The reason for this thread is described very well by Dr. C above. This is also my experience and the reason for me not using current RG.

Quote
- also, the Overflow handling: Clip Protection option should be enabled.

This just works. The files will play up to 100%, but do not clip. Digital clipping is worse than a small inaudible reduction of S/N

There are no known ways to implement clipping protection without introducing distortion when protection “kicks in”. Clipping protection works by using asymptotic gain reduction at high levels and therefore the result is not the same as the original music. Digital clipping is of course worse than small reduction in S/N but using RG based on peak level prevents clipping altogether without distorting the music and without reducing S/N. Why do worse using complex algorithms when you can do better using simple algorithms?

Quote
MC uses 32-bit internal signal processing. I have set the output to 24-bit because my soundcard can handle that at max.

I agree – 32-bit internal processing together with 24-bit D/A gives you full resolution for 16-bit quantized signal (CD) even with digitally reduced output level.

Quote
The output is noise free even at the highest volume levels.

It will be even more noise free if you feed your soundcard with 100% signal.

 /Mikael
Logged

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: Normalize, analyze, peak level and replay gain
« Reply #12 on: December 19, 2005, 08:30:50 am »

AFAIK, MC's Replay Gain system follows mostly this guideline: http://www.replaygain.org/. MC uses the 83 dB target volume as proposed. Some other programs have later made a small compromise and use 89 dB because many users were already accustomed to a louder average volume level when they didn't use a replay gain system.
 
With the 83 dB target clipping is not likely to occur with lossless source files.
 
I think the additional Clip Protection is more useful with lossy encoded files that can have peak levels over 100% from time to time. I don't fully understand the mechanism, but lossy encodings are not tied to any bit depth, instead they use a floating bit depth and especially at smaller bitrates the peaks can be over 100%.

When I am in a perfectionist mood I often disable all DSP in MC when listening to losslessly encoded complete albums. MC can send bit-perfect digital output to an external DAC when ASIO drivers are used (if the used sound card doesn't resample). Then the output is exactly similar with a stand-alone hifi CD player that uses a digital connection.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

JONCAT

  • Guest
Re: Normalize, analyze, peak level and replay gain
« Reply #13 on: December 19, 2005, 09:35:37 am »

The ReplayGain setup that Marko described above works great when you play say, an album, you get minimal reduction.

But, if you select or add to playing now a genre of 10,000 files with RG data from -24db (lossy files with peak data over 100% I assume) to +9 (live shows maybe), using the the Album based w/ Auto Based on Current playlist method you'll get varying total db changes for DIFFERENT playlists or in my case genres.

The album based method is the best so as to not have to compensate with gain on a soundcard or amp, but in my case let's say I choose a song on an album through the tile view. That album is the "playlist" and added to playing now. I get 0db change it max output to amp without having to fuss with my software gain or hardware gain on my amp. But it I choose the same file out of 10,000 the db change is -10. Why? I still don't understand; shouldn't MC be shooting for -84db as a measurement in & of itself and NOT in relation to the other fles. It's true we want all files to be comparably reduced or increased to -84 but that doesn't mean the unique changes in gain to eacxh file should affect the achievement of the -84db gain. I have a genre that ranges from -16 to -8 Rg peak data and this genre plays back with minimal changes, so why does the above genre with -24 to +9 cause such a drastic uniform reduction?

Something is very fishy with playing files through the Tree>View Schemes and the Main Media mode e.g. Audio>Genre (Tiles) etc. ...even though you select a file on an album the RG data is used for the Tree>View Scheme you are in.
And to re-iterate, I can use other methods of RG to achieve a uniform reduction which I compensate for by increasing the aux output gain of the EMU software mixer, but when I switch playlists (as many people probably do - playing genres on random for example) I may get a new uniform change which then puts me into clipping - the most extreme example of this is if you swicth to playing an album by itself as I described above; suddenly you have zero reduction where you still have a gain compensation on amp or software mixer with clipping resulting.



I'm addmittedly a bit confused by all this, but the main question is why the RG data affects the achievement of -84db in that it uses the various adjustments of each song...to establish some mean I guess? Is -84db a measurement that can be only achieved in a comparative way?

DR. C


Logged

mhakman

  • World Citizen
  • ***
  • Posts: 206
Re: Normalize, analyze, peak level and replay gain
« Reply #14 on: December 20, 2005, 07:39:14 am »

Dr. C.,

Quote
The album based method is the best so as to not have to compensate with gain on a soundcard or amp, but in my case let's say I choose a song on an album through the tile view. That album is the "playlist" and added to playing now. I get 0db change it max output to amp without having to fuss with my software gain or hardware gain on my amp. But it I choose the same file out of 10,000 the db change is -10. Why?

This is probably because within those 10,000 tracks there are some that according to RG calculated by MC need 10 dB amplification above the digital clipping limit in order to achieve the same perceived loudness as some other loud tracks. Then the only thing that MC can do is to lower all tracks by 10 dB and then add that 10 dB to the quiet tracks. Whether this works right depends on correctness of the RG calculating algorithm i.e. how well it corresponds to the actual loudness perceived by a listener (provided no bugs in MC).  I don’t know about MC but you may be interested in my comments (below) on the algorithm.

/Mikael
Logged

mhakman

  • World Citizen
  • ***
  • Posts: 206
Re: Normalize, analyze, peak level and replay gain
« Reply #15 on: December 20, 2005, 07:54:53 am »

Description of Replay Gain calculation given on http://www.replaygain.org/ contains a number of errors and inconsistencies and statements made without any scientific proof whatsoever. Let’s analyze some of those.

1. Calculation of dB values.

The formula given on http://replaygain.hydrogenaudio.org/rms_energy.html does not convert RMS value to dB. The given formula is:

10*log10(Vrms_all+10^-10)      (1)

This is not how dB value is defined and therefore not how it should be calculated. The dB definition gives:

10*log10(Vrms_all/Vrms_ref)             (2)

where Vrms_ref is RMS of reference signal used in dB calculation – a dB value without reference level is meaningless. Instead of using correct formula the author adds a small value to RMS value (10^-10) “in order to prevent calculation of log(0) which would give an error”. 

Formula given by (2) is used when computing dB value given some known reference level as when the sound pressure (level) is measured by a microphone where the sound pressure at the threshold of hearing is used as reference. Normally this gives positive dB values.

When the sound is digitized the used reference level is instead the maximum RMS value that can be represented by the used quantization, giving normally negative dB values for other signal levels. This is because the “distance” from the lowest possible value will vary depending on the number of quantization bits and the resulting numbers would not be comparable. I.e. the maximum possible value is 0 dB and all others are negative. In this case Vrms_ref is given by:

Amax*sqrt(2)            (3)

where Amax is the maximum amplitude possible for a particular quantization.

If MC uses formula (1) then it may result in wrong RG being calculated.

2. Representative RMS value

Next problem is the specified method of picking up a representative RMS value given on http://replaygain.hydrogenaudio.org/statistical_process.html. The only information given is:

“How far down the sorted list should we look for a representative value? I tried values from 70% to 95%. For highly compressed pop music (e.g. the middle graph above, where there are many values near the top), the choice makes little difference. For speech and classical music, the choice makes a huge difference. The value which most accurately matches human perception of perceived loudness is around 95%, so this value is used by Replay Level.”

The author tried a number of tracks and subjectively judged by him perceived loudness and this is supposed to be representative for billions of people and tracks? This is not how science or engineering is done.

No other statistical measurements such as median or percentile values or integral or power spectrum are even mentioned.

3. Reference (target) value.

The author writes:

“Having calculated a representative RMS energy value for the audio file, we now need to reference this to a real world sound pressure level.”

Do we? Why?

Then the author chooses 83 dB as the target value because this value is numerically equal to the value specified by movie industry as adequate listening level in a cinema.

First of all, as described above, in digitally stored audio you don’t measure dB up from the threshold of hearing but down from the maximum level possible at used quantization width. So the question is how much below this maximum is that 83 dB. The answer is that we do not know. The reason for this is that while 83 dB in a cinema represents a real and therefore an absolute value, the values stored in digital audio are only relative numbers that relate one sample to another. The relation between a binary number feed into D/A converter (in your soundcard) to the sound pressure produced by your loudspeakers (or by your headphones) connected either to the soundcard or an amplifier connected to the card is not known. It depends not only on actual (analog) gain of the amplifier but also on the effect of the amplifier, size, effectiveness, and load of the loudspeakers (headphones) and the environment in which these things including you are when listening.

Therefore the 83 dB cinema recommendation is simply not relevant here. And therefore the right approach is to target 100% or 0 dB. If you do that then you will probably regain some of the -10 dB that we (Dr. C., me and others) are complaining about.

4. On the site there is a number of other statements given without any proof whatsoever that, in my opinion, reflect author’s personal preferences rather than scientific and empirically verified truths. On other occasions the author tries to describe for centuries known statistical knowledge as his own discoveries, such as for example that you don’t add RMS values but the squares and then you compute the resulting RMS.

All this together doesn’t exactly increase my confidence in what the RG author proposes the rest of the world should do.

/Mikael
Logged

JONCAT

  • Guest
Re: Normalize, analyze, peak level and replay gain
« Reply #16 on: February 01, 2006, 08:32:31 am »

I am still confused by all this that I thought I had sorted out i.e. Replay Gain is whack

I just don't get why the -89db point is seemingly not the same for varying playlists.

10 files on the same album that need -10db reuction to be at -89db.
They are all very similar in loudness, so upon local album playback or very small & similar playlist they are not reduced at all with Album Based/Based On Current Playlist (this is basically the same as turning off ReplayGain but cracking up or normalizing the files; the album's tracks are played at max volume but not each made as loud as possibly, like normalizing a giant wave file of varying amplitudes?)

So why when the same files are played in Genre or larger playlist are they reduced by -14. Because the illusion is that Album Based is actually usuing replay gain data why I don't think it is at all.

Track based with no adjustment provides what is listed as the RG data and this allows you to play back large playlists and have them at the relatively same volume.

I still wish there was a way to adjust the -89db mark to a higher setting instead of upping soundcard output which doesn't really work when encountering files with +RG data, I have tried a bunch of different "uppages" with my EMU patchmix and always eventually get clipping because even if the output showing as -20 fed back through wavelab something always ends up clipping eventually.

Dr. C
Logged

mhakman

  • World Citizen
  • ***
  • Posts: 206
Re: Normalize, analyze, peak level and replay gain
« Reply #17 on: February 01, 2006, 06:46:02 pm »

I am still confused by all this that I thought I had sorted out i.e. Replay Gain is whack...
Dr. C,

I think it works like this. When you play an album using Album based RG then, before actually playing, MC computes the sum of the whole album’s RG (ARG) and Peak Level (PL) for each track. If this computation (ARG + PL) for any track gives value larger than 0 db (clipping limit) then MC finds the track for which this clipping would be greatest (i.e. max(ARG + PL)) and decreases gain for all tracks by that value. It also adjusts gain by ARG for each track when playing. This is done so that the relation between signal amplitudes on different tracks is exactly as the artist wanted it to be ;) but different albums as whole will have approximately the same loudness, provided that ARG correctly reflects by humans perceived loudness. If PL values for each track on an album are about the same (as they often are) then this works as you describe it. If you also select Adjustment: Automatic based or current playlist, in DSP Studio then you get maximum possible level. At some point, on some tracks, on played album you will have signal level of 0 db – anything higher would cause clipping.

When you play large playlist, perhaps random picks from your whole library then you certainly have few albums that are so quiet that they have positive and perhaps large ARG but PL of the tracks on those albums are probably not so low. Now, if you add PL and ARG you get large positive value. All tracks on playlist will have this value subtracted because ARG itself adjusts albums to “equal” loudness so this anti-clipping adjustment must be done equally for all tracks. Again, Adjustment: Automatic based or current playlist will make additional adjustment so that max(ARG + PL + extra) for some points and some tracks will be 0 db. This is the best you can do. Note that even if you never actually play these quiet albums because random walk never gets there before it is time to close down for you, MC cannot know this (it doesn’t know when you close) and it must assume that all tracks will be played.

This also shows, very clearly, that RG scheme breaks (not MC’s fault) when you have loud and quiet tracks in your library and try to play a list containing both. Author of RG thinks that there are more people benefiting from using RG than audiophiles who don’t. MC obviously buys into this reasoning. I don’t – please adjust my albums based purely on PL. I do not whish a flute concerto with low average volume but high dynamics to sound as loud as Rolling Stones with high levels but negligible dynamics – this is not how music, neither flute nor RR sounds in reality. As for the music itself, I like them both.

I don’t know about your equipment but if you pass digital audio from your computer to an external D/A then you can adjust levels in the analog path and keep digital signal at maximum using RG. Of course, if your analog equipment allows you to increase analog gain beyond its clipping limit (for full digital input) then if you do that you will, sooner or latter,  have it clipping (or limiting if you use that technology).

/Mikael
Logged

JONCAT

  • Guest
Re: Normalize, analyze, peak level and replay gain
« Reply #18 on: February 01, 2006, 08:17:27 pm »

I want to read over your post again, but just wanted to say that I am using Track-Based with no adjustments; treat each files PL individually.

I do understand these concepts well enough to understand why RMS is not needed in the RG calculation, because from what little I discern is that RMS is loudness.

Right now I am sending the ASIO fader at 0db (but RG'd audio) to the aux send which then sends out +7.7 db. Applying the FIXED boost after MC and RG. Monitoring the return signal from my pre-amp I am a good -5db and things sound fine. Probably not bit perfect but I use my ears and they are happy.

I did consider running the output at +4db into the tube pre RCA inputs but realized that wasn't a good idea.

DR. C
Logged

JONCAT

  • Guest
Re: Normalize, analyze, peak level and replay gain
« Reply #19 on: February 09, 2006, 02:24:33 am »

I'm back with "RG is whack"...

the basic fact of its operation is that if 10 tracks are lowered by -5db they should not ever be changed by a different amount to achieve -89db. Obviously that's not what RG is doing.

When you get values (songs that vary greatly) RG must be adjusting the -89gb point to make it easier to achieve some kind of accurate curve.

Think about it. Is this something to do with MC's implementation? I doubt it. If I measure song A and it needs a -12db reduction why should it ever need any OTHER reduction. If other files get analyzed then they should have their own according reductions. This fixed -89db point is a myth. My goal is for a Track based/no adjustment for all tracks. You can not achieve this with RG in MC right now e.g. playback from album vs. playback of genre or view scheme. My solution to post-ASIO volume increase fails because this -89db poitn differes and the analyzation is not perfect or wholly innacurrate as someone alluded to earlier.

I'd love to here someone chime in here, and I will read over the above posts again, but I am trying to get my BASIC idea down in the simplest terms so I can still understand what the heck I'm talking about.

Dr. C
Logged

mhakman

  • World Citizen
  • ***
  • Posts: 206
Re: Normalize, analyze, peak level and replay gain
« Reply #20 on: February 09, 2006, 05:44:14 am »

... the basic fact of its operation is that if 10 tracks are lowered by -5db they should not ever be changed by a different amount to achieve -89db. Obviously that's not what RG is doing.

... This fixed -89db point is a myth.
Dr. C,

I think this -89 db is simply a confusion of notions. In the original RG paper is was +83 db and still confusion. This +83 db is “appropriate” sound level (measured from the limit of hearing) in a cinema. In digital signal processing the target level is 0 db (=clipping level) which is about the same as in recording studios and then you measure other levels down from 0, not up from hearing limit as in cinemas. Nevertheless RG is doing the right thing if you wish to use RG and turn it on and also turn on the automatic adjustment. Provided that RG value correctly reflects loudness perceived by humans (which we know that it doesn’t do perfectly), and that MC calculates this value correctly according to the paper referred to earlier in this thread (which I presume it does) then the result for track based RG is as follows.

Every track in current playlist (which may be your whole library) sounds with about the same loudness (RG ensures it) and 0 db will be reached for signal levels that after RG compensation are at the very maximum among all tracks (and time points) on current playlist (automatic adjustment ensures it). In plain language it means approximately the same loudness and most efficient usage of available dynamic range without clipping or limiting. From this follows that if you choose another set of tracks to play (another playlist) then the listener may perceive another loudness (as compared to the previous playlist) but all tracks on this new playlist will have the same loudness and maximum level will still be 0 db. I have verified this empirically.

If you want your listeners to perceive the same loudness every day and every hour then you should play tracks from a list that contains all your tracks.

Let’s see how it works with an example. Day 1 you play a playlist with 2 tracks:

Track A needs RG -5 db and has peak level of -3 db (clipping level is 0 db).
Track B needs RG +5 db and has peak level of -3 db.

After RG compensation you get following peak levels:

A: -3 – 5 = -8
B: -3 + 5 = +2

MC computes this before you start playing anything. In order to achieve max 0 db level for track B MC has to subtract additional 2 db from the signal. Because A and B are already of equal loudness then MC must also subtract 2 db from track A. The resulting peak levels:

A: -8 – 2 = -10
B: +2 – 2 = 0

Day 2 you play a playlist with 2 tracks:

Track A the same as day 1
Track C needs RG -4 db and has peak level of -3 db.

After RG compensation you get following peak levels:

A: -3 – 5 = -8 db
C: -3 – 4 = -7 db

Now MC should add 7 db to both in order to achieve 0 db at the very peak. The resulting peak levels are:

A: -8 + 7 = -1
C: -7 + 7 = 0

Therefore track A will sound much louder day 2 (-1 db peak) than it sounded day 1 (-10 db peak). Note that both days you will reach 0 db somewhere.

If MC wouldn’t do this extra adjustment then track A would reach -8 db, track B would reach +2 db (and had to be clipped or limited) and track C would reach -7 db.

If you put all 3 tracks on one list and then play then you get following peak levels after RG both days:

A: -3 - 5 = -8
B: -3 + 5 = +2
C: -3 – 4 = -7

Then RG subtracts 2 db to get 0 db:

A: -8 – 2 = -10
B: +2 – 2 = 0
C: -7 – 2 = -9

There is simply no way to get more of A or C if you don’t want B to clip and still keep the same relative loudness.  This is the main problem with RG and this is why I don’t want it. And again, a flute concerto shouldn’t sound as loud as A Bigger Bang. That is, in peaks yes, but in average no. Unless the flute is Jethro Tall of course, but his flute is a saxophone camouflaged to a flute so it moves the air resolutely enough!

Perhaps there is a way to tell MC to do RG and adjustment based on all tracks in the library but still play a smaller playlist so that you achieve the same loudness each hour and day. I cannot find how to do it.

Mikael

Technique is necessary as it moves the air under the wings that make music fly – Isaac Stern.
Logged

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: Normalize, analyze, peak level and replay gain
« Reply #21 on: February 09, 2006, 06:01:50 am »

I think this -89 db is simply a confusion of notions. In the original RG paper is was +83 db and still confusion.

... and MC uses the "original" 83 dB, not 89 dB like some other programs.

Quote
Perhaps there is a way to tell MC to do RG and adjustment based on all tracks in the library but still play a smaller playlist so that you achieve the same loudness each hour and day. I cannot find how to do it.

AFAIK, "Adjustment: None" can do the trick. When a new track starts to play MC uses exactly the replay gain value written in the library database field (track gain) or calculated by MC (album gain). Album gain keeps the quiet flute tracks in correct relative volume. This works well enough for me (except that I prefer to use the "Automatic based on current playlist" option).

I have also the volume buttons in the amp's remote control for further adjustments. Before the PC based music archive and Replay Gain functionality I had to use the buttons a lot more.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

JONCAT

  • Guest
Re: Normalize, analyze, peak level and replay gain
« Reply #22 on: February 09, 2006, 06:44:06 am »

Off to work - quick note for ALEX B - I noticed that too with Adjustement:None but something was clipping the other day.

Another problem is the differenc in VU meters...Wavelab monitoring a looped input Wav>ASIO shows lower levels tan my EMU mixer on output to the amp. But I guess my pre-amp is modifying the signal or is this an accurate way to check the output levels of the EMU 1212M?

I wish MC used the -89...would that be hard to change?

Dr. C
Logged

mhakman

  • World Citizen
  • ***
  • Posts: 206
Re: Normalize, analyze, peak level and replay gain
« Reply #23 on: February 09, 2006, 10:09:08 am »

... and MC uses the "original" 83 dB, not 89 dB like some other programs.

It would be interesting to know what reference level is used when computing these +83 dB. What is 0 dB in this case?

Quote
AFAIK, "Adjustment: None" can do the trick. When a new track starts to play MC uses exactly the replay gain value written in the library database field (track gain) or calculated by MC (album gain)… This works well enough for me (except that I prefer to use the "Automatic based on current playlist" option).

Exactly, with “Adjustment: None” one gets clipping as in example above for track B which Dr. C. observed:

Quote from:  Doctor Cilantro
… I noticed that too with Adjustement:None but something was clipping the other day.

One way to accomplish “Adjustment: None” without clipping is to select the whole library as playlist, start playing a track there, and then select “Adjustment: Automatic based on current playlist”. Write down the resulting adjustment. Then select “Adjustment: Fixed” and enter manually the number above. This should work until you add or remove tracks from the library.

Quote
Album gain keeps the quiet flute tracks in correct relative volume.

Well, what should a poor man like me do if he listens one moment to the quiet flute and next to A Bigger Bang, from the same playlist but not album-wise?

Mikael
Logged

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: Normalize, analyze, peak level and replay gain
« Reply #24 on: February 09, 2006, 02:40:57 pm »

Exactly, with “Adjustment: None” one gets clipping as in example above for track B which Dr. C. observed...

With this 83 dB target the "Adjustment: None" setting is usually very quiet when compared with tracks played without any replay gain system. I wonder if clipping ever happens in real life.

Quote
Well, what should a poor man like me do if he listens one moment to the quiet flute and next to A Bigger Bang, from the same playlist but not album-wise?

For example, here are two different Playing Now playlists:



The Album Gain setting plays always the Four Seasons tracks at -4.90 and the Farinelli tracks at -1.55. The quiet tracks will remain relatively quieter. Only the overall album gain difference (3.35 dB) is corrected.

Or do you mean something else?
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

JONCAT

  • Guest
Re: Normalize, analyze, peak level and replay gain
« Reply #25 on: February 09, 2006, 06:17:01 pm »

In regard to clipping happening in real life.

Let's say the -82 is too quiet....it lacks punch from the living room (I'm waiting on some Saitek speakers to try in there), I've got two 25watt mono-blocks running off a Sunfire pre-amp into 102db/w senstive speakers....often the punch is just lacking with RG enabled.

So I set RG for all tracks to playback the same and add volume AFTER the strip on the EMU mixer. Not on the pre-amp but on the output of the EMu software mixer. Basically if RG has lowered some tracks but -20db and other +1...I am assuming that all tracks are at -82db so I should be able to up the volume on the mixer after the 0db ASIO strip while monitoring the input back into the soundcard from the pre-amp. I fugured I could boost about 7db and leave about 5 for headroom...this is where I will inevitably get clipping during some transient peak in a song and also because of the RG claculation being less than perfect.

I can't up the volume on the ASIO strip because then I am guarenteed clipping on +RG data tracks.

I am not sure I have this right but that's what I have been experiencing.

Dr. C
Logged

JONCAT

  • Guest
Re: Normalize, analyze, peak level and replay gain
« Reply #26 on: February 09, 2006, 06:58:35 pm »

Mikael -

Thanks for your comments, especially the post that contains your analysis of the RG calculation.

This I find most interesting:

"First of all, as described above, in digitally stored audio you don’t measure dB up from the threshold of hearing but down from the maximum level possible at used quantization width. So the question is how much below this maximum is that 83 dB. The answer is that we do not know. The reason for this is that while 83 dB in a cinema represents a real and therefore an absolute value, the values stored in digital audio are only relative numbers that relate one sample to another. The relation between a binary number feed into D/A converter (in your soundcard) to the sound pressure produced by your loudspeakers (or by your headphones) connected either to the soundcard or an amplifier connected to the card is not known. It depends not only on actual (analog) gain of the amplifier but also on the effect of the amplifier, size, effectiveness, and load of the loudspeakers (headphones) and the environment in which these things including you are when listening.

Therefore the 83 dB cinema recommendation is simply not relevant here. And therefore the right approach is to target 100% or 0 dB. If you do that then you will probably regain some of the -10 dB that we (Dr. C., me and others) are complaining about."

I'll send this stuff onto my brother and a few friends. Can we get word from someone at MC about this? I know there are some major brains over there....shooting for 0db sounds appealing.

Dr. C
Logged

JONCAT

  • Guest
Re: Normalize, analyze, peak level and replay gain
« Reply #27 on: February 09, 2006, 07:15:02 pm »

Well I got one answer, in regard to running +4 signal out from the 1212m into the Sunfire Classic.

"+4 what? dBm? What's the reference? (I don't know much about soundcards.)

As Duke said, most tube preamps are very tolerant of large signals. My Peach would take easily 1000mV input. In any event, you will either hear a huge distortion, or not, and it's not the kind of thing that would damage a preamp.
md"

Dr. C
Logged

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: Normalize, analyze, peak level and replay gain
« Reply #28 on: February 10, 2006, 02:26:13 am »

Hmm...

AFAIK, the 0 db point with 16-bit digital audio (CD audio) is the maximum possible waveform height (or something like that...) and the maximum possible dynamic range is then 96 dB.

This is probably completely wrong, but one would like to think that the 83 or 89 dB reference means that the "average maximum" (again, I am unsure about the terminology) is at that level when compared with the maximum possible dynamic range. With uncompressed music like classical the peaks can still reach the maximum possible value. The 83 dB point would be safer than 89 dB in this sense. However, MC uses a 32-bit system internally and I don't quite understand what effect this has. I guess I really have to check how this works. (Matt, could you explain this, please?)

You can make MC to use the 89 dB reference simply by adding +6 dB fixed adjustment to the replay gain.

Personally, I have found that my integrated stereo and 7.1 channel amps have always enough volume adjustment available. I can easily get the max power out of the power amp stages even when using unadjusted replay gain correction. I have a Terratec DMX 6fire 24/96 sound card on my main HTPC system. Actually, its control panel does not even have a boost possibility. The mixer sliders can only decrease the volume.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

mhakman

  • World Citizen
  • ***
  • Posts: 206
Re: Normalize, analyze, peak level and replay gain
« Reply #29 on: February 10, 2006, 06:31:38 am »

Decibels measure a relation between 2 levels. Saying that some level is at 6 dB is about as clear as saying that a car is twice as fast. Twice as fast as what? 6 dB from what? Therefore we need to know the reference level when we talk about dB. Sometimes this reference is well established so you don’t need to say it every time. When measuring real sound levels this reference is the limit of human hearing. Below that level we don’t hear any sound. This doesn’t mean that there are no sounds below, only that humans cannot hear them. When we talk about RG then this reference is not clear. 83 dB or -83 dB from what?

Quote
…one would like to think that the 83 or 89 dB reference means that the "average maximum" … is at that level when compared with the maximum possible dynamic range.

Maximum dynamic range for 16-bit D/A is 96 dB as you wrote Alex, but for 24-bit D/A it is 145 dB.  In both cases the reference is 1 bit. If I subtract 96 from 83 I get -13 dB which should be interpreted as 13 dB below clipping but if I subtract 145 from 83 I get -62 dB which should be interpreted as 62 dB below clipping. However, a signal exactly at the clipping limit will produce the same sound level in your listening room no matter which D/A you use, all other factors being equal. So, how much below clipping is that 83 dB? An explanation from MC team is definitely needed.

On the other hand I have verified that RG plus automatic playlist-based adjustment in MC gives peak levels at clipping limit but not above – the target is clipping limit, which is correct.
 
/Mikael
Logged

mhakman

  • World Citizen
  • ***
  • Posts: 206
Re: Normalize, analyze, peak level and replay gain
« Reply #30 on: February 10, 2006, 06:46:46 am »

Or do you mean something else?
This is what I need.

In addition to current RG option in MC I need Peak Level-only based adjustment. I wrote this before but I repeat it here again. This new option should have 4 suboptions:

1. Track based – adjust outgoing signal so that peak level for current track will be 0 dB.
2. Playlist based – adjust outgoing signal so that peak level for the whole list will be 0 dB.
3. Album based – adjust outgoing signal so that peak level for the album to which current track belongs will be 0 dB. If album is not specified (blank, unknown, null etc) then fall back to suboption 1 above.
4. Library based – adjust outgoing signal so that peak level for the whole library will be 0 dB.

Do not do any RG when one of above 4 suboptions is selected.

/Mikael
Logged

JONCAT

  • Guest
Re: Normalize, analyze, peak level and replay gain
« Reply #31 on: February 10, 2006, 08:21:09 am »

Mikael's right, for more than one reason, we need more options:

I playback track 1 on album A with Album Based/Auto Adjust and it's fine...0db output

If I decide to play my reggae genre with 13,000 files I would have to manually swtich to Fixed Adjustment to counter the -13db RG employed...this is going to lead to clipping eventually when way or another.

MC should use employ "RG tags" for playlists, genres, view schemes and the like.

I am still ruminating on RG, but I feel there is something very simply that can express one major problem with RG.

Maybe this is it as Mikael said "This is the main problem with RG and this is why I don’t want it. And again, a flute concerto shouldn’t sound as loud as A Bigger Bang. That is, in peaks yes, but in average no. Unless the flute is Jethro Tall of course, but his flute is a saxophone camouflaged to a flute so it moves the air resolutely enough!

Perhaps there is a way to tell MC to do RG and adjustment based on all tracks in the library but still play a smaller playlist so that you achieve the same loudness each hour and day. I cannot find how to do it."


Dr. C
Logged
Pages: [1]   Go Up