Compression is an audio processing tool used to manipulate the dynamic range of a signal. Compressors are often used to make signals have a more even volume, making it more comfortable to listen to.
An audio signal's dynamic range is determined by the loudest and the quietest parts of the signal, and is what gives life to audio. A compressor generally works by reducing the volume of the loudest parts of the signal, but leaving the quieter parts alone. By decreasing the loud parts of the audio, the dynamic range is also decreased.
The goal of compression is to maintain that life while controlling fluctuations so that an audio source can be reinforced into a sound system, personal listening device or phone call comfortably. This is done by manipulating the dynamic range with different types of compressors. This article will cover what makes a compressor a valuable tool and how to use it effectively in different scenarios.
In order to control a sources dynamics without crushing its dynamic range, a compressor should only act on peaks and allow all other audio to pass unaffected. This can be done by setting a threshold which tells the compressor at what volume it should begin compressing. Lower threshold settings means more of the signal will be compressed.
Once the input signal passes the threshold level, the amount of compression applied is governed by the compressor's ratio setting. Attack time and release time settings allow control over how quickly the compressor engages and disengages. Since a compressor's goal is to reduce level, after it has been processed it's best to apply make-up gain to return the signal to it's previous level just with more dynamic control. All of these settings come together to provide a versatile dynamics processor.
The ratio of a compressor is what determines how much the input level is reduced once it passes the threshold. Most of the time this setting is in the form of a real ratio (e.g. 4:1, 12:1), other times the ratio is implied (e.g. 4, 12) since it is always compared to one. For example, when using a ratio of 4:1, every 4dB increase in the input signal's level above the threshold level will result in only a 1dB increase in the output signal's level. The higher the ratio, the more compression is applied.
Once the threshold and ratio are dialed in the compressor's timing must be set. This comes in the form of an attack and release time. The attack is how quickly compression is applied once it crosses the threshold and release is how long it takes to return to normal after it has dropped below the threshold. In most cases, the attack time is much faster than the release time. This is so that a compressor can react fast enough to be effective and then release compression away more subtly to keep audio sounding natural.
With a general understanding of how compression works, here are a few examples to dive in deeper. The waveform below is the input source for a compressor with a threshold marked in blue.
Here is how compression would be applied to this waveform.
The added red curve along the top shows the gain reduction curve. This curve represents how the compressor reacts to the waveform once it crosses the blue threshold. At that first intersection of the threshold, the compressors attack begins reducing gain. Only six peaks cross the threshold so after that sixth peak, the release is set in motion and the gain reduction is returned to zero.
There is another smaller waveform in red within the original showing the compressed audio. This compressed signal shows how much audio is initially reduced and how it returns back to normal after the release time elapses. Lets look at those side by side to see that difference more clearly.
Input audio: Output audio (compressed audio):
The output is all around smaller in size so it is lesser in volume after being compressed. The audio is also more even after the first peak, or better known as the initial transient. This would be considered a slower attack since some of the initial transient was able to pass through. It was lowered in level but not fully removed. A fast attack would be able to reduce that transient more allowing less to pass the threshold.
Here are some more example waveforms that shows how much attack times can differ the source audio. The first waveform is a dry, uncompressed waveform of the word "Tesira." It was annotated to show how the transients are represented by the spoken word.
Input: Output (fast attack time): Output(slow attack time):
A fast attack works almost instantly on the signal bringing all transients down. This will create a more audible gain reduction but controls the volume more evenly. Times less than 5 millisecond should be considered a fast attack.
Using a slower attack allows part of the transient to be reduced while the majority of the word is also brought down. This keeps some dynamic range to the input while still controlling levels. If that attack is too long, it will not reduce gain fast enough to be effective. Anything longer than 30 millisecond should be considered a slower attack time.
Comparing the waveforms above show how a compressor's attack setting can greatly alter the source audio. A fast attack yields a much smaller dynamic range, while a slow attack shows a greater dynamic range, yet both show a decrease in level and more managed audio signal compared to the source.
There must be a balance between the release time and the source audio so that the compressor's gain reduction stops between words or phrases and doesn't persist to the next transient.
If the release is too fast, there will be audible pumping that is the result of the compressor reducing level and releasing it mid phrase. In turn, if the release is too slow the compressor will not stop reducing gain before the next phrase and all of the dynamics will be sucked out. Take a look below at how a proper compressors release time should act compared to what a poor release setting looks like.
A proper release should apply gain reduction and let up naturally so the next transient is treated like a new source with zero starting gain reduction.
Too slow of a release time will result in gain reduction from the first transient lingering on to the following and pulling all dynamics out of the source.
With a release time that is too fast, there is an unnatural and inconsistent gain reduction as it is fast enough to let up on compression between individual peaks within one phrase. The resulting audio has a pumping sound as gain dramatically fluctuates.
After a compressor has processed audio, its gain reduction algorithm will have reduced the output level. Take a look at the compressed waveforms shown above for instance, they are all smaller once compressed. Make-up gain in a compressor adjusts the output level to compensate for this. That way the compressed signal can be brought back up to the relative level it was at before, only with more dynamic control.
Take a look at the waveform of "Tesira" again. Only this time, the compressed audio has had makeup gain applied to it within the compressor.
Input: Output with make-up gain:
There is not a huge difference between these two waveforms other than a few of the larger peaks have been brought down and the tail end of the signal is a similar level to the beginning. Setting make-up gain on a compressor is crucial to processing the dynamics properly. The end result of compression shouldn't be a quieter output, but one that is more dynamically controlled.
Limiters are a form of compressor only with a high ratio and fast attack. The goal of a limiter is to prevent all transients from passing through the system as efficiently as possible. It is not uncommon to see a limiter with a ratio of 100:1 or greater and an attack time of less than 1ms, so that any high level transient can be cut off. Since some transients occur faster than processing can stop it, some limiters employ a look-ahead delay which combats this by delaying the entire audio signal to give itself time to reduce it. Here is what the output of a limiter would look like using the waveform above.
Limiting is a very important type of compression most often used in speaker processing to help protect amplifiers and speakers from harm done by improper use of microphones and audio equipment.
Some compressors have the ability to work with an inverse ratio, (like 0.5:1) and create what is called an expander. A lot of the same rules apply to expanders as compressors. There is a set threshold at which gain reduction begins, and a ratio that controls how much gain is reduced once the threshold is crossed. The major difference is that an expander acts on lower level input letting all higher level input pass unaffected. Since that ratio is reversed, it'll act on everything that falls below the threshold as opposed to how compression acts on signal that go beyond its threshold.
Close attention must be paid to setting the attack and release times with an expander. As they both still refer to how fast gain reduction is applied to the input, they must be treated in reverse to compression. The release time now affects the initial transient and should be fast enough to reduce gain reduction and attack refers to how soon after the source drops below the threshold that gain reduction is applied.
Here is an example using the same waveform as with compression but with some added low level waves prior to the transient and a shifted threshold suited for expansion.
This is how compression would be applied to this waveform when configured as an expander.
Just as with compression, the red curve along the top shows the compressor's gain reduction. The attack and release times for expansion have switched places and the curve looks much different. Let's put these side by side to show input versus output more clearly:
The transient and bulk of the audio waves are left alone but the lower level input before and after are reduced. Looking at these side by side show how the dynamic range of the input is increased working in opposition of compression. Using the two processors in line can benefit from one another. Compression can be used to reduce the loud peaks and the dynamic range and then expansion is used to gain back any lost dynamic range.
A more common use of expansion is to help reduce unwanted noise from the source. This can be hum introduced to audio lines, room noise picked up in a microphone, or bleed from other audio sources. This noise can be reduced by a different audio processor called a gate which works by fully removing all audio that passes below the threshold. This processor is a form of expander but with a 0:1 ratio. Just like a limiter is an aggressive form of a compressor using a >100:1 ratio, a gate is an aggressive expander using a 0:1 ratio. Here is what the output of the above waveform would look like ran through a gate instead:
The benefits to gating come when multiple inputs are active with unwanted noise. The more sources that are active the louder that noise grows. Being able to essentially turn off those inputs helps overall noise from compiling. If expansion was used in place, this noise would be reduced but not fully removed.
The drawbacks to a gate are that sometimes they do not open fast enough and initial transients suffer. Where an expander will always let a small amount of level pass so there will always be some of that initial transient even if it doesn't fully cross the threshold in time. This is crucial for speech applications so that words are received intelligibly.
Another use for expanders over gates also comes from speech applications, but when used on a telephone call. With a phone call, gating may sound too quiet as if the phone line has dropped the call. With an expander in place, there will be persistent input passing to the far end, just controlled and lowered noise.
The most overlooked feature of an audio processor is the bypass. The ear can quickly be deceived when tuning an audio source. The only way to check if the processing being applied is for the best is to audition it bypassed as a point of reference.
With compression, using make-up gain properly should result in a similar audio output level bypassed as engaged. Louder does not always mean better so set make-up gain effectively and listen for differing dynamics when bypassed.
Setting the threshold is key for compression to work properly. By having a peak meter right before the compressor allows accurate monitoring of the signal to set the threshold. If the threshold is set off of the input meter, any AEC processing, EQ, filtering, or noise reduction can greatly alter the levels leading to an inaccurate threshold.
Most compressor also have a built in gain reduction meter. This is a valuable meter to be able to see how hard the compressor is working to ensure the threshold is set correctly and speed settings are adequate.
The key to placing a compressor within a signal chain is managing what the threshold will see as an input. If there is a lot of filtering that is impacting the final result of the source, compression should occur afterwards so that it's not working to compress frequencies that are just being removed. In turn, if there are EQ adjustments being made on the fly, compression should take place beforehand so that the changes in EQ don't effect the compressors threshold. Same goes for any automated or user-controlled levels, these will also interfere with a compressors threshold if occurring prior to the processor. All of these points are up for debate, but are important to think about when placing compression into a signal chain.
When compression or limiting is used as a protection mechanism to prevent loud peaks from damaging a loudspeaker, typically in the output stage, this processor has to be the final processor in the signal chain. That way no matter what level or EQ boosts occur, the threshold cannot be overdriven and harm the amplifier or speakers in the audio system.
A side chain input on a compressor allows a different input source to drive the gain reduction. In this setup, the side chain input does not get mixed into the output signal, the original input audio is passed through per usual but compressed based on what the side-chain input receives. Below is a diagram of a standard compressor circuit where the input feeds the detector and triggers the threshold for gain reduction. Next to it is a side-chain circuit where the input is removed from the detector circuit and fed by a different source.
Standard compressor circuit: Side-chain circuit:
A common source for the side-chain input is a filtered branch of the original signal. For example, filtering out the low end on the side-chain input can help if the compressor is reacting too much to a source's low frequency content but the source itself doesn't require filtering.