Audio Signal Visualisation and Measurement Robin Gareus Chris Goddard Universit´e Paris 8 Freelance audio engineer Paris, France Woodstock, Oxfordshire, UK [email protected] [email protected] Abstract Similarly for technical engineers, reliable measurement tools are indispensable for the The authors offer an introductory walk-through of quality assurance of audio-effects or any pro- professional audio signal measurement and visuali- sation. fessional audio-equipment. The presentation focuses on the SiSco.lv2 (Sim- 2 Meter Types and Standards ple Audio Signal Oscilloscope) and the Meters.lv2 (Audio Level Meters) LV2 plugins, which have been For historical and commercial reasons various developed since August 2013. The plugin bundle measurement standards exist. They fall into is a super-set, built upon existing tools with added three basic categories: novel GUIs (e.g ebur128, jmeters,..), and features new meter-types and visualisations unprecedented • Focus on medium: highlight digital num- on GNU/Linux (e.g. true-peak, phase-wheel,..). ber, or analogue level constraints. Various meter-types are demonstrated and the mo- tivation for using them explained. • Focus on message: provide a general indi- The accompanying documentation provides an cation of loudness as perceived by humans. overview of instrumentation tools and measurement standards in general, emphasising the requirement • Focus on interoperability: strict specifi- to provide a reliable and standardised way to mea- cation for broadcast. sure signals. ThetalkisaimedatdeveloperswhovalidateDSP For in-depth information about metering during development, as well as sound-engineers who standards, their history and practical use, mixandmasteraccordingtocommercialconstraints. pleasesee[Brixen, 2010]and[Watkinson, 2000]. Keywords 2.1 Digital peak-meters ADigitalPeakMeter(DPM)displaystheabso- Audio Level Metering, Visualisation, LV2, DSP lute maximum signal of the raw samples in the 1 Introduction PCM signal (for a given time). It is commonly used when tracking to make sure the recorded Audio level meters are very powerful tools that audio never clips. To that end, DPMs are are useful in every part of the production chain: calibrated to 0dBFS (Decibels relative to Full Scale), or the maximum level that can be rep- • When tracking, meters are used to en- resented digitally in a given system. This value sure that input signals do not overload and has no musical connection whatsoever and de- maintain reasonable headroom. pends only on the properties of the signal chain or target medium. There are conventions for • Meters offer a quick visual indication of ac- fall-off-time and peak-hold, but no exact spec- tivitywhenworkingwithalargenumberof ifications. Furthermore, DPMs operate on raw tracks. digital sample data which does not take inter- • During mixing, meters provide a rough es- sample peaks into account, see section 2.7. timate of the loudness of each track. 2.2 RMS meters • At the mastering stage, meters are used to An RMS (Root Mean Square) type meter is an check compliance with upstream level and averaging meter that looks at the energy in the loudnessstandards,andtooptimisethedy- signal. It provides a general indication of loud- namic range for a given medium. ness as perceived by humans. dBu VU BBC EBU DIN Nordic dBFS For home recording, there is no real need for +20 this level of interoperability, and these meters +18 0 are only strictly required when working in or +14 +5 −4 with the broadcast industry. However, IEC- +12 7 +12 +12 −6 type meters have certain characteristics (rise- +10 −8 0 +9 time, ballistics) that make them useful outside +8 6 +8 −10 the context of broadcast. +6 3 +6 −12 2 Their specification is very exact [IEC, 1991], +4 1 5 +4 −5 −14 +2 01 +3 −16 andconsequently, there areno customisablepa- 0 23 4 Test Test −18 rameters. 5 −2 −10 −20 7 −3 −4 3 −4 −22 −6 10 −20 −6 −24 2 −8 −10 20 1 −12 −30 −9 −28 −15 −20 −40 −38 −30 −50 −48 −40 −42 −58 −50 −68 dBu IEC 60268−17 IEC 268−10 IIB IEC 268−10 I dBFS IEC 268−10 IIA IEC 268−10 Figure 1: Various meter alignment levels as spec- ified by the IEC. Common reference level is 0dBu calibrated to -18dBFS for all types except for DIN, whichaligns+9dButo-9dBFS.dBureferstovoltage in an analogue system while dBFS to digital signal full-scale. Bar-graph RMS meters often include an ad- ditional DPM indicator for practical reasons. Figure 2: Various meter-types from the meter.lv2 The latter shows medium specifics and gives an plugin bundle fed with a -18 dBFS 1 kHz sine wave. indication of the crest-factor (peak-to-average Note, bottom right depicts the stereo phase correla- power ratio) when compared to the RMS me- tion meter of a mono signal. ter. Similar to DPM’s, there is is no fixed stan- 2.4 EBU R-128 dard regarding ballistics and alignment level for a general RMS meter, but various conventions The European Broadcast Union recommenda- do exist, most notably the K-system introduced tion 128 is a rather new standard, that goes by Bob Katz [Katz, 2000]. beyond the audio-levelling paradigm of PPMs. ItisbasedontheITU-RBS.1770loudnessal- 2.3 IEC PPMs gorithm [ITU, 2006] which defines a weighting IEC (International Electrotechnical Commis- filter amongst other details to deal with multi- sion) type Peak Programme Meters (PPM) are channel loudness measurements. To differenti- a mix between DPMs and RMS meters, cre- ateitfromlevelmeasurementtheITUandEBU ated mainly for the purpose of interoperability. introduced a new term ‘LU’ (Loudness Unit) Many national and institutional varieties exist: equivalent to one Decibel1. The term ‘LUFS’ is European Broadcasting Union (EBU), British then used to indicate Loudness Unit relative to Broadcasting Corporation (BBC), Deutsche full scale. Industrie-Norm (DIN),.. [Wikipedia, 2013]. In addition to the average loudness of a pro- These loudness and metering standards pro- gramme the EBU recommends that the ‘Loud- vide a common point of reference which is used ness Range’ and ‘Maximum True Peak Level’ by broadcasters in particular so that the inter- be measured and used for the normalisation of changeofmaterialisuniformacrosstheirsphere audio signals [EBU, 2010]. ofinfluence,regardlessoftheequipmentusedto 1the ITU specs uses ‘LKFS’, Loudness using the K- play it back. See Fig. 1 for an overview of ref- Filter, with respect to to Full Scale, which is exactly erence levels. identical to ’LUFS’. The target level for audio is defined as -23 logarithmic amplifiers were physically large). LUFS and the maximum permitted true-peak The meter’s designers assumed that a record- level of a programme during production shall ing medium with at least 10 dB headroom over be -1 dBTP. 0 VU would be used and the ballistics were de- The integrated loudness measurement is in- signed to “look good” with the spoken word. tended to quantify the average program loud- Their specification is very strict (300ms rise- ness over an extended period of time, usually a time, 1 - 1.5% overshoot, flat frequency re- completesongoranentirespoken-wordfeature. sponse), but various national conventions ex- [Adriaensen, 2011], [EBU, 2011]. ist for the 0VU alignment reference level. The Many implementations go beyond displaying most commonly used was standardised in 1942 range and include a history and histogram of in ASA C16-5-1942: “The reading shall be 0 the Loudness Range in the visual readout. This VUforanACvoltageequalto1.228VoltsRMS addition comes at no extra cost because the al- across a 600 Ohm resistance”2 gorithm to calculate the range mandates keep- 2.6 Phase Meters ing track of a signal’s history to some extent. Three types of response should be provided A phase-meter shows the amount of phase dif- by a loudness meter conforming to R-128: ference in a pair of correlated signals. It al- lows the sound technician to adjust for opti- • Momentary response. The mean squared mal stereo and to diagnose mistakes such as level over a window of 400ms. an inverted signal. Furthermore it provides an indication of mono-compatibility, and pos- • Short term response. The average over 3 sible phase-cancellation that takes place when seconds. a stereo-signal is mixed down to mono. • Integrated response. An average over an 2.6.1 Stereo Phase Correlation Meters extended period. Stereo Phase Correlation Meters are usually needlestylemeters,showingthephasefrom0to 180 degrees. There is no distinction between 90 and 270 degree phase-shifts since they produce the same amount of phase cancellation. The 0 point is sometimes labelled “+1”, and the 180 degree out-of-phase point “-1”. 2.6.2 Goniometer A Goniometer plots the signal on a two- dimensional area so that the correlation be- tween the two audio channels becomes visually apparent (example in Fig. 8). The principle is also known as Lissajous curves or X-Y mode in oscilloscopes. The goniometer proves useful be- Figure 3: EBU R-128 meter GUI with histogram cause it provides very dense information in an (left) and history (right) view. analogue and surprisingly intuitive form: From the display, one can get a good feel for the au- 2.5 VU meters diolevelsforeachchannel, theamountofstereo and its compatibility as a mono signal, even to Volume Unit (VU) meters are the dinosaurs some degree what frequencies are contained in (1939) amongst meters. the signal. Experts may even be able to deter- The VU-meter (intentionally) ”slows” mea- mine the probable arrangement of microphones surement, averaging out peaks and troughs of when the signal was recorded. short duration, and reflects more the perceived loudness of the material [Wikipedia, 2014], and 2.6.3 Phase/Frequency Wheel as such was intended to help program produc- The Phase Wheel is an extrapolation of the ers create consistent loudness amongst broad- Phase Meter. It displays the full 360 degree cast program elements. signal phase and separates the signal phase by In contrast to all the previously mentioned types, VU metes use a linear scale (in 1939 2This corresponds to +4dBu Figure 4: Phase/Frequency Wheel. Left: pink noise,48KSPSwithright-channeldelayedby5sam- Figure 5: Inter-sample peaks in a sine-wave. The ples relative to left channel. Right: Digitalisation redline(topandbottom)indicatesthedigitalpeak, of a mono 1/2” tape reel with slight head misalign- theactualanaloguesine-wave(black)corresponding ment. to the sampled data (blue dot) exceeds this level. frequency. It is a rather technical tool useful, for example, for aligning tape heads, see Fig. 4 2.7 Digital True-Peak Meters A True-Peak Meter is a digital peak meter withadditionaldatapre-processing. Theaudio- signal is up-sampled (usually by a factor of four [ITU, 2006]) to take inter-sample peaks into ac- count. Even though the DPM uses an identi- cal scale, true-peak meters use the unit dBTP (decibels relative to full scale, measured as a true-peak value – instead of dBFS). dBTP is identical to dBFS except that it may be larger than zero (full-scale) to indicate peaks. Inter-sample peaks are not a problem while Figure 6: 30 Band 1/3 octave spectrum analyser remaining in the digital domain, they can how- ever introduce clipping artefacts or distortion oncethesignalisconvertedbacktoananalogue width, and other spectral components can be signal. observed. These are not easily detectable in time domain waveforms. floating point mathematical Traditionallytheyareacombinationofband- audio data true peak value pass filters and an RMS signal level meter per .. 0 0 +1 +1 0 0 .. +2.0982 dBTP bandwhichmeasuresthesignal-powerforadis- .. 0 0 +1 -1 0 0 .. +0.7655 dBTP crete frequency band of the spectrum. This is a simple form of a perceptual meter. A well Table1: [email protected],both known specification is a 1/3 octave 30-band examples correspond to 0dBFS. spectrum analyser standardised in IEC 61260 [IEC, 1995]. Frequency bands are spaced by Fig. 5 illustrates the issue. Inter-sample octave which provides a flat readout for a pink- peaks are one of the important factors that ne- noise power spectrum, which is not unlike the cessitate the existence and usage of headroom human ear. in the various standards, Table 1 provides a few examples of where traditional meters will fail to As with all IEC standards the specifications detect clipping of the analogue signal. are very precise, yet within IEC61260 a num- ber of variants are available to trade off imple- 2.8 Spectrum Analysers mentation details. Three classes of quality are Spectrum analysers measure the magnitude of defined which differ in the filter-band attenu- an input signal versus frequency. By analysing ation (band overlap). Class 0 being the best, the spectra of electrical signals, dominant fre- class 2 the worst acceptable. Furthermore two quency, power, distortion, harmonics, band- variants are offered regarding filter-frequency x x bands, base ten: 1010 and base two: 23. The centrefrequencyineithercaseis1KHz,with(at least) 13 bands above and 16 bands below. In the digital domain various alternative im- plementations are possible, most notably FFT and signal convolution approaches3. FFT (Fast Fourier Transform, an implemen- tation of the discrete Fourier transform) trans- forms an audio signal from the time into the frequency domain. In the basic common form frequency bands are equally spaced and oper- ation mode produces a flat response for white noise. Formusicalapplicationsavariantcalled‘per- ceptual analysers’ is widespread. The signal level or power is weighted depending on var- ious factors. Perceptual analysers often fea- Figure 7: 15KHz, -3dBFS sine wave sampled at ture averaging functions or make use of screen- 48KSPS. The Oscilloscope (top) up-samples the persistence to improve readability. They also data to reproduce the signal. The wave-form dis- come with additional features such as numeric play (bottom) displays raw sample data. readout for average noise level and peak detec- tion to mitigate effects introduced by variation what distance means. There are various stan- in the actual display. dards and conventions, but there is no margin for error: One can rely on the centimetre. 2.9 Oscilloscopes Unfortunately the same rigour is not always The oscilloscope is the “jack of all trades” of applied to audio metering. On many products electronic instrumentation tools. It produces a the included level meter mainly serves to en- two-dimensional plot of one or more signals as hance aesthetics, “make it look cool”, rather a function of time. than provide a reliable measurement. This It differs from a casual wave-form display, trend increased with the proliferation of digital which is often found in audio-applications, in audio plugins. Those meters are not completely various subtle but important details: An oscil- without merit, they can be useful to distinguish loscope allows reliable signal measurement and thepresence, orotherwise, ofasignal, andmost numeric readout. Digital wave-form displays on will place the signal-level in the right ballpark. theotherhandareoperatingonaudio-samples- There is nothing wrong with saying “the build- as opposed to a continuous audio-signal. Figure ing is tall” but to say “the building is 324.1m 7 illustrates this. high” is more meaningful. The problem in the For an oscilloscope to be useful for engineer- audio-world is that many vendors add false nu- ing work it must be calibrated - for both time meric labels to the scale to convey the look of and level, be able to produce an accurate read- professionalism, which can be quite misleading. out of at least two channels and facilitate signal In the audio sphere the most prominent acquisition of particular events (triggering, sig- standards are the IEC and ITU specifications: nal history) [Adriaensen, 2013]. These specs are designed such that all meters which are compliant, even when using com- 3 Standardisation pletely different implementations, will produce identical results. The key point of measuring things is to be able Thefundamentalattributesthatarespecified to meaningfully compare readings from one me- for all meter types are: ter to another or to a mathematically calcu- lated value. A useful analogy here is inches and • Alignment or Reference Level and Range centimetres, there is a rigorous specification of • Ballistics (rise/fall times, peak-hold, burst 3There are analogue designs to perform DFT tech- response) niques,butforallpracticalpurposestheyareinadequate and not comparable to digital signal processing. • Frequency Response (filtering) Standards (such as IEC, ITU, EBU,...) gov- ern many details beyond that, from visual colour indication to operating temperatures, analogue characteristics, electrical safety guide- lines, test-methods, down to electrostatic and magnetic interference robustness requirements. 4 Software Implementation 4.1 Meters.lv2 Meters.lv2[Gareus,2013a]isasetofaudioplug- ins,licensedintermsoftheGPLv2[GPL,1991], to provide professional audio-signal measure- ments according to various standards. It cur- rently features needle style meters (mono and stereo variants) of the following • IEC 60268-10 Type I / DIN Figure 8: Goniometer (Phase Scope) • IEC 60268-10 Type I / Nordic • IEC 60268-10 Type IIa / BBC 4.2 Sisco.lv2 • IEC 60268-10 Type IIb / EBU Sisco.LV2 [Gareus, 2013c] implements a classic • IEC 60268-17 / VU audiooscilloscope withvariable timescale, trig- gering, cursorsandnumericreadoutinLV2plu- An overview is given in Fig. 2. Furthermore gin format. While it is feature complete for an itincludesmeter-typeswithvariousappropriate audio-scope, it is rather simplistic compared to visualisations for: contemporary hardware oscilloscopes or similar endeavoursbyotherauthors[Adriaensen,2013]. • 30 Band 1/3 octave spectrum analyser ac- cording to IEC 61260 (see Fig. 6) The minimum grid resolution is 50 micro- seconds - or a 32 times oversampled signal. The • Digital True-Peak Meter (4x Oversam- maximum buffer-time is 15 seconds. Currently pling), Type II rise-time, 13.3dB/s falloff. variants up to four channels are available. • EBU R128 Meter with Histogram and His- The time-scale setting is the only parameter tory (Fig. 3) that directly affects data acquisition. All other • K/RMS meter, K-20, K-14 and K-12 vari- parameters act on the display of the data only. ants The vertical axis displays floating-point audio- sample values with the unit [-1..+1]. The am- • Stereo Phase Correlation Meter (Needle plitude can be scaled by a factor of [-10..+10] Display, bottom right in Fig. 2) (20dB), negative values will invert the polarity • Goniometer (Stereo Phase Scope) (Fig. 8) of the signal. The numeric readout is not af- fected by amplitude scaling. Channels can be • Phase/Frequency Wheel (Fig. 4) offset horizontally and vertically. The offset ap- plies to the display only and does not span mul- ThereisnoofficialstandardfortheGoniome- tiple buffers (the data does not extend beyond ter and Phase-Wheel, the display has been eye- the original display). This allows the display to matched by experienced sound engineers to fol- be adjusted in ‘paused’ mode after sampling a lowsimilarcorrespondinghardwareequivalents. signal. Particular care has been taken to make the given software implementation safe for profes- The oscilloscope allows for visually hiding sional use. Specifically real-time safety and ro- channels as well as freezing the current display bustness (e.g. protection against denormals or buffer of each channel individually. Regardless subnormal input). The graphical display makes of display, data-acquisition for every channel use of hardware acceleration (openGL) to min- continues and the channel can be used for trig- imise CPU usage. gering. # Title Description 1 Signal Edge Signal passes ‘Level 1’ 2 Enter Window Signal enters a given range (Level 1, 2). 3 Leave Window Signal leaves a given range (Level 1, 2). 4 Hysteresis Signal crosses both min and max (Level 1,2) in thesamedirectionwith- out interruption. 5 Constrained Signal remains within a give range for at least ‘Time 1’. 6 Drop-out Signal does not pass through a given range for at least ‘Time 1’. 7 Pulse Width Last edge-trigger oc- curredbetweenminand max (Time 1,2) ago. 8 Pulse Train No edge-trigger for a give time (max, Time 2), or more than one trigger since a give time (min, Time 1). 9 Runt Fire if signal crosses 1st but not 2nd threshold. 10 LTC Trigger on Linear Time Code sync word. 11 RMS Calculate RMS, Inte- grateover‘Time1’sam- ples. 12 LPF Low Pass Filter, 1.0/ ‘Time 1’ Hz Table 2: Description of trigger modes in Fig. 9. The scope has three modes of operation: • No Triggering The Scope runs free, with thedisplayupdate-frequencydependingon audio-buffer-size and selected time-scale. For update-frequencies less than 10Hz a vertical bar of the current acquisition posi- tion is displayed. This bar separates recent data (to the left) and previously acquired data (to the right). • Single Sweep Manually trigger acquisi- tionusingthepush-button, honouringtrig- gersettings. Acquiresexactlyonecomplete display buffer. Figure 9: Overview of trigger preprocessor modes available in “mixtri.lv2”. The arrow indicates trig- • Continuous Triggering Continuously ger position. triggered data acquisition with a fixed hold time between runs. Advanced trigger modes are not directly in- EBU. 2011. EBU TECH 3342 – Loud- cluded with the scope, but implemented as ness Range: A measure to supplement loud- a standalone “trigger preprocessor” [Gareus, ness normalisation in accordance with EBU 2013b] plugin, see Fig. 9 and Table 2. Trigger- R-128. https://tech.ebu.ch/docs/tech/ modes 1-5 concern analogue operation modes, tech3342.pdf. European Broadcast Union – modes 6-9 are concerned with measuring digital Technical Committee. signals4. Modes 10-12 are pre-processor modes Robin Gareus. 2013a. Meters.lv2 - audio plu- rather than trigger modes. Apart from trigger gin collection. https://github.com/x42/ and edge-mode selectors “mixtri.lv2” provides meters.lv2. two level and two time control inputs for con- figuration. Robin Gareus. 2013b. Mixtri(x).lv2 - ma- trix mixer and trigger processor. https:// 5 Conclusion github.com/x42/mixtri.lv2. An overview of various instrumentation tools Robin Gareus. 2013c. Sisco.lv2 - Simple and measurement standards was presented. Scope. https://github.com/x42/sisco. The various tools are available as free soft- lv2. ware and have already found their way into 1991. Gnu general public license, ver- GNU/Linux distributions, making Linux even sion 2. https://www.gnu.org/licenses/ moresuitableasaplatformforPro-Audiowork. old-licenses/gpl-2.0.html, June. 6 Acknowledgements IEC. 1991. IEC60268-10soundsystemequip- Kudos to Fons Adriaensen, DSP expert, author ment–Part10Peakprogrammelevelmeters. of jmeters, jkmeter, ebur128 and related zita-* International Electrotechnical Commission. software that was used as the basis to facilitate IEC. 1995. IEC61260 electroacoustics – the software implementation of meters.lv2. Octave-band and fractional-octave-band fil- Thanks go to Jarom´ır Mikeˇs who created the ters. International Electrotechnical Commis- initial software packages for Debian/Ubuntu, sion. Alexandre Prokoudine who took great care of ITU. 2006. ITUBS.1770, Algorithmstomea- public relations, and Axel Mu¨ller who spent sure audio programme loudness and true- countless hours on testing and quality assur- ance. peakaudiolevel. http://www.itu.int/rec/ R-REC-BS.1770/en. International Telecom- References munication Union. Fons Adriaensen. 2011. Loudness measure- Bob Katz. 2000. How to make better mentaccordingtoEBUR-128. InProceedings recordings in the 21st century - an integrated of the Linux Audio Conference 2011. approach to metering, monitoring, and leveling practices. http://www.digido.com/ FonsAdriaensen. 2013. Designofanaudioos- how-to-make-better-recordings-part-2. cilloscope application. In Proceedings of the html. Updated from the article published in Linux Audio Conference 2013, ISBN 9783- the September 2000 issue of the AES Journal 902949-00-4. by Bob Katz. Eddy Brixen. 2010. Audio Metering: Mea- John Watkinson. 2000. Art of Digital Audio. surements, Standards and Practice. ISBN ISBN 0240515870. 0240814673. Wikipedia. 2013. Peak programme meter — EBU. 2010. EBU R-128 – audio loud- wikipedia, the free encyclopedia. [Online; ac- ness normalisation & permitted maximum cessed 1-February-2014]. level. https://tech.ebu.ch/docs/r/r128. Wikipedia. 2014. VU meter — wikipedia, pdf. European Broadcast Union – Technical the free encyclopedia. [Online; accessed 2- Committee. February-2014]. 4Digitalsignaltriggermodesareoflimitedusewitha genericaudiointerface,butcanbeusefulincombination withanadapter(e.g. MiditoAudio)orinsideJack(e.g. AMS or ingen control signals).