压缩

Current version of the page has been reviewed and is approved ().


 压缩器是通过减少最高和最低电平之间的差异来处理音频信号动态范围的重要工具。简单的说,当信号电平超过阈值时,压缩器会按一定比率降低电平,这意味着压缩器起到了衰减处理器的作用。也可以使用音量或增益参数手动进行这些更改。然而,选择压缩器而不是手动设置增益的原因是压缩器具有自动控制信号幅度或增益的优势。这些工具使用复杂的算法,能够在几毫秒内检测和响应变化,其精度水平超越了人类的能力。广播、音乐或任何涉及音频信号的工程领域等行业都利用了这种逻辑。

How it works?

Figure 1: Compressor signal diagram

If we go through how the algorithm functions,

  • The signal goes into the compressor, and the level of the audio signal is detected in every frame or buffer (it depends on the compressor design).

  • Then the algorithm checks whether the signal level is above the threshold, which is an adjustable parameter manually. When the signal exceeds the threshold, the reduction that is specified by the ratio will be applied to the signal.

  • The exact time for initialization is controlled by the attack parameter, which refers to the speed of the compressor for reacting to the change in the signal, and makes it possible to exclude the transient(or desired part) of the audio signal from the compressing effect. At the same stage, another parameter called Release is responsible for terminating the compress. However, setting release to a fixed value might not fit every scenario in the audio signal. Because an audio signal might also include different sound sources gathered in it. Therefore, digital compressors usually have an “AUTO” option for detecting the incoming transient, and adjust the terminating time automatically.

  • The amount of compression is specified by the ratio parameter. For instance, A ratio of 4:1 implies that for every 4 dB that the input signal exceeds the threshold, the compressor will only allow 1 dB to pass through to the output.

  • Since the signal gets attenuated by the compressor, the overall output signal level will be lower compared to the input signal level. Therefore compressors have a function that amplifies the output signal automatically to match the input-output level balance. It is called “Makeup Gain”, but optional to use.

  • An extra setting: Knee Width. This option allows changing the sharpness of the curve applied by the ratio.

Theory

As an attenuator, the compressor lowers the difference between the input and the output signal. The graph shows the before and after stages of the audio signal and the compressor's ADSR settings.
Figure 2: The Waveform Comparison of Input and Output Signals

The figure illustrates the following:

  • The amount of reduction applied by the compressor.

  • How a certain attack time excluded the transient portion of the waveform that triggered the compressor. (red arrow)

  • How the quieter parts were also affected by the compressor due to a long release time. (blue arrow)

Figure 2 shows the input-output relationship of the simplest compressor. The signal amplitude xIn refers to the Input level, while the output is represented by yOut. For the assumption that the compressor functions without a softened knee, the correlation between input and output can be explained by:
Figure 3: In and out levels of a compressor with different ratios

y_{out} = \begin{cases} x_{in} & x_{\text{in}} \leq T \\ T + \frac{x_{in} - T}{R}, & x_{in} > T \end{cases}



  • xIn , yout= input/output
  • T = threshold in dB
  • R = ratio


In the case the input level is lower than the threshold (or equal to it), the compressor results in the same output. The line marked 1:1 implies that input and output are the same. But for the other case, the signal is compressed depending on the ratio. For instance, for the 2:1 ratio, every 2 dB in Δx results in 1 dB Δy.
The signal will be multiplied by 0.5. The 4:1 Ratio refers to multiplying the signal by 0.25. But ∞:1 results in completely limiting the output no matter how much the input signal level is. Therefore it's called limiting.

Some compressors might include an option for adjusting the knee width. A sharp transition refers to a hard knee and causes the compression effect to be more noticeable and aggressive. In contrast, a soft transition implies a knee curve gradually raising from a 1:1 ratio at the corners to the desired ratio towards the middle.
In case we introduce W = knee width variable,
Figure 4: A Compressor Including Knee Width

y_{out} = \begin{cases} x_{in} & 2(x_{in} - T) < -W \\[10pt] x_{in} + \frac{\left( \frac{1}{R - 1} \right) \left( x_{in} - T + \frac{W}{2} \right)^2}{2W} & 2|x_{in} - T| \leq W \\[10pt] T + \frac{x_{in} - T}{R} & 2(x_{in} - T) > W \end{cases}


How does it sound?

Some audio samples are listed to perceive the compression effect intuitively. Whilst The first sample is unprocessed, the other samples are compressed by 1:2, and 1:4 respectively. Hint: Notice how the audio level becomes more consistent as the compression ratio increases, and pay attention to how the clarity of the words improves.

En./compressor_vocal_unprocessed.wav
En./compressor_vocal_2_1.wav
En./compressor_vocal_4_1.wav


Besides providing consistency at the audio level, the compressor is also used to enhance the noticeability and aggressiveness of the applied signal.
En./Raw_kick_sample.wav
En./Compressed_kick_sample.wav


or oppositely, making it less noticeable and soft within the music (reducing the attack values by catching with the compressor).
En./Raw_guitar_sample.wav
En./Compressed_guitar_sample.wav

Development and use of various technologies

Tube Compression

The development of audio compressors began in the 1940s and 1950s with the first tube compressors used in recording studios. They were developed for radio broadcasting to keep voice transmission at a constant level. They played a central role in the recording and mixing of music, as they made it possible to control the dynamic range of audio signals while preserving the characteristic sound of the tubes.

In principle, tube compression uses a changing bias voltage to control the gain of a tube depending on the input material. And because tubes are a non-linear component, a tube compressor does not work linearly either: the louder a signal is, the greater the ratio with which it is compressed. Due to their non-linearity, tube compressors naturally have a soft-knee circuit. 

These early devices, such as the legendary Fairchild 670, used vacuum tubes for dynamic signal processing and were known for their warm, musical sound. As the ratio of a signal depends on the input volume, you cannot adjust the ratio on a tube compressor. The amount of compression is determined by the input and threshold controls; a tube compressor is not the fastest, with the Fairchild the shortest attack time is 200 milliseconds. The Fairchild's release times are between 300 milliseconds and a whole five seconds.

Opto Compression


The 1960s saw the advent of opto-compressors, which used a light source and a light-sensitive cell to control the signal level. Here, the strength of the input signal determines the brightness of a light bulb or a light-emitting diode. Opposite this light source is a light-sensitive resistor whose value increases as the light becomes brighter. The higher the resistance, the greater the level reduction. This technology resulted in a natural and smooth compression that became particularly popular with vocals and acoustic instruments as it maintained a musical and organic dynamic. An attribute that is always associated with the optical compressor: Musicality. This means that the compressor is still largely inaudible even with heavy compression. Because it is also an extremely transparent compressor, it is often used on vocals or solo instruments.

A well-known example of an opto-compressor is the Teletronix LA-2A. The LA-2A has two controls: a gain control and a peak reduction control that adjusts the amount of compression. It has fixed settings for attack and release times:

Attack Time: Approximately 10 milliseconds.
Release time: The release takes place in two phases - a fast first phase (approx. 60 milliseconds) and a slower second phase, which can take up to 5 seconds depending on the signal progression.

FET Compression

At the same time, FET (field-effect transistor) compressors were developed that used transistor technology to improve the precision and speed of compression. Gradually, tubes were replaced by the “new” and “modern” field-effect transistors. These components were basically designed to mimic the operation of tubes, but without their negative side effects such as dangerously high voltages, excessive heat generation during operation and the limited life of tubes.

FET compressors, such as the famous Urei 1176, are known for their aggressive and fast character and are often used in drum and percussion recordings to achieve a powerful and assertive sound. Compared to tubes, FETs work much faster, which enables shorter attack times. Nevertheless, FETs are not exactly known for their transparency. In addition, early FET compressors had input and output stages with transformers, which also colored the sound. In other words, an FET compressor has a characteristic sound. 
The 1176 does not have a separate threshold control; this is practically integrated into the input control: The louder the signal is fed into the compressor, the more compression is applied. The control times of the Urei 1176 are known to be relatively fast, even at the slowest settings. The 1176 is therefore particularly suitable for processing transient-rich signals. The attack times range from an extremely short 0.02 ms to a maximum of 800 ms, while the release times vary from 50 ms to a maximum of 1.1 seconds. The control times range from slow to fast, with the slowest value being set with the potentiometer stop on the left-hand side; the further you turn the control to the right, the faster the values become.

Four ratio values can be selected via pushbuttons. On the original devices, these ratio switches are actually “removable”; if you press a switch, the previously selected switch jumps back to its off position. However, it is possible to press all four ratio switches at the same time, which confuses some of the settings in the device and results in a very special sound. This trick is known as “all-button mode”.

VCA Compression

In the 1960s and 1970s, the use of transistor-based compressors became increasingly popular, including VCA (Voltage Controlled Amplifier) compressors. These compressors used electronic circuits to process the audio signal precisely and quickly. VCA compressors allowed for precise control of compression and proved ideal for applications where clear and transparent signal processing was required, such as drum tracks and the broadcast industry.

A VCA is a voltage-controlled amplifier module in which the compressor uses a control voltage to regulate the gain factor depending on the input signal. The advantage of this control lies in the complete control over the control times, whereby very short attack times are also possible. In general, VCA compressors are extremely flexible in terms of their application possibilities and are also characterized by a neutral sound. Nevertheless, with the right tools you can get almost any sound you want out of a VCA compressor. Examples of this are the Empirical Labs Distressor, which sounds anything but neutral, the dbx 160 and the SSL Bus Compressor. 

The VCA compressor is versatile and can be used both as a summing compressor and in individual channel strips. Particularly noteworthy is its ability to effectively process transient-rich and percussive signals such as drum recordings and drum subgroups thanks to the precisely adjustable timing values, especially through the technique of parallel compression. 

In this process, the signal is duplicated (or routed to a stereo aux path), with one signal remaining uncompressed while the other is heavily compressed. The highly compressed signal is then quietly added to the original signal. This produces lively drum tracks that are both dynamic and assertive. This is known as the New York compression trick. Set the attack time to the fastest possible and the release time to a relatively slow 500 and 1,000 ms. The ratio should be set to 8:1 or even 12:1 and the threshold should be set to compress between -10 and -15 dB. On the parallel track after the compressor, the EQ is raised slightly at 100 Hz and at 10 kHz. The bass can also be routed to the parallel bus to blend the rhythm group more strongly.

Digital Compression

With the advent of digital technology in the 1980s and 1990s, digital compressors were developed that allowed for more precise signal processing while offering the flexibility of software solutions. These digital compressors could perform more complex processing, such as multiband compression, which allowed different frequency ranges to be adjusted independently of each other.

In recent years, technology has evolved and modern software compressors now use artificial intelligence (AI) to provide even more precise and user-friendly tools. These AI-based compressors automatically analyze the incoming signal and adjust the parameters in real time to achieve optimal results. This technology makes it possible to optimize the sound while saving time by integrating the experience and knowledge of sound engineers into the design of the algorithms. The development of audio compressors thus reflects the general technological progress in audio technology, from analog tubes to intelligent digital solutions.

Literature

  • Giannoulis, D., Massberg, M., &amp; Reiss, J. D. (2012). Digital dynamic range compressor design—A tutorial and analysis. Journal of the Audio Engineering Society, 60(6), 399-408.
  • Reiss, J. D., &amp; McPherson, A. (2014). Audio effects: theory, implementation and application. CRC Press.
  • Pirkle, W. (2019). Designing audio effect plugins in C++: for AAX, AU, and VST3 with DSP theory. Routledge.