klangfreund / LUFSMeter

An implementation of the loudness measurement algorithm ITU-R BS.1770
212 stars 30 forks source link

Questions and Help #8

Open syong39 opened 1 year ago

syong39 commented 1 year ago

Hello.

While reading the code, I came across some questions. I'm having difficulty understanding

1. "Bin" in Ebu128LoudnessMeter.h and .cpp. Could you explain each of the variables for me? I'm not sure what "Bin" means.

image

2. Regarding the if statement in the STEP3 section of Ebu128LoudnessMeter.cpp's processBlock, I'm not quite sure what the condition means.

like this

if (numberOfSamplesInTheCurrentBin + bufferForMeasurement.getNumSamples() < numberOfSamplesPerBin)

image

Thank you for reading this and have a nice day.

klangfreund commented 1 year ago
  1. The comment for bin explains it in detail:

https://github.com/klangfreund/LUFSMeter/blob/783a59d78c31e52b3a50b52d9afaadf3118f7536/Ebu128LoudnessMeter.h#L143-L166

Also take a look at the visual representation of the algorithm at

https://github.com/klangfreund/LUFSMeter/blob/master/docs/developmentNotes/141017_LUFS_Meter_IntegratedLoudness.png

The bins are the sums (accumulators) on the top row.

  1. The condition is explained in the comment directly above the condition. Once you understand your first question, you'll probably get this too.

Cheers