Apr 25, 2008

How compression works

How compression works
Most compressors offer the same basic controls, which allow you to set the following:

Threshold: Where the compression effect kicks in

Ratio: The amount of compression applied above the threshold

Attack and Release times: The length of time after the threshold is crossed that the effect is applied and removed

Figure 1 illustrates what different compression curves look like. Looking at the curve, you'll see that signal levels below the threshold are unaffected, and signal levels above the threshold are attenuated. The higher the compression ratio is, the more attenuation. When the compression ratio is high, it is known as limiting, because it more or less prevents the audio from exceeding the threshold.


Figure 1: Compression curves with different compression ratios


Setting a threshold
To illustrate how different threshold settings affect the output, let's assume that we're working with the audio file illustrated in Figure 2. We can see that this file has peaks as high as -2dB, but the bulk of the file is below the -10dB mark. If we want to compress this file lightly, we should set a threshold in the -6dB to -10dB range. Figure 3 illustrates compression applied to this file using two different thresholds, -6 and -20dB.


Figure 2: The audio file from Figure 7.5 after compression using a threshold of a) -6dB and b) -20dB



Figure 3: The audio files from Figure 2 after applying compensating gain


What is immediately apparent is that the file in Figure 2b has been compressed far more heavily than Figure 2a. We need to apply some gain to restore these files to their former levels. Figure 2b has far more headroom, so we can apply much more gain. After applying gain, we end up with the files illustrated in Figure 3.

These files are both much louder than the original, but if you look closely at the figure on the right, the entire file is loud. It doesn't have any dynamics left, because the dynamic range has been compressed. To be honest, this file might be a little too compressed. Files that have been over-compressed are fatiguing to listen to, because EVERY SINGLE SYLLABLE IS LOUD. Think of drive-time radio programs; they're highly compressed, because the DJs are going absolutely nuts in the studio. The idea is to compete with all the noise of traffic and to keep you awake on your drive to and from work. But this is not the type of programming you really want to listen to all day long (see the "Compression: How Much Is Enough?" sidebar).

If your original audio file is well recorded, you should have peaks in the -3dB to -6dB range. Choosing a threshold in the -6dB to -10dB range is a safe starting point. This way, you're only compressing the loudest sections of your file, leaving most of your file untouched. If you find yourself dropping your threshold much below that, you may consider revisiting your signal chain to figure out why your recording is so quiet in the first place.

Setting a ratio
The ratio setting determines how much compression is applied over the threshold. For example, a 2:1 compression ratio means that for every 2dB by which the incoming signal exceeds the threshold, only 1dB of gain is applied. Ratios up to around 4:1 are mild and can be used safely, provided you set a sensible threshold. Ratios in the 4:1 to 10:1 range are fairly heavy and should be used with caution. Any ratio over 10:1 falls into a special category known as limiting.

Limiting can be useful as a preventative measure, but it isn't appropriate as your main form of compression. For most applications, start off with a ratio of 4:1 and experiment with using slightly more or less until you achieve the effect you're after. In particular, voices are particularly compression tolerant, so if you don't have any music in your podcast, you may be able to use more compression (see the "Compression: Voice versus Music" sidebar).

Setting attack and release times

The attack and release times control how quickly the compression effect is applied to signals that exceed the threshold you set, and how quickly the signal level is returned to the original input. For most content, you want a quick attack time, so signals that exceed the threshold are immediately attenuated. For the release time, you want something a bit longer, so the sound doesn't abruptly get returned to the original level.

This is fairly self-evident from the attack and release controls. The scale on the attack control knob generally is in milliseconds, and the scale on the release knob is in seconds. Start with a quick attack, say 10-20 milliseconds, and a gradual release around 500 milliseconds. These settings should work for most podcasting content, but don't be afraid to play around with your compressor to see how these settings affect the compression.

No comments: