Thanks Julius!

On Wed, 2022-05-11 at 20:05 -0700, Julius Smith wrote:
> > 1. how does this help if we need reference sine tones from another
> > source? I did a series of test tones in Reaper, all normalised to -
> > 18lufs. Here ist the test-
> > audio: https://cloud.4ohm.de/s/c7ynWemXS9eXibH
> 
> Ok, so you're saying you want to take these Reaper-generated sine
> files as ground truth.  I was just probing the system with known
> sines, which I trust for sure.
Well, yes, probably I trust them ;) I also loaded Klangfreund lufs
meter and ebumeter. They all show the same.

> > 2. at 1000Hz and levels above -45db, the lufs readout seems
> > plausible. Below -45dbfs, the meter falls to -69lufs. I don’t
> > understand.
> 
> This is curious.  For me that behavior kicks in around -32 dBFS.  It
> goes away in double precision, so I think it has to do with
> "max(ma.EPSILON)".
> However, while EPSILON is indeed around -70 dB when interpreted as
> power, it should not suddenly take a large drop like that.  It should
> just clip.
> In any case, this is a trivial one - we can just use "faust -double"
> (and probably should anyway).
double precision is not available in faustide, right? I will try and
install faustlive today. Or would you recommend some other ide
solution? (I am on arch linux.)

> > 3. probably just some coding style, but does amp =
> > 10^(level/20); equals amp = level : ba.db2linear; ?
> 
> Yes, no difference expected.  "Finger macro" - fewer characters to
> type :-)
Yay :)

> > 4. with amp = level : ba.db2linear; meter drops to -69lufs below -
> > 40dbfs at 1000Hz…
> 
> Same glitch as in 2, right?
Yes.

> So, it sounds like the filter polishing task is to make the Faust
> implementation match Reaper, but how do we know Reaper is correct?
> Since it's open-source, why don't we just copy its filters?

Yes! Here is the code of their JSFX loudness meter:
https://pastebin.com/Pu9CVeBC

unfortunately, I don't understand JSFX language :(
Do you?

Thank you so much again for your help!
Klaus


> Cheers,
> Julius
> 
> On Wed, May 11, 2022 at 4:02 AM Klaus Scheuermann <kla...@posteo.de>
> wrote:
> > Hi Julius,
> > 
> > Hm, I think the averaging time should not matter with continuous
> > sine tones coming in, right?
> > (According to specs, 0.4 is the value for ‘momentary’ and 3 for
> > ’short term’.)
> > 
> > Some questions about your test-program:
> > 
> > 1. how does this help if we need reference sine tones from another
> > source? I did a series of test tones in Reaper, all normalised to -
> > 18lufs. Here ist the test-
> > audio: https://cloud.4ohm.de/s/c7ynWemXS9eXibH
> > 
> > 2. at 1000Hz and levels above -45db, the lufs readout seems
> > plausible. Below -45dbfs, the meter falls to -69lufs. I don’t
> > understand.
> > 
> > 3. probably just some coding style, but does amp =
> > 10^(level/20); equals amp = level : ba.db2linear; ?
> > 
> > 4. with amp = level : ba.db2linear; meter drops to -69lufs below -
> > 40dbfs at 1000Hz…
> > 
> > Thanks for investigating with me :)
> > 
> > Klaus
> > 
> > 
> > 
> > 
> > Klaus Scheuermann
> > kla...@posteo.de
> > +491716565511
> > @schlunk:matrix.org
> > 4ohm.de
> > trummerschlunk.de
> > 
> > 
> > 
> > > On 11. May 2022, at 04:50, Julius Smith <julius.sm...@gmail.com>
> > > wrote:
> > > 
> > > Hi Klaus,
> > > 
> > > Could the averaging time be too small?  I'm worried about the
> > > line
> > > 
> > > Tg = 0.4;// 3 second window for 'short-term' measurement
> > > 
> > > The comment seems to indicate it should be "Tg = 3;", i.e., 3
> > > seconds of averaging instead of 0.4 s.
> > > 
> > > Below is an expansion of your test program that allows for more
> > > exploration.
> > > 
> > > Cheers,
> > > Julius
> > > 
> > > import("stdfaust.lib");
> > > 
> > > freq = hslider("[0] Test Sine Frequency (Hz)
> > > [unit:Hz]",1000,30,16000,1);
> > > level = hslider("[1] Test Sine Level (dBFS) [unit:dBFS]",-10,-
> > > 80,0,0.1);
> > > avg = hslider("[2] Averaging Time (s) [unit:sec]",3,0.01,10,0.1);
> > > 
> > > amp = 10^(level/20);
> > > testSignal = amp * os.osc(freq);
> > > 
> > > process = testSignal <: _,_ : lk2 : vbargraph("[3] LUFS S",-40,0)
> > > : *(1e-7);
> > > 
> > > //Tg = 0.4; // 3 second window for 'short-term' measurement
> > > Tg = avg;
> > > zi = an.ms_envelope_rect(Tg); // mean square: average power =
> > > energy/Tg = integral of squared signal / Tg
> > > kfilter = fi.highpass(1, 60) : fi.high_shelf(4, 1800);
> > > 
> > > // 2-channel
> > > lk2 = par(i,2,kfilter : zi) :> 10 * log10(max(ma.EPSILON)) : -
> > > (0.691);
> > > 
> > > 
> > > On Tue, May 10, 2022 at 7:00 AM Klaus Scheuermann
> > > <kla...@posteo.de> wrote:
> > > > Hi Julius,
> > > > 
> > > > this is, of course, the way to go.
> > > > 
> > > > I did some test with a series of sines, each  at -18lufs, and
> > > > found these filter settings to be quite close (except for the
> > > > 30Hz):
> > > > kfilter = fi.highpass(1,60):fi.high_shelf(4,1800);
> > > > 
> > > > Hz  lufs
> > > > 30 -16.693
> > > > 60 -18.111
> > > > 80 -18.204
> > > > 100 -18.211
> > > > 130 -18.177
> > > > 180 -18.133
> > > > 250 -18.113
> > > > 300 -18.099
> > > > 400 -18.099
> > > > 600 -18.169
> > > > 1000 -18.405
> > > > 2000 -18.241
> > > > 3000 -17.894
> > > > 4000 -17.784
> > > > 6000 -17.503
> > > > 8000 -18.083
> > > > 10000 -18.026
> > > > 12000 -18.035
> > > > 14000 -17.784
> > > > 16000 -18.083
> > > > 
> > > > What I don't quite understand is why the values read a little
> > > > different, every time I do the test with same filter settings
> > > > and same sines. (I am on faustide.grame.fr).
> > > > 
> > > > For my application, this should work fine. Out of curiosity,
> > > > why do I approximate the filters? So that it works on all
> > > > samplerates?
> > > > 
> > > > Full test code is this:
> > > > import("stdfaust.lib");
> > > > 
> > > > process = _,_:lk2:vbargraph("LUFS S",-40,0);
> > > > 
> > > > Tg = 0.4;// 3 second window for 'short-term' measurement
> > > > zi = an.ms_envelope_rect(Tg);// mean square: average power =
> > > > energy/Tg = integral of squared signal / Tg
> > > > kfilter = fi.highpass(1,60):fi.high_shelf(4,1800);
> > > > 
> > > > 
> > > > // 2-channel
> > > > lk2 = par(i,2,kfilter:zi):>10 * log10(max(ma.EPSILON)): -
> > > > (0.691);
> > > > 
> > > > Thanks!!
> > > > Klaus
> > > > 
> > > > 
> > > > 
> > > > 
> > > > On Sun, 2022-05-08 at 13:17 -0700, Julius Smith wrote:
> > > > > Hi Klaus,
> > > > > 
> > > > > To go after this, it would be useful to measure the
> > > > > discrepancy for
> > > > > some number of sinusoidal frequencies across the audio band,
> > > > > with at
> > > > > least one example including both single-channel and
> > > > > multichannel
> > > > > input.
> > > > > Based on the filter approximations used, I would predict a
> > > > > measurable
> > > > > discrepancy around 1 kHz (guessed transition-frequency
> > > > > tuning), and
> > > > > very high frequencies (due to bilinear transform frequency-
> > > > > warping).
> > > > > 
> > > > > The high-frequency discrepancy should go away with
> > > > > oversampling, even 2x.
> > > > > 
> > > > > Glad to hear noise is looking good!
> > > > > 
> > > > > - Julius
> > > > > 
> > > > > On Sat, Jul 3, 2021 at 1:08 AM Klaus Scheuermann
> > > > > <kla...@posteo.de> wrote:
> > > > > > 
> > > > > > Hello everyone :)
> > > > > > 
> > > > > > Would someone be up for helping me implement an LUFS
> > > > > > loudness analyser
> > > > > > in faust?
> > > > > > 
> > > > > > Or has someone done it already?
> > > > > > 
> > > > > > LUFS (aka LKFS) is becoming more and more the standard for
> > > > > > loudness
> > > > > > measurement in the audio industry. Youtube, Spotify and
> > > > > > broadcast
> > > > > > stations use the concept to normalize loudness. A very
> > > > > > positive side
> > > > > > effect is, that loudness-wars are basically over.
> > > > > > 
> > > > > > I looked into it, but my programming skills clearly don't
> > > > > > match
> > > > > > the level for implementing this.
> > > > > > 
> > > > > > Here is some resource about the topic:
> > > > > > 
> > > > > > https://en.wikipedia.org/wiki/LKFS
> > > > > > 
> > > > > > Specifications (in Annex 1):
> > > > > > https://www.itu.int/dms_pubrec/itu-r/rec/bs/R-REC-BS.1770-3-201208-S!!PDF-E.pdf
> > > > > > 
> > > > > > An implementation by 'klangfreund' in JUCE / C:
> > > > > > https://github.com/klangfreund/LUFSMeter
> > > > > > 
> > > > > > There is also a free LUFS Meter in JS / Reaper by Geraint
> > > > > > Luff.
> > > > > > (The code can be seen in reaper, but I don't know if I
> > > > > > should paste it
> > > > > > here.)
> > > > > > 
> > > > > > Please let me know if you are up for it!
> > > > > > 
> > > > > > Take care,
> > > > > > Klaus
> > > > > > 
> > > > > > 
> > > > > > _______________________________________________
> > > > > > Faudiostream-users mailing list
> > > > > > Faudiostream-users@lists.sourceforge.net
> > > > > > https://lists.sourceforge.net/lists/listinfo/faudiostream-users
> > > > > 
> > > > > 
> > > > > 
> > > > 
> > > > 
> > > 
> > > 
> > > -- 
> > > "Anybody who knows all about nothing knows everything" -- Leonard
> > > Susskind
> > 
> 
> 



_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to