A/V 103: The Basics of Audio Compression

This column is devoted to the basics of audio compression, a powerful signal-processing technique that is poorly understood by almost all of us. Once again, I hope you find it useful, or that you can pass the column on to some of your video colleagues.

THE DEFINITION

Audio compression refers to the regulation of the amplitude of a signal as a function of the signal itself. We use it to prevent signals from getting too loud and/or to keep signals at a comparatively uniform amplitude level. Related processes are called "limiting," "gating" and "expanding."

There is also an unrelated process called "data compression" that involves throwing out comparatively inaudible chunks of data in a digital audio signal (such as MP3 or Dolby Digital). Don't confuse such data compression with the audio compression we are talking about here. It's an entirely different sort of animal.

The dynamic range of audio signals is huge, and in most cases, we need to reduce that range in order to effectively transmit the signal to the listener.

To do that, we often compress the dynamic range of the signal. More specifically, we normally use the compressor to turn down the signal whenever it goes above a predetermined level. By doing this, we can keep a signal from getting too loud and going into distortion. We can also make the signal hover around a given predetermined level.

At its best, compression makes signals much more intelligible and natural sounding in a variety of conditions and contexts, without distortion. At its worst, compression is quite unnatural sounding and fatiguing to listen to. Interestingly, while it is a very powerful and effective signal-processing technique, it is also quite hard to hear out, so its use isn't necessarily very audible as compression so much as bad audio.


(click thumbnail)Fig. 1Take a look at Fig. 1, which illustrates the basic signal flow of a compressor (from "Total Recording," courtesy of the author). VCA stands for voltage-controlled amplifier, the gain of which is controlled by a DC voltage. The level detector converts the audio signal into a DC-control voltage with magnitude derived at least in part from the amplitude of the signal.

In this dramatically simplified circuit, the incoming signal is split, going both to the VCA and to the level detector. At the level detector, the signal is converted to a DC-control voltage that varies as a function of the signal level. The control voltage is used to regulate the gain of the VCA, so that as the signal level changes, the gain of the VCA changes. In a compressor, as the level of the signal goes up, the VCA level is turned down by a corresponding amount. Got it? Good!

The primary controls on a compressor are usually labeled "threshold" and "ratio." The threshold control sets the level below which the compressor has no effect (this is NOT shown in Fig. 1). Only when a level goes above threshold will it be compressed. If the threshold level is set at -10 dBFS, only signal peaks above that level will be compressed. The rest of the time, no compression will take place.

The ratio control determines how much gain reduction is applied to signals that go over threshold. A ratio setting of 2:1, for instance, will cause a signal that goes 2 dB over threshold to be reduced to 1 dB over threshold. A signal that goes 10 dB over threshold will be reduced to 5 dB over threshold. And so on.

ATTACK & RELEASE

The "attack" and "release" controls are secondary controls that adjust how rapidly the level detector follows the changing audio signal. Without going into why this is so important, just take my word that fastest isn't always best. Some ugly artifacts occur when the times are set too short, or too long.

What's reasonable? For the attack time, somewhere between five and 40 ms usually works well. For the release time, never less than 50 ms on a signal with low frequencies in it, and a good default starting value is around 150 ms.

Naturally, the nature of the signal has a great deal to do with the optimum settings. This will take practice on your part if you want to get good at it. In the meantime, you can't go too far wrong with the values I've given you here.

MAKEUP GAIN

A compressor turns down the level of the signal when it exceeds a threshold. This means that a compressor inherently reduces the overall level of a signal. Sometimes (perhaps mostly), what we really want to do is increase the overall signal level while reducing the peaks that would otherwise go into distortion. To accomplish this, we simply turn up the output level after the compression has been effected. This is called "makeup gain."

Now we are increasing the overall level of the signal after compressing the signal peaks. This is why signal compression often results in louder signals.

USING COMPRESSORS

A well-used compressor isn't particularly audible in its operation. The net effect is that the signal is more stable in its overall level, is comparatively free from distortion and overloads, and is more comfortably audible.

How to do this? In a word, gently! Set the threshold so that just the signal peaks are being compressed. Set the ratio to a fairly mild value, such as the above-mentioned 2:1. Think of 5:1 as an absolute maximum and 1.5:1 as a pretty good and very tasteful choice for much compression. Maximum gain reduction on the signal peaks typically should be between 3 and 6 dB. Meanwhile, set the attack time to 20 ms and the release time to 125 ms.

If you've done this right, you should barely hear any effect of compression at all. But your audio should come out sounding a lot more comfortable, stable and clean.

And there you've got it, sports fans--compression in a nutshell. Next month, we'll take a look at the uses and abuses of reverb. Meanwhile, keep the questions and comments coming.

Thanks for listening.

Dave Moulton