Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: I need help trying to understand ReplayGain and its metrics (Read 894 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

I need help trying to understand ReplayGain and its metrics

I've been using ReplayGain for almost two decades now, and I understand at least the basic idea of what it does: It uses pre-calculated tags to determine an appropriate gain modification for each track or album in order to prevent wild swings in listening volume upon playback, all without modifying the stored audio data. I also know that I can preamp the gain lower or higher in a program like foobar2000, from -20dB to +20dB. This much I understand.

What I need help wrapping my head around is the metrics, or the numbers involved. There is another thread here in which the OP is saying that 89dB is too much for specific tracks, and that 85dB is better. What I'm having trouble understanding is what these numbers are derived from; what they are in relation to. Someone also answered me that 89dB in this casecorrelates to -18 LUFS, which is an entirely new measurement to me and I definitely don't understand it aside from that it is meant to be a measure of loudness.

I am used to thinking about digital gain/volume in relation to dBFS, usually as a negative value ranging from -0 to -n. This makes sense to me since there is a limit to how many bits there are in a sample, and once the sample is saturated there is no increasing the gain. Why does ReplayGain use a seemingly absolute value instead of, say, -11 from 0dBFS? I can assure you that my music player does not know the sensitivity of my speakers nor does it know the adjustment of analog volume controls in between. What is 0dBFS in relation to the 89dB mentioned? Would it be -7 from 96dB? Or maybe -11 from 100dB? And what about LUFS? What dB would 0 LUFS be?

I have tried reading several wiki pages and explainers of ReplayGain, but I have not found anything that answers these questions for me. I concede I may be thinking about this with entirely the wrong mindset, but I need help understanding if so, please. Thank you.
Think millionaire, but with cannons.

Re: I need help trying to understand ReplayGain and its metrics

Reply #1
There is another thread here in which the OP is saying that 89dB is too much for specific tracks, and that 85dB is better. What I'm having trouble understanding is what these numbers are derived from; what they are in relation to.
I think you're making it more complicated than necessary.  Everything is relative.  The "89dB" in this case refers to the figure in the settings which provides user control to tweak the RG-normalised volume level.  So setting this to 85dB instead simply reduces the overall gain in the system by 4dB.

The reason this might be important is if a track with low overall loudness has brief high-loudness passages in it, then boosting the volume of the whole track could digitally clip the peaks.  Digital clipping is when the numeric value of an input digital sample, when multiplied by the scaling factor, then exceeds the maximum value the processing or the DAC can handle.

From the point of view of digital audio processing, dBFS is vitally important because 0dBFS is the onset of clipping.

So far, the above is all about actual signal levels, measured as a digital value or a voltage.  The confusion starts because RG and LU are weighted according to human acoustic response, so contributions in the high and low frequency range are less important than the middle frequency range.  That means a single frequency sine wave at (say) 500Hz and -10dBFS might be -10dBLUFS, but 2kHz -10dBFS might be -20dBLUFS.  Thus there is no simple relationship between signal voltage and LU, it depends on spectral components.

So you have an RG tag value generated using a psycho-acoustic model to assess the overall loudness of a track relative to some arbitrary "RG standard loudness", best expressed in LU, followed by a user gain fudge factor because if the RG-adjusted output were standardised at a level which accommodates highly-dynamic tracks (eg classical) without risk of clipping, listeners of constant volume pop music would complain it was coming out too quiet (if they're listening directly to the PC output instead of feeding it into an amp with a volume control!).

The "89dB" is the fudge factor.  It's arbitrary because of the lack of a simple arithmetic relationship between LU and signal voltage (and therefore clipping).  It might have been better represented and meaningful, but it is what it is.

It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: I need help trying to understand ReplayGain and its metrics

Reply #2
I think I understand. I will read again and think about it. Thank you very much for the thoughtful response!
Think millionaire, but with cannons.

Re: I need help trying to understand ReplayGain and its metrics

Reply #3
If I'm not mistaken, the dB used by ReplayGain is dB SPL (sound pressure), which is not the same thing as the dB of "0 dB is the maximum loudness without clipping", which measures the loudness on the digital scale used for sampling (+32767 to -32768 for 16-bit CD audio). That's why 89dB doesn't line up with -18 LUFS. The 89 dB of ReplayGain is dB SPL, whereas LUFS is using dBFS (full scale), so the numbers are negative relative to full scale.

Re: I need help trying to understand ReplayGain and its metrics

Reply #4
The relationship between 89dBSPL -18dB* digital (or whatever the digital level is) is somewhat arbitrary.   

There have been studies showing that 85dB SPL is the preferred volume in movie theaters.   Movie theaters ARE calibrated and that's about the only place there is a known relationship between digital and acoustic levels.  (And they allow 20dB of headroom.)

I believe the original ReplayGain algorithm used 85dB but people complained that their music was too quiet.   ...But there is still that arbitrary relationship between the digital and acoustic level.

They had to choose a standard SPL level to because they had to choose an Equal Loudness Curve which are different at different sound levels.

It would have been clearer if ReplayGain used an actual digital level and simply noted that it's based on listening at 89dB SPL.



* The digital level is a kind of average like RMS, or more like LUFS which takes frequency content into account.  But the LUFS algorithm hadn't been standardized when ReplayGain was first created.

Re: I need help trying to understand ReplayGain and its metrics

Reply #5
Just to note that any particular SPL can be achieved (assuming the hardware is capable) by setting the "master volume control", independent of the signal voltage!  It is therefore meaningless to even try to relate SPL to dBFS.
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: I need help trying to understand ReplayGain and its metrics

Reply #6
Thank you all! I understand ReplayGain a lot better now.
Think millionaire, but with cannons.