How to calculate LUFS?

#1

Can anyone help me out with how to actually calculate the LUFS/LKFS value of a signal? I can’t find any sources anywhere online and no textbooks seem to mention it.

0 Likes

#2

Here you go (PDF)

0 Likes

#3

If you want to go one step beyond, there is also R128 at the European Broadcast Union (EBU) for loudness normalisation, and the measurement algorithm is available from @samuel (:wave:) at https://github.com/klangfreund/LUFSMeter.
(and also as plugin to buy: https://www.klangfreund.com/lufsmeter/) - highly recommended

0 Likes

#4

This is great, thanks both!

0 Likes

#5

Haven’t mentioned it here yet:

I’ve changed the license from GPL2 to MIT a few month ago. Feel free to use it for whatever you want. :wink:

2 Likes

#6

The standard defines the filtering through coefficients at a fixed sample rate, which is rather silly IMO. If you need to support multiple sample rates, here are filter parameters that should meet the requirements (that’s how I’ve implemented it at least):

Pre-filter (high pass)
cutOffFrequency = 37.5 Hz
Q = 0.5

RLB (high shelf)
crossOverFrequency = 1500 Hz
gain = 4.0 dB

Both filters are 2nd order Butterworth filters. De-cramping should not be necessary for normal sample rates.

Best,
Stian

2 Likes

#7

Thank you @stian.

Yeah, it is silly to specify a filter by only providing the coefficients for the fixed sample rate of 48kHz! This actually lead to implementations of ITU BS.1770 where resampling to 48kHz is used before the filter stage.

If someone ever needs a 2nd order IIR filter defined by the coefficients for a given sample rate (Currently 48kHz is hardcoded, but it’s easy to change), take a look at:
https://github.com/klangfreund/LUFSMeter/blob/master/filters/SecondOrderIIRFilter.h
The documentation of the derivation is provided as well:
https://github.com/klangfreund/LUFSMeter/tree/master/docs/developmentNotes/111222_filter_coefficients

2 Likes