Understanding Compression 2
In the second instalment of this four-part series Greg Simmons takes us around the bend with the knee control before poking under the hood at the attack and release controls…
In the previous instalment of this four-part series we saw how a compressor can be represented by the block diagram shown below. The signal to be compressed passes through the Variable Gain Cell. The Envelope Follower monitors the input signal’s level and instructs the Variable Gain Cell to apply the required gain reduction (aka GR) based on the settings for threshold, ratio, knee, attack and release.
We focused on the interactions between the threshold and ratio controls, and demonstrated how they determine the required amount of gain reduction to be applied to the signal passing through the compressor. We used a peak-sensing VCA compressor applying downward compression, and introduced concepts such as ΔInput to represent changes of input signal level above the threshold level, and ΔOutput to represent the corresponding changes of output signal level above the threshold level.
We saw that a downward compressor increases the gain reduction when ΔInput increases, decreases the gain reduction when ΔInput decreases, and removes or applies no gain reduction when ΔInput = 0dB or a negative value, i.e. when the input signal level is equal to or below the threshold level. We also saw the simple relationship between input signal level, gain reduction and output signal level:
In this second instalment we’re going to see how the downward compressor applies and removes the gain reduction, starting with the knee control and then moving to the attack time and release time controls.
As with the previous instalment, we’ll assume we’re working in digital systems where 0dBFS is the maximum possible signal level and therefore all signal levels are represented as negative values because they are below 0dBFS. When applying the previous and forthcoming mathematical formulae to analogue processors – where 0dBVU is the nominal operating level and signal levels can have positive or negative values – we need to be vigilant about the calculations we make and where we put the + and – signs. Also as mentioned in the previous instalment, if we are using a digital emulation or model of a classic analogue processor we need to be aware of where that processor’s notion of 0dBVU exists on our DAW’s dBFS scale – otherwise we’re likely to push it too hard and not get the classic sound we expected.
COMPRESSION & KNEE
As we saw in the previous instalment, the threshold level ultimately represents the intersection between no gain reduction (a ratio of 1:1), and gain reduction applied in accordance with the chosen ratio. So far we have seen that the compressor’s transfer characteristic remains linear (1:1 ratio) up to the threshold level, and then shifts to a different gradient above the threshold level for all ratios higher than 1:1.
In mathematics the term knee is used to describe a point on a graph where the line bends towards a different gradient, forming a shape reminiscent of a leg bending at the knee. The intersection of the transfer characteristic and the threshold takes this shape and is therefore referred to as a knee.
The compressor’s knee control determines how the transfer characteristic transitions through the threshold, from 1:1 up to the desired ratio and back down to 1:1.
The illustration below shows the transfer characteristic of a compressor with a threshold level of -16dBFS and a ratio of 8:1. In this example (as with the examples given throughout the previous instalment) there is a sharply defined knee representing an immediate transition at the threshold.
As we can see, the ratio instantly changes from 1:1 to 8:1 when the input signal level rises above the threshold level, and instantly changes from 8:1 to 1:1 when the input signal level falls below the threshold level. The transition in this example is instant; it is more like a switch than a transition.
All input signal levels lower than the threshold of -16dBFS have a ratio of 1:1 and therefore have no gain reduction applied. All input signal levels higher than the threshold of -16dBFS have gain reduction applied at a ratio of 8:1.
This ‘instant transition’ characteristic is known as a hard knee. It is useful for corrective compression applications such as peak limiting where the gain reduction needs to be applied as soon as the input signal level exceeds the threshold level, and for enhancing compression applications such as sculpting a sound’s envelope to make it punchier.
The illustration below shows the transfer characteristic of the same compressor but configured with a soft knee. The threshold is still set to -16dBFS, the ratio is still set to 8:1, but the soft knee creates a gradual transition between ratios.
The ratio gradually transitions upwards from 1:1 to 8:1 as the input signal level rises through the transition region from -24dBFS towards -8dBFS, and gradually transitions downwards from 8:1 to 1:1 as the input signal level falls through the transition region from -8dBFS towards -24dBFS. In this particular example the transition region through the knee exists 8dB either side of the threshold, i.e. -16dBFS ±8dB. It is a very large transition region and would therefore be considered a very soft knee.
The ‘gradual transition’ of the soft knee is useful for corrective compression and other subtle applications where we want to reduce a sound’s dynamic range in a way that is not immediately obvious but is musically beneficial and supports the dynamics of the performance. The transition begins as the input signal level approaches the threshold level, using very low ratios to apply barely perceptible amounts of gain reduction. As the input signal level exceeds the threshold level the compressor gradually increases the ratio towards the selected value, all the while applying gain reduction in accordance with ΔInput and the increasing ratio value.
Hard vs Soft
The illustration below overlays the hard knee and soft knee transfer characteristics. In this example we can see that the hard knee adheres to the 1:1 ratio all the way up to the threshold level, where no gain reduction is applied and therefore the output signal level equals the input signal level. At the same time, however, the soft knee’s output signal level is approximately -17.7dBFS at the threshold level – meaning 1.7dB of gain reduction has been applied before the input signal level exceeded the threshold level of -16dBFS. In essence, the soft knee transfer characteristics starts applying gain reduction sooner than the hard knee, but takes longer to reach the selected ratio.
Most compressors offer a switch to choose between a hard knee or a soft knee. Some compressors offer a continuously variable knee control that allows us to fine-tune the width of the knee’s transition region to suit the dynamics of the sound or the performance – this is especially effective when used thoughtfully in conjunction with the attack and release times. Speaking of which…
COMPRESSION, ATTACK & RELEASE
As we learnt in the previous instalment, the Envelope Follower tells the Variable Gain Cell when to apply gain reduction and how much to apply. As we’re about to see, the Envelope Follower also tells the Variable Gain Cell how fast it can apply and remove the gain reduction; that is the role of the attack and release controls. They’re usually indicated in seconds, but what do those seconds actually mean?
Before answering that question, it’s important to mention that not all compressors have user-adjustable attack and release times. Some have switchable choices of ‘fast’ and ‘slow’ because their method of applying gain reduction does not allow for continuously variable attack and release controls. Some have no attack or release time controls because their method of applying gain reduction has inherent response times that cannot be changed but are, thankfully, sonically beneficial or acceptable.
It’s also important to clarify a common misdirection and a common misconception…
Target Gain Reduction
There is very little clearly-defined information regarding what a compressor’s attack and release times represent. One misleading explanation is that the attack time represents how long it takes the compressor to reach maximum gain reduction, which makes perfect head-nodding sense until we ask “What is maximum gain reduction?” Seeking an explanation leaves us with more questions than answers…
Some sources say it is the absolute maximum gain reduction the compressor circuit is capable of providing. Some sources say it is a predefined gain reduction, e.g. 6dB, that the manufacturer uses as a reference for measuring all attack and release time values. Some sources say it is the maximum instantaneous gain reduction, which corresponds with the gain reduction calculations we did in the first instalment of this series. Each of these is a plausible explanation, and, because there is no standard, any given compressor manufacturer could use any one of these approaches to measure and specify their attack times.
For the purposes of the following explanation about attack and release times we will use the term target gain reduction, referring to the maximum instantaneous gain reduction – which is the gain reduction we’ve been calculating throughout this series. So, target gain reduction represents the gain reduction that the compressor is aiming for based on the input signal level, the threshold level, the ratio and the knee. Therefore the attack time defines how long it will take the compressor to reach the target gain reduction from no gain reduction, and the release time defines how long it will take the compressor to return no gain reduction from the target gain reduction.
Pre-delayed Misconception
A compressor’s attack and release times are not delay times or pre-delays. An attack time of 0.5s does not mean the compressor waits 0.5s before suddenly applying the target gain reduction, and a release time of 0.5s does not mean the compressor waits 0.5s before suddenly removing the target gain reduction.
Rather, the attack time provides a time indication of how long it will take the compressor to fade the signal level down to the target gain reduction, and the release time provides a time indication of how long it will take the compressor to fade the signal level back up to the uncompressed level. As soon as ΔInput increases, the compressor starts increasing the gain reduction at a rate determined by the attack control. As soon as ΔInput decreases, the compressor starts reducing the gain reduction at a rate determined by the release control.
Demystifying Attack & Release
For this four-part series we’ve been focusing on VCA compressors that apply downward compression. These are among the most versatile compressors and invariably offer attack and release time controls indicated in seconds, which brings us back to the earlier question: what do those seconds actually mean?
As we saw above, different manufacturers use different ways of defining their attack and release times. Among other things, these differences mean we cannot transfer attack and release time settings from one brand of compressor to another and expect the same results.
However…
If we understand how the attack and release time settings interact with the threshold, ratio and knee settings of one compressor, we can achieve similar results on different compressors by making intentional adjustments, considering how the gain reduction and its ballistics differ from what we were expecting, and compensating accordingly. To do that in a strategic manner we need to know how these controls work and how they interact on at least one type of compressor. So let’s take a look under the hood of our downwards VCA compressor…
No User Serviceable Parts Inside
As mentioned in the first instalment of this four-part series, the Variable Gain Cell of a VCA compressor is a VCA, aka a Voltage Controlled Amplifier. It is, therefore, an amplifier with gain controlled by applying a control voltage aka CV. Based on the input signal level and the settings of the threshold, ratio and knee controls, the Envelope Follower creates an appropriate CV to set the VCA to the target gain reduction.
The illustration above provides a theoretical example of a relationship between CV and gain reduction (GR). In this example the relationship is -1dB/volt, meaning if the CV increases by 1 volt the VCA’s gain decreases by 1dB.
[Note that this is a purely theoretical example with simple figures and straight lines chosen specifically for the purposes of this explanation. In reality, a compressor manufacturer might use a negative CV, and/or a non-linear (e.g. logarithmic) relationship between CV and gain reduction, and/or numerous other ways to control gain reduction meaningfully with either analogue electronics or digital coding.]
If the CV shown above was connected directly to the VCA the target gain reduction would be applied or removed instantly, which is equivalent to having instant attack and release times of 0s each. Instant attack and release times can be good for peak limiting and some forms of ducking, but they’re not good for creative and musical applications where we need to slow down the gain reduction to suit the dynamics of the sound or the tempo of the music. How can we alter the speed that the gain reduction is applied and removed?
RC Network
If we were to actually poke around under the hood of a typical VCA compressor we’d probably get some nasty electrical shocks, void the warranty, and seriously reduce the compressor’s resale value. However, if we avoided those problems we would eventually find that the attack and release controls are part of an electronic circuit known as an ‘RC network’, so called because it is a network (i.e. a sub-section of an electrical circuit) primarily consisting of a resistor (R) and a capacitor (C). The illustration below shows a simple RC network.
Seeking an explanation leaves us with more questions than answers
Readers with a background in electronics will immediately recognise this as a simple low pass filter, a description that is often used when technicians and circuit designers discuss the attack and release circuits of dynamic processors – much to the confusion of those without a background in electronics who will understandably assume their audio signal is going through a low pass filter. It’s not. The audio signal does not pass through this low pass filter, but the control voltage does. Why?
Audio signals have continuously and rapidly changing values, and therefore so do the control voltages created by the envelope follower in accordance with the compressor’s threshold and ratio settings. A rapidly changing control voltage means a rapidly changing gain reduction, which is good for peak limiting and some forms of ducking where we need the gain reduction to be applied and/or removed instantly. However, it is not good for creative and musical situations where we want to slow down the gain reduction to suit the dynamics of the sound or the tempo of the music. To slow down the continuously changing gain reduction we have to slow down the continuously changing control voltage. How?
In mathematics, the study of continuously changing values is known as calculus. One way of extracting meaning from continuously changing values is to apply what is known in calculus as an integration function, which basically ignores short-term peaks and dips while also smoothing out sudden but long-term increases and decreases and turning them into gradual increases and decreases – which is exactly what we want to do to the control voltage. The low pass filter created by the RC network is an integration function, and that’s why our compressor’s control voltage passes through it. The low pass filter ignores sudden changes in the control voltage and ‘smooths it out’. How? Let’s get back to that RC network…
Charging & Discharging
A resistor is an electronic component that resists or opposes the flow of electrical current.
A capacitor is an electronic component with the capacity to store electrical current in the form of a ‘charge’ – when electrical current flows into the capacitor the charge increases as the capacitor charges, and when electrical current flows out of the capacitor the charge decreases as the capacitor discharges.
The total charge stored in a capacitor is measured in Coulombs (abbrev. Q), and is the product of the capacitance (in Farads) and the charging voltage (in Volts). It can be represented by the following formula:
Q = C x V
Where Q is the charge (in Coulombs), C is the value of the capacitor (in Farads) and V is the voltage used to charge the capacitor (in Volts).
From this formula we can see that, for any given value of capacitance, the charge (Q) is proportional to the charging voltage (V): if we increase V we increase Q, and if we decrease V we decrease Q. We don’t need to do any Coulomb mathematics here, but knowing the proportional relationship between charge and voltage will be helpful later for understanding how a compressor’s attack and release times interact with each other to change the shape of a sound’s envelope.
For now we will focus on how the capacitor charges and discharges, because this is fundamental to understanding how the attack and release times work individually and together.
Charging
The illustration below shows a typical RC network in charging mode:
Let’s assume the capacitor is completely discharged to begin with. Putting switch S1 into the charge position completes the charging circuit by applying a voltage (Vtotal) across the RC network of R1 and C1. Vtotal causes an electrical current to flow through R1 and into C1, thereby building a charge inside C1 that, in turn, creates a voltage across C1. We’ll call that voltage Vc, for voltage (V) across the capacitor (c). If we measured the increase of Vc over the time it takes the capacitor to go from completely discharged to fully charged, it will look like this:
Starting from 0 volts (fully discharged), Vc rises rapidly at first but slows down as the capacitor continues to charge. When the capacitor is fully charged, all of the applied voltage (Vtotal) appears across the capacitor and no more current flows in the circuit.
Note that Vc does not increase in a linear manner. More about that shortly…
Discharging
The illustration below shows a typical RC network in discharging mode:
Let’s assume that C1 is fully charged to begin with. Putting switch S1 into the discharge position completes the discharging circuit, creating an RC network consisting of R2 and C1. The capacitor is the only voltage source in this circuit, and therefore begins to discharge to 0 volts via R2. The voltage across the capacitor, Vc, falls rapidly at first but slows down as the capacitor discharges. When C1 is completely discharged Vc = 0 volts and no more current flows in the circuit. If we measured the decrease of Vc over the time it takes the capacitor to go from fully charged to completely discharged, it will look like this:
Note that Vc does not decrease in a linear manner. More about that shortly.
What has this got to do with compressor attack and release times? Read on…
The Inscrutable RC Time Constant
If we know the value of the resistor (in Ohms) and the value of the capacitor (in Farads) we can calculate how long it will take the capacitor to fully charge or completely discharge. To determine this, we have to start by calculating the circuit’s time constant, as follows:
τ = R x C
Where τ is the time constant in seconds, R is the value of the resistance in Ohms, and C is the value of the capacitance in Farads. [In electronics the RC time constant is represented by the lower case version of the Greek letter ‘tau’ (τ), which avoids confusion with ‘T’ for temperature and ‘t’ for time.]
This value is commonly known as the RC time constant because it represents the time constant of an RC network. Fortunately we don’t need to make any time constant calculations with Ohms and Farads here; all that matters for our purposes is understanding that τ is proportional to R. For any given value of C, increasing R will increase τ, and decreasing R will decrease τ.
This is where it gets interesting, if not confusing…
When charging a fully discharged capacitor, it will take 5τ (i.e. 5 x the time constant) to reach 99.3% of the charge determined by Q = C x V. Likewise, when discharging a fully charged capacitor, it will take 5τ to fall to 0.7% of the charge contained within. For our purposes we will assume that 99% or more is full charge, and 1% or less is zero charge. Therefore we will say it takes 5τ for the capacitor to reach full charge from zero charge, and 5τ for the capacitor to reach zero charge from full charge.
Also, as we’ve seen in the preceding graphs of Vc, the capacitor does not charge or discharge in a linear manner and therefore Vc (the voltage across the capacitor) does not increase or decrease in a linear manner.
When the capacitor is charging from a fully discharged state, Vc rises rapidly to 63.2% of the full charge voltage in 1τ (i.e. 1 x τ) as shown below. After that the charging slows considerably; ultimately reaching the full charge voltage at 5τ.
The inverse occurs when the capacitor is discharging from a fully charged state, as shown below. Vc falls rapidly to 36.8% of the full charge voltage in 1τ; after that the discharging slows considerably, ultimately reaching the zero charge voltage at 5τ.
What has this got to do with compressor attack and release times? Read on…
Approaching Attack & Release
We have seen above an RC network for charging a capacitor, and an RC network for discharging a capacitor. In both cases we saw that the RC time constant, τ, was dependent on the values of the resistor and the capacitor. We also saw that it takes 5τ for the capacitor to reach full charge from zero charge, and 5τ for the capacitor to reach zero charge from full charge. Finally, we also saw that the charging and discharging curves are not linear; they are, as their name implies, curves.
With all of these things in mind, let’s combine the charging and discharging circuits shown above into a single circuit. While we’re at it, let’s replace R1 and R2 with variable resistors (i.e. potentiometers or ‘pots’, indicated by the diagonal arrows passing through them) so that we can alter the charging and discharging times respectively.
Switch S1 allows us to choose if the capacitor is charging or discharging. With switch S1 in the charging position, potentiometer R1 allows us to control how fast the capacitor charges by changing the time constant of R1 and C1. With switch S1 in the discharging position, potentiometer R2 allows us to control how fast the capacitor discharges by changing the time constant of R2 and C1.
So far, so good…
As we know, the input signal level and the settings of the threshold, ratio and knee controls ultimately determine the control voltage that is applied to the VCA to achieve the target gain reduction. As we’ve previously discussed, if that control voltage was applied directly to the VCA our compressor would have no adjustable attack or release times; both would be operating at their fastest possible speeds, being theoretically zero seconds each. We want to slow them down, and here’s how we use the RC network to do that…
In the illustration above we’ve inserted the charging/discharging RC network in between the control voltage and the VCA. We’ve now got two versions of the control voltage, one before the RC network and one after it. We’ll call the control voltage before the RC network CV1, meaning Control Voltage 1. It comes from the threshold, ratio and knee circuit; it is the correct voltage to achieve the target gain reduction from the VCA, but it is no longer directly controlling the VCA.
The VCA is now controlled by the voltage across the capacitor (Vc), which we’ll now refer to as CV2 (i.e. Control Voltage 2). The RC network determines how fast CV2 can reach the level of CV1, and therefore determines how long it will take the VCA to reach the target gain reduction.
A comparator circuit switches the RC network between charging or discharging by comparing CV2 against CV1. Here’s how the comparator works…
Charging = Attack
If CV2 is lower than CV1 it means the RC circuit is applying less than the full value of CV1 to the VCA, and therefore the VCA is applying less than the target gain reduction. The comparator switches the circuit into charging mode, increasing CV2 and thereby increasing the gain reduction. R1 controls how fast the capacitor can charge, and therefore determines how fast CV2 can increase to the level of CV1 – at which point the VCA will be providing the target gain reduction.
R1 ultimately controls how quickly the gain reduction increases, and is therefore the compressor’s attack time control. Because R1 is a potentiometer, we can vary the attack time between faster and slower settings.
Discharging = Release
If CV2 is higher than CV1 it means the RC circuit is applying more than the full value of CV1 to the VCA, and therefore the VCA is applying more than the target gain reduction. The comparator switches the circuit into discharging mode, decreasing CV2 and thereby reducing the gain reduction. R2 controls how fast the capacitor can discharge, and therefore determines how fast CV2 can decrease to the level of CV1 – at which point the VCA will be providing the target gain reduction.
R2 ultimately controls how quickly the gain reduction decreases, and is therefore the compressor’s release time control. Because R2 is a potentiometer, we can vary the release time between faster and slower settings.
So What Do Those Seconds Actually Mean?
The examples above apply to all compressors that use RC time constants to determine their attack and release times, including VCA compressors, FET compressors, many types of tube compressors, and also the digital emulations of those designs.
In all of the above cases, the attack and release times are determined by the time constant of an RC network that is configured as a low pass filter. We know that the RC network has a time constant (τ), and we know that it takes 5τ (five charge time constants) for the network to fully charge from a complete discharge, and 5τ (five discharge time constants) for the network to completely discharge from a full charge.
Knowing this, it makes mathematical sense to specify the attack and release times based on the time it takes the RC network to fully charge (attack) or completely discharge (release) – which is 5τ. If the RC network’s time constant for charging was 5ms, the time to reach full charge would be 25ms (i.e. 5 x 5ms) and that would therefore be the attack time specified in seconds. Likewise, if the RC network’s time constant for discharging was 20ms, the time taken to completely discharge would be 100ms (i.e. 5 x 20ms) and that would therefore be the release time specified in seconds. The illustration below shows how CV2 takes 5τ (25ms) to reach the required voltage to achieve the target gain reduction, and takes 5τ (100ms) to reduce to 0 volts and remove the gain reduction.
The 5τ approach described above makes sense from an objective ‘test and measurement’ point of view because it represents the time it will take the compressor to reach or remove the target gain reduction. However, there’s a subjective ‘what does it sound like?’ problem with that approach…
When charging (i.e. attack), we know that the charge rises rapidly to 63% of full charge in 1τ but then requires an additional 4τ to fully charge to 100%. When discharging (i.e. release), we know that the charge falls rapidly to 37% of full charge in 1τ but requires an additional 4τ to completely discharge to 0%. So, although the RC network takes 5τ to fully charge or completely discharge, the most significant part of the charging and discharging processes occurs in the first time constant, i.e. 1τ. After that, it takes four times longer to reach full charge or complete discharge. It can be argued that it is more meaningful to use 1τ to specify the attack and release times because it represents the point on the charge/discharge curves where the most significant part of the change occurs.
It can also be argued that, due to the logarithmic nature of human hearing, it is more meaningful to use 2τ to specify the attack and release times, or 3τ, or 4τ, or 5τ… This argument depends on the how the VCA responds to the control voltage; it could do so in a linear manner (as shown in the earlier graph depicting a direct relationship between CV and GR), or it could respond in a logarithmic manner – which takes us beyond the scope of this discussion because there’s nothing we can do about that as sound engineers anyway unless the compressor offers a switch allowing us to change how the VCA responds to the control voltage. Let’s get back to things we can control and adjust…
So, what do those attack and release times on our compressors actually mean?
Because there is no widely-accepted industry standard for specifying the attack and release times on dynamics processors, those numbers could mean anything. A manufacturer focused on technical accuracy could justify using 5τ because it is the time taken to fully apply or fully remove the target gain reduction. A more pragmatic manufacturer could justify using 1τ because it is the RC time constant and also because the first time constant represents where the most significant changes occur in the attack and release curves. Another manufacturer might ignore the time constant altogether and use a series of consecutive numbers (e.g. 1 to 10) to represent fastest to slowest. Meanwhile, a software developer creating a compressor plug-in could emulate the RC curve in DSP using a mathematical integration function and number it however they like, or could create entirely different attack and release responses that are free of the limitations of analogue circuitry and are instead based on the human perception of loudness.
The lack of a widely-accepted industry standard for measuring and specifying attack and release times means we cannot transfer settings from one brand of compressor to another and expect the same results. However, now that we understand how the attack and release circuits work we’re ready to see how they interact with the other settings, and, of course, how they interact with our signals and re-shape their envelopes. If we understand these interactions we should be able to achieve our desired results on any compressor that offers the required parameters. We will explore these interactions in the next instalment of this series.
RESPONSES