Take a song that has loud and soft parts. It would perhaps be difficult to hear the soft parts. You could turn the volume up to hear the soft parts but then perhaps the loud parts will become too loud. You could play with the volume knob to turn it up during the soft parts and turn it down during the loud parts, making the soft parts louder, or the loud parts softer, or both. A compressor does just that: it changes the amplitude dynamics of the sound to bring the softer and louder parts closer together. An expander does the opposite.
A compressor / expander of dynamics changes the amplitude dynamics of sound, usually bringing the amplitude of soft and loud parts together (compressor), or taking them further apart (expander).
For example, if you are recording the vocals to a song and these vocals have quiet and loud parts, you could do of the following: 1) you would come closer to the microphone during the soft parts and pull back during louder parts; 2) you would have your engineer change your gain up and down during the song; 3) you would run your vocals through a compressor. All these are examples of compression.
Simple practical compressors
Practical compressors have various characteristics. Even simple compressors have at least a "threshold" and a "compression ratio". The threshold is the amplitude level above which the compressor acts to change the amplitude dynamics of the sound and below which the compressor does nothing. The compression ratio is usually the ratio by which the amplitude of the sound over the threshold is changed.
For example, you can set a threshold of -20 dB and the compression ratio at 4:1. If the sound level exceeds -20 dB it will be brought down by a ratio of 4 to 1. If, for example, the sound level is at -10 dB, which is 10 dB over the threshold, it will be brought to 2.5 dB over the threshold, which is to -17.5 dB. In simple compressors the sound at levels under -20 dB will remain unchanged. The end effect of this is that loud parts are brought down closer to soft parts. (Here the signal will be measured in decibels with respect to some maximum signal level of the system – of the equipment or software. That maximum output level is at 0 dB.)
Simple expansion works similarly, except that louder parts will be made even louder to move them further away from softer parts, which could be useful for bringing different instruments together (see below).
Characteristics of more complex compressors
More complex compressors have other characteristics.
- A compressor / expander may have "separate compression / or expansion ratios above and below the threshold".
- A compressor / expander may transition slowly from one compression ratio to another, which is known as having a soft knee, or the transition may be fast, which is known as having a hard knee (see below).
- A compressor / expander may have "more than one threshold".
- A compressor / expander would normally have an "attack time": the time it takes for the compressor to actually bring the gain down (if, for example, the attack time is set at 50 milliseconds, the first 50 ms of sound after the signal crosses the threshold will be used to get to the desired compression ratio from having no compression, whether or not the signal is above or below the threshold).
- A compressor / expander may have a "release time": the time it takes for the compressor to stop working after the sound level drops below the threshold (if, for example, the release time is 500 ms the compressor will change the gain over 500 ms after the sound drops under the threshold until it reaches a point of no compression).
- A compressor / expander may have attack and release times that are dependent on the level of the input signal.
- A compressor / expander could have some "input or output gain" that will additionally amplify all sound that comes in or goes out (sometimes called "compensation gain").
- A compressor / expander may respond to instantaneous peaks in the input signal, or may average the input gain over a short time period, before deciding whether the input gain is above or below the threshold.
- A compressor / expander may link the various channels of the input signal and use compression on all channels whenever one channel needs to be compressed. Alternatively, a compressor / expander may treat each channel independently.
- Last but not least, compression can make changes to one signal / track based on how another signal / track compares to the set thresholds ("side chaining", "side chained gate or compressor"). Certain compressors may side chain a signal to a version of itself. Typically, the compressor will modify a delayed version of the signal, but will be triggered by a non-delayed version of the same signal. This allows the compressor to act quickly and even preemptively, thus creating much smoother dynamics. Such compressors are said to be "looking ahead".
Using compressors and expanders
One of the reasons for using compression is to control the amplitude dynamics of instruments, as they may have different qualities when recorded loud or soft. You can capture the natural qualities (timbre) of soft and loud vocals without worrying about losing the soft parts in the mix or overpowering the mix with the loud parts.
Compression can also be used to add sustain to instruments that decay quickly. Compressing cymbals, for example, ensures that the cymbal initial hit on the cymbal is brought closer to the cymbal decay. Adding some compensation gain then brings the cymbals up in the mix and adds sustain.
Compression is often used in "de-essing". Sibilance frequencies in vocals can be filtered out from the mix with an equalizer and used to trigger the compressor. The compressor then acts only when those frequencies are present effectively lowering sibilance in the mix.
One reason to use expansion is to bring instruments closer together in the mix. If an expansion is applied to the bass and side chained to the drums, the bass will thump with the drums.
Another reason to use compression is that songs that are less dynamic can take less storage space (especially in the digital recording world, where you can work with smaller numbers to carry the information). Radio signal is compressed for that reason.
The general advice given about compression is: If you can go without it then by all means do so. Compression was widely used a couple of decades ago, but not so much recently. One way or another, compression does change the recorded sound and so its use is a matter of individual taste.
Compression / expansion graphs
A typical graph that represents the relationship between the input and output levels of a compressor is as follows.
The blue line shows all points where the level of the output signal is equal to the level of the input signal. The blue line represents no compression or expansion (i.e., compression with ratio 1:1).
The red line is an example of a compressor. When the input signal is below -10 dB, the red line overlaps with the blue line and there is no compression or expansion. As the input signal exceeds -10 dB, it is compressed. For example, at -6 dB input, the output signal is -8.67 dB. At -6 dB the input signal exceeded the threshold of -10 dB by 4 dB and was changed to -8.67 dB, which only exceeds the threshold by 1.33 dB. This means that the signal was compressed by the ratio 4 : 1.33 = 3:1.
The green line is an example of an expander. When the input signal is below the threshold, it remains the same. When the input signal is above the threshold, its gain is increased and it is expanded. The expansion ratio is 1:2. This is not the typical way an expander works, however. Rather than increasing the gain of the signal above the threshold, an expander will typically lower the gain of the signal below the threshold. An expander then would be as in the graph below (in green).
The red line would be an example of a compressor, even though compressors typically work as in the first graph above.
Soft knee and hard knee compression
Soft knee compression smoothes out the transition from below the threshold to above the threshold as in the graph below (in green). This means that the compression ratio changes slowly with larger levels of the input signal to the final compression ratio for the signal above the threshold.
A limiter is simply a compressor with a very high compression ratio and with very fast attack and release. A limiter usually has a compression ratio higher than 10:1, attack of, say, less than 5 ms, and a release of up to, say, 20 ms, although limiters vary. A limiter that has a compression ratio of 20:1 or over is known as a "hard" limiter or a "brick wall" limiter. Limiters can be designed to prevent overload on analogue systems (overloads in digital systems do not occur in the same way, as the amplitude of digital audio is naturally limited to its sampling resolution).
Combining compressors / expanders
When compressors are combined in parallel, usually one of them uses minimal compression ratios whereas the other uses higher compression ratios. When the two output signals are combined, the gain of signals with smaller gain is boosted, with little change to the dynamics of the signals with higher gain, thus improving the low gain recordings.
When compressors are used one after the other, one compressor will have smaller ratios and slower attacks and release to smooth out the signal, whereas the other compressor will have higher ratios and faster attack and release to control significantly higher peaks.