HydrogenAudio

Hydrogenaudio Forum => Scientific Discussion => Topic started by: garfield85 on 2012-01-18 08:43:58

Title: Help needed for Gain calculation for audio signal for target loudness
Post by: garfield85 on 2012-01-18 08:43:58
ITU standard talks about loudness calculation of audio signal. EBU mainly talks about programme loudness, LRA and true peak calculation and also gives standard acceptable value for programme loudness (-23LUFS).
It also says if the programme loudness varies from this value, the signal must be amplified/attenuated to achieve target value.

My question is how that gain is calculated to be applied to audio signal?
Ex. If programme loudness comes out to be -18LUFS, this means I should give 5LU attenuation to my audio signal.
So, what this "5LU" transforms to in time domain so that I can multiply this to my audio signal?

How this is calculated and if there is any document/spec etc explaining this would be helpful.
Title: Help needed for Gain calculation for audio signal for target loudness
Post by: [JAZ] on 2012-01-18 19:03:17
The simple answer is that LU is like dB. I.e. it is a logarithmic scale.

There are people here more knowledgeable in this area, which I hope they will give the correct values, but this is how to calculate it based on dBs:


This is C code for conversion of dBs:

   /// linear -> deciBell
   /// amplitude normalized to 1.0f.
   float inline    dB(float amplitude)
   {
      return 20.0f * std::log10(amplitude);
   }

   /// deciBell -> linear
   float inline    dB2Amp(float db)
   {
      return std::pow(10.0f, db / 20.0f);
   }
Title: Help needed for Gain calculation for audio signal for target loudness
Post by: chi on 2012-01-18 19:35:34
For a more formal specification, see EBU Tech 3343 (http://tech.ebu.ch/webdav/site/tech/shared/tech/tech3343.pdf) (Practical guidelines for production and implementation in accordance with EBU R 128), especially section 6.2 scenario b. It also says in section 2: “For relative measurements, Loudness Units (LU) are used, where 1 LU is equivalent to 1 dB”, which is essentially what [JAZ] wrote above.
Title: Help needed for Gain calculation for audio signal for target loudness
Post by: garfield85 on 2012-01-19 05:23:45
Thanks for the reply. I have gone through EBU tech 3343 and was thinking of the same but the loudness calculation is quite different than simple logarithmic calculation.
According to ITU BS.1770-2, the loudness calculation uses K-filtering, mean square, then weighted gain to each channel and then its summation.
My doubt is, its conversion back to time domain could not be simple anti-logarithmic scale.

Ex. if my signal needs +5LU gain then i doubt that simply multiplying each channel with "pow(10.0, 5 / 20.0)" will be enough.
Title: Help needed for Gain calculation for audio signal for target loudness
Post by: pbelkner on 2012-01-19 06:48:06
How this is calculated and if there is any document/spec etc explaining this would be helpful.

Cf. e.g. this thread:[blockquote]http://www.hydrogenaudio.org/forums/index....showtopic=85978 (http://www.hydrogenaudio.org/forums/index.php?showtopic=85978)[/blockquote]