Page 1 of 2

Integrated Dynamic Range (DR) measurment tool

Posted: Wed Apr 02, 2014 10:01 am
by unfa
Hey!

I've noticed I frequently export my tracks and use an external commandline program to see the DR rating of my material as an additional measuring aid in choosing the right amount of master limiter's gain.

The tool I use is a FLOSS program called DR14 T.meter:

http://dr14tmeter.sourceforge.net/index.php/Main_Page

Here's it's description:
DR14 T.meter is a free and opens source command line tool for computing the Dynamic Range of your music according to the procedure used in the off-line meter released by the Pleasurize Music Foundation.

This tool is very useful to measure how is loud your music and for understanding that a good quality album always has also a good dynamic, and it's also useful for understanding the effects of the so called loudness war.

Dr14 t.meter is released under the terms of the GNU GPLv3 license and is intended for the Linux users that can not use the Windows application released by the Pleasurize Music Foundation or the plugin for Foobar2000.

I've largely tested this application and it has always returned results identical to those of the official off-line meter.
It's a very handy tool, but it could be much more useful, if the algorithm could be used off Audacity's Analysis menu instantly giving back a DR value for selected material.

I wonder how difficult it would be to implement this, what are the possible ways of doing so.
Also (more importantly I guess) - does anybody care about measuring DR values when releasing music, or this all sounds abstruse?

If it does, I invite you to zoom this page, that started it all:
http://www.dynamicrange.de/
Here you'll see what's this DR (Dynamic Range) measuring is all about, why we should care and what is Loudness War (if you haven't heard of it yet).

So there are two ways of measuring DR.
One is "live" - much like the peak/RMS level meters we have now in Audacity that display the momental DR value (rounded integer difference between peak level and RMS level of the signal AFAIK) - this should be easy to accomplish with a slight modification of the level meters (could they be made to display a DRx value next to them all the time?)
The other is "offline" - that computes the value for a given audio file, and prints a value (like DR6, DR3, DR9, DR14 etc.) - this could sit in the Analysis menu and analyse selected audio material and give back the value.

What are your thoughts?

Bless ya! :)

Re: Integrated Dynamic Range (DR) measurment tool

Posted: Wed Apr 02, 2014 11:47 am
by steve
How are they defining "dynamic range" and what do the "DR" numbers mean?
In order to implement something like this, the precise specification for how the measurement is made needs to be know, but I can't see a specification on either of those pages.

Re: Integrated Dynamic Range (DR) measurment tool

Posted: Wed Apr 02, 2014 3:34 pm
by unfa
I think we can contact the maker of DR14 T.meter and ask him.

I'll try to find him and invite here to help.

Re: Integrated Dynamic Range (DR) measurment tool

Posted: Wed Apr 02, 2014 9:38 pm
by Gale Andrews
I don't have patience to read the DR14 source code, but found this in the manual of the "TT Dynamic Range Meter by Pleasurize Music Foundation" ( Windows download is at http://www.dynamicrange.de/sites/defaul ... 201_4a.zip ).
In order to determine the official DR value, a song or entire album (16 bit, 44.1 kHz 
wave format) is scanned. A histogram (loudness distribution diagram) is created with a 
resolution of 0.01 dB. The RMS – an established loudness measurement standard – is 
determined by gathering approximately 10,000 pieces of loudness information within
a time span of 3 seconds (dB/RMS). From this result, only the loudest 20% is used for
determining the average loudness of the loud passages. At the same time, the 
loudest peak is determined. 

The DR Value is the difference between the peak and the top 20 average RMS
measurements (top 20 RMS minus Peak = DR). 

Gale

Re: Integrated Dynamic Range (DR) measurment tool

Posted: Thu Apr 03, 2014 1:56 am
by steve
by gathering approximately 10,000 pieces of loudness information within a time span of 3 seconds (dB/RMS).
Surely that can't be right?

Re: Integrated Dynamic Range (DR) measurment tool

Posted: Thu Apr 03, 2014 5:22 am
by Robert J. H.
steve wrote:
by gathering approximately 10,000 pieces of loudness information within a time span of 3 seconds (dB/RMS).
Surely that can't be right?
It is written as such in https://www.dropbox.com/sh/b4avsqc8oyd5c58/6ccq24vPUt

However, it makes no sense to take rms values over 13 samples...

I can only say that the new EBU R128 uses 400 ms chunks with 100 ms hop for the LU (Loudness Units) measurements.
I think that the DR meter will eventually follow this rules since the same standard is promoted on the above mentioned homepage.
DR14 is from the year 2009 and the new recommendation from 2011.

Regarding the true peak, the following code gives a very good approximation to the demanded method:

Code: Select all

;optional test tone
;(setf s (scale-db -2 (hzosc (/ *sound-srate* 4) *table* 45)))
(setf *float-format* "%1.1f")
(setf sample-peak (linear-to-db (multichannel-max s ny:all)))
(setf true-peak (linear-to-db (multichannel-max 
   (resample s (max (* 2 *sound-srate*) 192000)) ny:all)))
(format nil "True peak is ~a dBFS.
Conventional peak measurement gives ~a dBFS.
The under-reading is therefore ~a dB.~%" 
        true-peak sample-peak (- true-peak sample-peak))
It displays the exact same values for the test tone as the original meters.
However, resampling can vary from implementation to implementation.
Furthermore, Nyquist scales by 0.95, it is the question if we should undo this scaling.
The true peak would be higher by 0.5 dB for this extreme case. There may be measurements where the true peak goes under the sample peak without that.
It is after all not so strictly defined as the Loudness measurement itself. One is free to include DC-blocking, preemphase filter and a arbitrary FIR filter for reconstruction of the zero-padded input.
I think I will contact Mr Tischmeyer for his opinion about a contemporary implementation.

Re: Integrated Dynamic Range (DR) measurment tool

Posted: Thu Apr 03, 2014 8:29 am
by Robert J. H.
Update:
I've just listened to a 1-hour interview with Friedemann Tischmeyer in a german radio show.
It is about the loudness war and also about the DR Meter.
It seems that the mentioned 10000 values in 3 s mean:
The 16 bit, 44.1 kHz input signal's RMS values are quantized to 0.01 dB and this gives about 9600 bins in the histogram with their individual counts.
As I've mentioned before, R128 uses 400 ms windows, this is called the momentary RMS (or rather MS) measure.
There are 2 other sizes based on this vector. Firstly the short term measurement--which is just 3 seconds (probably with the same 100 ms hop size, at least for visualization purposes).
The second one is the whole program, i.e. the commercial, the full album or a 24 hour broadcast.

The program dynamic range is thought of as a label, i.e. DR6 DR17 etc, where DR14 is a good target value for Rock and Pop.
Making such a huge histogram (and sorting it) is not that trivial in Nyquist. A list will probably soon create a stack overflow.
R128 uses double-gating (with absolute and relative threshold) instead of "Snatching 20 % cream off the cake" which makes it easier for real time.

I am not yet sure how the top-20 values are eventually turned into a single value. There exists mathematically more than one possibility, namely mean with or without regarding the frequence/occurances of the values, the median, the centroid and so on.

Re: Integrated Dynamic Range (DR) measurment tool

Posted: Thu Apr 03, 2014 12:01 pm
by steve
I like the general idea of the DR measurement tool. It draws attention to the trend known as the "Loudness War", which should be of concern to anyone that is interested in high quality recorded music, (but something about which many are unaware). However I do have reservations. Their documentation, particularly the Pleasurize Music Foundation website, implies that the measurements are highly accurate measurements and that the displayed dynamic range is an established "standard" measurement, which I think is misleading.

In the small print they acknowledge that "True Peak" is really just a bit more than the highest peak sample level, where "a bit more" is an arbitrary figure of 0.3 dB. This may well be a "reasonable" figure, but it is based on the assumption that "Modern D/A converters ...[snip]... are not always designed to process full scale signals without distortion".

"10,000 pieces of loudness information within a time span of 3 seconds (dB/RMS)" is a big number and sounds impressive, but is definitely misleading. As Robert points out, EBU R128 IS an established and widely recognised standard, and uses a 400 ms window with 100 ms step size, giving 30 measurements in a 3 second period.
Robert J. H. wrote:It seems that the mentioned 10000 values in 3 s mean:
The 16 bit, 44.1 kHz input signal's RMS values are quantized to 0.01 dB and this gives about 9600 bins in the histogram with their individual counts.
That sounds more like an implementation detail rather than anything else. To be critical I would say it was "hype".

The website seems to imply that DR6, DR17 etc are established "standards", but I can find no reference to any international standard. Without references I can only assume that this is something that they made up themselves. I'm not suggesting that the measurements are "wrong", just that they do not seem to represent any established standard measurement.

It is certainly convenient that their DR meter resolves moving average (rms) measurement combined with peak measurement into a single figure (the "DR" number), but I don't think that it is really more than a convenient guide.

I'm sure that we can make an analysis tool that provides an equally valid guide to the dynamic range, and will probably be broadly in line with the "DR14 T.meter", but unless there is an internationally recognised standard to work to, I don't see that we need to be bound to the same implementation methodology.

Re: Integrated Dynamic Range (DR) measurment tool

Posted: Thu Apr 03, 2014 1:37 pm
by Robert J. H.
You're certainly right Steve.
DR14 is a pre-R128 experimental tool to fight the loudness war. The promotion (led by the mentioned website) doesn't seem to have succeeded in this form. This gets obvious when we see that the foobar2000 add-on expired in 2011.
The initiator Tischmeyer admits that the tool has been launched at the wrong time.
There's only the true peak value that has somewhat survived this period (without the arbitrary 0.3 dB constraint, which is only valid for balanced compression).
Not only is this definition arbitrary, also the discarding of 80 % of the RMS values has no foundation in my opinion, at least not in a statistical sense. More so with only 300 values per s, distributed over 9600 bins.
Other sample formats are simply not supported (32 bit would demand over 100000 bins).

We should therefore rather pursuit a R128 implementation how it is issued by the European Broadcasting Union.
It is at least some kind of standard and as such followed by e.g. Norway.
It is going to be interesting when those ideas will eventually be accepted in e.g. the iTunes "suited for" label.
The ultimate goal would be to have audio material with -23 LUFS (simply k-weighted dB). Audio books would have a similar target value.
It seems that Steinberg has released such a free loudness meter (SLM 128 or so).
The recommendation includes true peak, loudness units and loudness range over 400 ms/3s/full "program".

As usual, there's an American counterpart, similar but not the same. Koz should know more about that.

Re: Integrated Dynamic Range (DR) measurment tool

Posted: Thu Apr 03, 2014 5:07 pm
by kozikowski
Fragments and some history.

In the early days of the broadcast loudness war, there were enough complaints that Some Means was determined to be necessary to "Even Out" the loudness variations in a broadcast hour. The broadcasters and networks were understandably horrified at the prospect of an entire division of their companies be devoted to keeping loudness in check. NBC in particular had a history of such departments. See: NBC Standards and Practices, the NBC Censor.

And so a Device was created. We put a Loudness Controller in place in a remote rack in the back of the station that sat on the transmitter lines and "made it better." Then a reading came down from the FCC (or the NAB) or both that the commercials could be as loud as the loudest portion of the show. I don't remember taking the loudness controller out, but I think it was quietly retired.

Past that I'm not aware of any efforts or standards. US TV in particular is a delicate balancing act between competing factions. If your station is seen to have an aggressive means to prevent commercials from grabbing viewer's attention (getting louder), then your station also has an effective means to prevent the commercials from buying time. Without the commercials, you can look for another line of work.

So those are my largely unhelpful comments.

Koz