Universal Audio WebZine
Volume 3, Number 5, July 2005
[UA Universe] [Ask the Doctors] [Artist Interview] [Analog Obsession]
[Support Report] [The Channel] [Plug-In Power] [Playback] [Featured Promotion]
[Graphic-Rich WebZine]
[Back Issues] [UA Home]


Ask the Doctors: Peak vs. RMS Detection
By Dave Berners

Dr. David Berners (left) is the Universal Audio Director of Algorithm Development; Dr. Jonathan Abel is the co-founder and CTO
Q: What is the difference between peak and RMS detection, and which is better?

A: Compressors, limiters, noise gates, and de-essers are examples of devices that perform dynamic range control (DRC), sometimes referred to as automatic gain control (AGC). Most DRC devices comprise two main functional blocks, a level estimator and a gain computer. The level estimator, often referred to as the detection block, must produce a signal whose value is related in some way to the short-term amplitude of the incoming or outgoing signal. If the level estimate is derived from the incoming signal, the device is a feedforward device; if the estimate is derived from the output signal, the device is a feedback device. (In some cases, both input and output signals are used to generate the level estimate, in which case the device is called mixed-topology.) The level estimate, depending upon application, may be related to the signal's average power level, peak level, or some other relevant statistic. Usually, most of the energy in the level estimate is confined to subaudio frequencies, so that the estimate is a bandlimited signal. The value of the level estimate is constrained to be greater than or equal to zero for all input signals, which means that the level detection process must contain a nonlinearity for nontrivial cases. The details of level estimation are what classify a DRC device as peak- or RMS-detecting, and they are also what determine the attack and release times for the device, as well as possible program-dependent behavior.

“Even for the same application, no one DRC device will always produce the most pleasing result.”

The gain computer uses the output of the level estimator as a parameter to determine a gain to be applied to the input signal. The gain computer is logically defined as a memoryless nonlinearity that determines the ratio and threshold of compression, as well as the shape of the compression knee. Note that the gain computer and level estimator are logical subblocks; the tasks of level detection and gain computation cannot always be ascribed to separate physical components in a hardware DRC device. Often, a single physical element will perform functions that affect both the level estimate and the gain computation.

Level detection is commonly performed by calculation of short-term peak or RMS levels. Relevance of peak versus RMS levels is determined by application. Before describing the utility of peak or RMS detection schemes for different purposes, it is useful to review the definitions of peak and RMS levels.

Figure 1

The short-term peak level (t) of a signal is strictly defined as the highest absolute value attained by the signal during the last time . Fig. 1 shows a plot of a signal and its short-term peak level. In practical use, the short-term peak estimate is smoothed by means of a nonlinear one-pole filter that has a different response time depending upon whether the input is greater than or less than the output. A simple signal is shown with its filtered peak estimate in Fig. 2. The short-term RMS estimate of a signal is formed by squaring the signal, low-pass filtering, and then taking the square root of the result. A signal and its RMS level are plotted in Fig. 3. As these figures show, peak and RMS estimates are both nonlinear processes that produce outputs that are greater than or equal to zero at all times.

Figure 2
Figure 3

Historically, DRC is applied for two main reasons. The first is to accommodate transmission or storage of a signal when limited dynamic range is available, or to reduce unwanted noise in a signal. The second reason for DRC is an artistic one: DRC is often used to change the way a signal is perceived. Depending upon the application, peak or RMS detection may be more appropriate.

The dynamic range of a transmission or storage medium is defined as the difference between the noise floor and the maximum attainable level. The dynamic range is usually measured in decibels, or dB. Common transmission and storage media include radio waves, CD and tape. For storage on CD, the maximum allowed level is defined fundamentally in terms of peak levels. While there is also a maximum possible RMS level that can be stored on CD, that level is determined partly by the statistics and particulars of the signal itself, and so allowed RMS level cannot be described as a fundamental property of CD storage. To zeroth order, FM radio transmission bandwidth is also related to the peak levels of the audio signal being transmitted, so that peak signal levels can be relevant to radio transmission. RMS levels, on the other hand, are important to human perception, and correlate loosely with perceived loudness of a signal.

When dealing with a medium that has limitations based on peak levels, it is natural to employ DRC based on peak detection. One common use of peak detection is to reduce peak levels without greatly reducing RMS levels, effectively reducing the peak-to-RMS ratio of a signal. This allows perceived loudness to be increased without exceeding a fixed peak signal level. Thus, peak detection is often used for audio that will be stored on CD, to increase the energy and loudness of a signal while preventing clipping.

RMS detection is ideal when the goal of DRC is to equalize loudness of a signal over time. Compression based on RMS detection will reduce the short-term or long-term dynamic range of the RMS content of a signal, irrespective of peak levels. This can have a high utility for artistic purposes, or for reproduction of a signal in an environment with a high noise floor. Other applications favoring RMS detection include multiband compression. In multiband compression, the input signal is decomposed into separate frequency bands that are compressed individually before being recombined. Peak levels for the recombined signal are not related in a simple way to the peak levels attained by the subband signals being compressed, so that peak detection is not entirely relevant. However, it is roughly true that the RMS value of the reproduced signal will be simply related to the RMS value of the subband signals, making RMS detection attractive.

While application may favor one estimation technique over another, if DRC is being used to alter the perception of a signal, it is best to trust the final arbiter of perception, the ear. Even for the same application, no one DRC device will always produce the most pleasing result. That is why it is best to have an arsenal of different DRC choices. Application may influence the best choice of a first device to try, but in the end, equipment should be selected by listening.

Good Luck!

Do you have a question for the Doctors?