Friday, November 27, 2015

How Compression works audioengineering

Recently, I've heard a lot of people authoritatively misrepresent what compression is and how it works. Unfortunately /r/audioengineering has not been exempt from the misinformation brigade. I thought it might be useful to start a discussion of some essential concepts of compression.

To many of you, this will sound extremely elementary and obvious. To others of you, this will sound inaccurate and wrong; you are the group I want to address so that we can correct some of the misinformation floating around.

What is compression?

Compression is automatic gain reduction. The nature of the gain reduction is, in the case of opto compressors, equivalent to pulling down a traditional fader (e.g. using a variable resistor in the signal path), and in the case of VCA-based compressors, equivalent to pulling down a fader on a VCA-based console (varing the voltage controlling the VCA). Vari-mu and FET-based compressors use slightly different mechanisms for gain reduction, but the result is the same: reduced gain. It's automatic because it uses the incoming audio to determine how much gain reduction to apply.

What is a threshold?

A threshold is the volume (voltage) at which a compressor will begin reducing gain. Once the volume exceeds the threshold, the gain reduction circuit kicks in and begins attenuating the signal.

What is a ratio?

Some compressors include ratio controls. Ratio controls allow you to have some control over how much gain reduction the compressor kicks in after the incoming signal exceeds the threshold. A compressor set to a 4:1 ratio, for example, will attenuate 3 db for every 4 db the signal exceeds the threshold. Those of you who are quick with math will note that by attenuating 3db the compressor has effectively allowed the audio signal to exceed the threshold by 1 db when an uncompressed signal would have exceeded the threshold by 4 db.

Does gain reduction affect the entire signal on the track? Or just the parts of the signal that exceed the threshold?

I've seen a lot of confusion on this point. The simple answer is that when a compressor applies 3db of gain reduction, it reduces all the signal on that track by 3db.

Imagine a simple example of a person singing into a microphone with an audible computer fan in the background. If that signal is run through a compressor and the singer belts a passage that kicks in gain reduction of 10db, both the voice and the computer fan will be attenuated by 10db for the duration that the compressor is attenuating. The compressor has no way of discriminating between the voice and the refrigerator. It only knows how to apply gain reduction when any part of the signal exceeds the threshold.

It may be helpful to imagine the compressor pulling back a fader any time it is reducing gain. This is a very technically accurate way to understand what is happening. Any signal on that channel will be affected, and, depending on the type of compressor, even the mechanism used to reduce the gain may be almost identical.

Is compression different than pulling down a fader?

From a technical standpoint, there is very little difference. If you could pull a fader down and push it back up at the exact same time in the exact same way say an LA-2A optical compressor applies gain reduction, the result would be identical (ignoring any pleasant non-linear artifacts of the rest of the LA-2A circuit).

The only difference is timing and consistency. Because compressors are automatic gain reduction devices, they can in many cases apply gain reduction more quickly and consistently than you could ever do by moving a fader. This "automaticness" provides a wealth of applications and can be used to get some really interesting and pleasing results. The compression "rabbit hole" is very deep for this reason. In short, though the nature of the gain reduction being applied is no different, you can't get the same artifacts (side-effects) that a compressor can.

It should be noted here that many compressors also include elements in their signal paths that may have a pleasing effect on the signal. A friend of mine, for example, always tracks audio through his Manley Vari-Mu compressor, even when the unit is in bypass, for the pleasing effect he feels it has on the audio.

What is attack?

Attack is how long it takes the compressor to apply a certain amount of gain reduction (usually 10db). In the fader analogy, it's how long it takes the compressor to pull the fader back 10db. I mentioned earlier that compressors use the incoming audio to determine how much gain reduction to apply. Once the signal exceeds the threshold, depending on the type of gain reduction device in the signal path, this process can take some time. An optical compressor, for example, kicks on a light source (LED or bulb) to illuminate a light-sensitive variable resistor. You can imagine that it might take some time for all these components to react, and indeed it does. The LA-2A, for example is an optical compressor with an attack time of around 10 ms. This is faster than you can pull down a fader, but it may be too slow for say a close mic on a snare drum--the loud snap of the snare might sneak past the compressor before it has time to attenuate.

Other compressors are very fast. The 1176 has a variable attack time of between .2 and .8 ms--plenty fast to catch those quick snare snaps.

What is release?

Release is how long the compressor takes to stop attenuating the signal. In the fader analogy, it's how long it takes the compressor to automatically return the fader to its original position.

Release is one of the most important controls (on those compressors that release include controls) because it's how long it will take for the compressor to boost back to the original gain sounds like room noise. A compressor working on a drum room mic, for example, might apply 5db of gain reduction after a snare hit. Remember that every sound on the channel will be attenuated 5db until the compressor returns the signal to its original level. With a very fast release time (the fastest on our good friend the 1176 is around 50 ms), it will return gain to "normal" quickly enough that you'll be able to hear the sound of the snare drum ringing around the room. You may even be able to hear the snare drum itself "singing"--both events that last only a short time after the initial snare hit. These sounds are much quieter than the snap of the stick hitting the drum head, but if the compressor can attack fast enough and release fast enough, it will attenuate the stick hitting the head and return the signal to normal just in time to hear some of the quieter after effects.

The above is an example of how a compressor can achieve effects that you would not be able to by moving a fader with your hand.

What is make-up gain?

Make-up gain is an amplification stage after the gain reduction circuit. Almost all compressors include make-up gain stages to raise overall level after attenuation. This doesn't necessarily need to be applied using the compressor's internal gain stage. Using a different amplification stage (for example adding a mic preamplifier) after the compressor would have a similar effect.

Make-up gain is wonderful because, now that the compressor has attenuated the loud parts of an audio source, we can boost the entire signal without fear that the loud parts will cause problems (peaks on a recording device, for example).

When should I use a compressor, and when should I use a fader/automation to control volume?

This is opening a huge can of worms, but I would generalize and say use a compressor when its artifacts (side effects) are pleasing or when it does something you can't do with automation or manually with a fader (see some of the above examples). Use automation in all other cases.

For example, automation or manually "riding the fader" can be a great way to control level on a vocal part that has both very loud and very soft sections. You know the parts of the song that are loud and soft better than a compressor does, and you can even anticipate the loud parts by pulling down a fader (or turning down a knob) for the loud bits before they even begin. In the old days, engineers would use both a fader and a compressor to control a dynamic singer during recording. They would pull back the fader for the loudest parts and feed the signal into a compressor to take care of any remaining volume leveling that was needed. It's a very effective combination of techniques.

What about these kinds of graphs that I've seen used to describe compression?

I think they are problematic because A) they make no effort to describe the time-domain aspects of compression and B) they can lead to the misconception that somehow only the portions of the signal above the threshold will be affected by compression. I've come across many people (here and elsewhere) who believe that it's possible for two simultaneous sources on the same audio path to have different amounts of gain-reduction applied to them.

What aspects of compression aren't covered here?

There are many, many technical details about how compressors detect signal above the threshold, determine how much gain reduction to apply, and apply the gain reduction that are not mentioned here.

Thanks, and I hope this clears up a misconception or two out there or helps someone new to compression.

I know reddit is big on sources, so here are a few. Dave Hill's excellent whitepaper. Note on p.7 he uses essentially the exact same description of compression that I've given above:

http://ift.tt/1YyGnwp

Paul White is always a great read, though I'd prefer that he emphasize gain reduction in the portion talking about ratios:

http://ift.tt/1Birki6



Submitted November 28, 2015 at 03:43AM by itsjakeandelwood http://ift.tt/1YyGnwr audioengineering

No comments:

Post a Comment