主要内容

Loudness Normalization in Accordance with EBU R 128 Standard

此示例显示了如何使用Audio Toolbox™中的工具来测量响度,响度范围和真实的峰值价值。它还显示了如何使音频归一化以满足EBU R 128标准合规性。

介绍

传统上,通过查看峰信号测量值来进行体积归一化。但是,这种方法的缺点是,过度压缩的音频可能会通过信号级阈值,但听到仍然很大。结果是loudness war, where recordings tended to be louder than before and inconsistent across genres.

这modern solution to the loudness war is to measure theperceived loudness结合一个true-peaklevel measurement. International standards like ITU BS.1770-4, EBU R 128, and ATSC A/85 have been developed to standardize loudness measurements based on the power of the audio signal. Many countries have already passed legislations for compliance with broadcast standards on loudness levels.

在此示例中,您可以测量离线(基于文件)和实时(流)音频信号的响度和补充参数。您还会看到使音频正常化的方法符合目标级别的方法。

EBU R 128 Standard

音频工具箱使您可以根据EBU R 128标准测量响度和相关参数。该标准定义了以下响度措施:

  • 瞬间的响度: Uses a sliding window of length 400 ms.

  • 短期响度:使用长度3 s的滑动窗口。

  • Integrated loudness:从开始到结束。

  • Loudness range: Quantifies variation of loudness on a macroscopic timescale.

  • True-peak value: Peak sample level of interpolated signal.

For a more detailed description of these parameters, refer to the documentation for EBU R 128 standard.

离线响度测量和归一化

对于您已经有录制的音频样本的情况,您可以使用集成云衡量响度的功能。它返回完整音频文件的LU单位以LU的单位和响度范围的返回。

[x, fs] = audioread('RockGuitar-16-44p1-stereo-72secs.wav');[loudness, LRA] = integratedLoudness(x,fs); fprintf('Loudness before normalization: %.1f LUFS\n',响度)
Loudness before normalization: -8.2 LUFS

EBU R 128 defines the target loudness level to be -23 LUFS. The loudness of the audio file is clearly above this level. A simple level reduction operation can be used to normalize the loudness.

目标= -23;gaindb =目标 - 响度;增益= 10^(gaindb/20);xn = x。*获得;AudioWrite('RockGuitar_normalized.wav',xn,fs)

这loudness of the new audio file is at the target level.

[x, fs] = audioread('RockGuitar_normalized.wav');响度= IntegratedLoudness(x,fs);fprintf('标准化后的响度:%.1f lufs \ n',响度)
Loudness after normalization: -23.0 LUFS

Live Loudness Measurement and Normalization

对于流式音频,如R 128定义的nd short-term loudness. You can use the响度表System object to measure momentary loudness, short-term loudness, integrated loudness, loudness range, and true-peak value of a live audio signal.

First, stream the audio signal to your sound card and measure its loudness using响度表。这可视化method of响度表opens a user interface (UI) that displays all the loudness-related measurements as the simulation progresses.

reader = dsp.AudioFileReader('RockGuitar-16-44p1-stereo-72secs.wav',。。。'SamplesPerFrame',1024); fs = reader.SampleRate; inputLoudness = loudnessMeter('SampleRate',fs);player = audioDeviceWriter('SampleRate',fs);runningMax = dsp.MovingMaximum('SpecifyWindowLength',false); visualize(inputLoudness)尽管~isDone(reader) audioIn = reader(); [loudness,~,~,~,tp] = inputLoudness(audioIn); maxTP = runningMax(tp); player(audioIn);end

Figure Loudness Meter contains objects of type uicontrol, uipanel.

fprintf('Max true-peak value before normalization: %.1f dBTP\n',maxTP(end))
Max true-peak value before normalization: -0.3 dBTP
发布(阅读器)版本(播放器)

正如您在UI上看到的那样,音频流的响度显然在-23 Lufs阈值之上。它的最大峰值水平为-0.3 dbtp也高于EBU R 128指定的-1 dbtp的阈值。使实时音频流的响度正常化比标准化文件的响度更棘手。帮助使响度值接近目标阈值的一种方法是使用自动增益控制器(AGC)。在以下代码中,您使用audioexample.AGC系统对象将音频信号的功率归一化为-23 dB。AGC通过查看前400毫秒来估算音频信号的功率,即用于计算瞬时响度的窗口大小。此示例中使用了两个响度仪 - 一个用于AGC的输入,另一个用于AGC的输出。两个响度仪的UI可以在屏幕上的同一位置发射,因此您必须将一个移动到侧面以比较AGC前后的测量响度。

outputloudness = loutnessmeter('SampleRate',fs);gaincontroller = audioexample.agc(“ DesiredOutputpower”,-23,。。。'AveragingLength',0.4*fs,“ MaxPowerGain”,20);重置(inputloudness)%重复使用以前相同的响度计重置(RunningMax)可视化(Inputloudness)可视化(outputloudness)尽管~isDone(reader) audioIn = reader(); loudnessBeforeNorm = inputLoudness(audioIn); [audioOut, gain] = gainController(audioIn); [loudnessAfterNorm,~,~,~,tp] = outputLoudness(audioOut); maxTP = runningMax(tp); player(audioOut);end

Figure Loudness Meter contains objects of type uicontrol, uipanel.

Figure Loudness Meter contains objects of type uicontrol, uipanel.

fprintf('标准化后的最大真实峰值值:%.1f dbtp \ n',maxTP(end))
Max true-peak value after normalization: 8.3 dBTP
发布(阅读器)版本(播放器)

Using AGC not only brought the loudness of the audio close to the target of -23 LUFS, but it also got the maximum true-peak value below the allowed -1 dBTP. In some cases, the maximum true-peak value remains above -1 dBTP although the loudness is at or below -23 LUFS. For such scenarios, you can pass the audio through a限制器