| 1 |
|
| 2 |
|
| 3 |
<refentry id="lufs"> |
| 4 |
<indexterm id="IndexLufs"><primary>lufs</primary></indexterm> |
| 5 |
|
| 6 |
<refentryinfo><title>Utilities</title></refentryinfo> |
| 7 |
<refmeta> |
| 8 |
<refentrytitle>lufs</refentrytitle> |
| 9 |
</refmeta> |
| 10 |
|
| 11 |
<refnamediv> |
| 12 |
<refname>lufs</refname> |
| 13 |
<refpurpose> |
| 14 |
Momentary, Integrated and Short-Term Loudness meter in LUFS |
| 15 |
</refpurpose> |
| 16 |
</refnamediv> |
| 17 |
|
| 18 |
<refsect1> |
| 19 |
<title>Description</title> |
| 20 |
<para> |
| 21 |
The opcodes performs an analysis of input audio according to ITU-R BS.1770-4 recommendation. The outputs are Momentary, Integrated and Short-Term loudnesses. |
| 22 |
</para> |
| 23 |
</refsect1> |
| 24 |
|
| 25 |
<refsect1> |
| 26 |
<title>Syntax</title> |
| 27 |
|
| 28 |
<synopsis>kmom, kint, kshort <command>lufs</command> kreset, ain1 [, ain2]</synopsis> |
| 29 |
</refsect1> |
| 30 |
|
| 31 |
<refsect1> |
| 32 |
<title>Performance</title> |
| 33 |
|
| 34 |
<para> |
| 35 |
<emphasis>kreset</emphasis> -- reset input. It resets the value of the integrated loudness if kreset is not 0. |
| 36 |
</para> |
| 37 |
<para> |
| 38 |
<emphasis>ain1, ain2</emphasis> -- input audio signal(s). Only mono and stereo are supported (see below) |
| 39 |
</para> |
| 40 |
<para> |
| 41 |
<emphasis>kmom</emphasis> -- momentary loudness in LUFS |
| 42 |
</para> |
| 43 |
<para> |
| 44 |
<emphasis>kint</emphasis> -- integrated loudness in LUFS |
| 45 |
</para> |
| 46 |
<para> |
| 47 |
<emphasis>kshort</emphasis> -- short-term loudness in LUFS |
| 48 |
</para> |
| 49 |
|
| 50 |
<para> |
| 51 |
The Momentary Loudness is calculated over 400 ms period and Short-Term Loudness is for 3 s period. Integrated Loudness is obtained by averaging the whole programm. |
| 52 |
The calculation algorithm is based on formulae from <ulink url="https://www.mathworks.com/help/audio/ref/integratedloudness.html"><citetitle>Matlab integratedLoudness code</citetitle></ulink> |
| 53 |
|
| 54 |
|
| 55 |
<ulink url="https://www.itu.int/dms_pubrec/itu-r/rec/bs/R-REC-BS.1770-4-201510-I!!PDF-E.pdf"><citetitle>ITU-R BS.1770-4</citetitle></ulink> gives K-weigthing filters coefficients only for 48000 Hz, thus other sampling frequencies coefficients are calculated according to <ulink url="https://github.com/BrechtDeMan/loudness.py/blob/master/loudness.py"><citetitle>Brecht De Man code</citetitle></ulink> |
| 56 |
Only mono and stereo formats are supported due to rare usage of 5.1 format in the field of computer music. ITU-R BS.1770-4 standardizes only 1, 2 and 5.1 channels. |
| 57 |
</para> |
| 58 |
|
| 59 |
<note> |
| 60 |
<title>Warning!</title> |
| 61 |
<para> |
| 62 |
<emphasis>ksmps</emphasis> should not be set to values higher than <emphasis>sr</emphasis>/10, i.e. 4410 @ sr = 44100 and higher. |
| 63 |
</para> |
| 64 |
</note> |
| 65 |
|
| 66 |
|
| 67 |
</refsect1> |
| 68 |
|
| 69 |
|
| 70 |
<refsect1> |
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
<title>Examples</title> |
| 75 |
<para> |
| 76 |
Here is an example of the lufs opcode. It uses the file <ulink url="examples/lufs.csd"><citetitle>lufs.csd</citetitle></ulink>. |
| 77 |
<example> |
| 78 |
<title>Example of the lufs opcode.</title> |
| 79 |
<para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para> |
| 80 |
<xi:include href="examples-xml/lufs.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 81 |
</example> |
| 82 |
</para> |
| 83 |
</refsect1> |
| 84 |
|
| 85 |
<refsect1> |
| 86 |
<title>See also</title> |
| 87 |
<para><link linkend="ControlSensing"><citetitle>Sensing and Control: Envelope followers</citetitle></link></para> |
| 88 |
</refsect1> |
| 89 |
|
| 90 |
<refsect1> |
| 91 |
|
| 92 |
<title>Credits</title> |
| 93 |
<para>By: Gleb Rogozinsky, Summer 2020</para> |
| 94 |
<para>New in version 6.15</para> |
| 95 |
</refsect1> |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
</refentry> |