How Compression Affects Harmonic Distortion
For most styles of popular music compressors and limiters are a matter of necessity and taste. The advent of close miking came with an increase in the transient levels captured.
We use compressors to put the entire desirable dynamic range of an instrument back into a manageable space. We use limiters on the master bus to attempt to make the song sound louder. We’re aware that if not used correctly compressors can suck the life out of a song, erase an instrument’s transients, or, as we saw in this article, change an instrument’s timbre.
Harmonic distortion is another consequence of compression and limiting if the attack and release controls are improperly set. From my experience it’s an effect that is often mentioned but rarely discussed in detail. In this article we’ll take a closer look at how a compressor can actually generate harmonics.
Let’s start with a nice 80 Hz sine tone. 80 Hz is high enough of a frequency to ensure that it will be part of most mixes, but low enough to illustrate the compressor’s effects. Figure 1 and Figure 2 show the waveform and spectrum of the sine tone. This view actually includes a compressor that’s enacting a 3 dB gain reduction with a 1 ms attack time and 1 second release time.
Before we move any further, let’s take a moment to define exactly what we mean by attack and release time.
Attack and Release Time
When an input signal exceeds a compressor’s threshold it enables a certain amount of gain reduction determined by the compressor ratio. Some think of the attack time as the amount of time the compressor waits before it pulls the signal down. This is not quite true. The attack setting is the length of time it will take for the compressor to reduce the gain by a certain number of dB. So if a compressor has an attack parameter that is referenced to 10 dB and is set to 5 ms, that means that if 10 dB of gain reduction is called for (determined by the input signal level and threshold), then it will take 5 ms to attain that attenuation. In this way we see that the attack time parameter is actually a rate of change, not a delay of action. Similarly, the release time is the rate at which the compressor restores the gain reduction after the signal has dropped below the threshold.
Now, with the 1 ms attack and 1 second release times, the compressor is enacting 3 dB of gain reduction. This really doesn’t affect the signal at all. As soon as I turn on the tone generator, the signal exceeds the threshold. The wavelength of an 80 Hz tone is 12.5 ms. With a 1 ms attack time the 3 dB gain reduction has already been enacted long before the sine wave has a chance to complete even one cycle. The 1 second release time ensures that the compressor’s gain reduction never lets up, so all we have is a constant 3 dB reduction.
Taking the attack time all the way down to .05 ms but keeping the release time the same has no effect on the 80 Hz tone. The 3 dB gain reduction is constant with these settings. But let’s restore the attack time to 1 ms and reduce the release time. Figures 3 and 4 show the effect of taking the release time all the way down to .05 ms. We can see the waveform is no longer a nice, smooth sine wave and other frequencies have shown up in our spectrum analyzer.
Looking at the waveform in Figure 3, let’s step through the compressor’s operation.
Starting at the left most edge of the waveform, we see the signal rise. During this period the signal is below the compressor’s threshold. As it approaches its peak it crosses the compressor’s threshold and triggers the gain reduction. With the current attack time, and assuming the attack time is referenced to 10 dB of gain reduction, the compressor is set to take 1 ms to attenuate the signal 10 dB. With 3 dB of actual reduction shown on the compressor, this will take about one third of the attack time to accomplish, which is much shorter than the 80 Hz wavelength of 12.5 ms. But the attack time isn’t really the problem, it’s the release time that’s causing the issue.
Once the waveform dips below the threshold the compressor almost instantaneously restores the gain and eliminates any attenuation. The compressor is only reducing the level of the signal during the peaks, in between those the compressor is inactive. What this means is that instead of just momentarily lowering the level of a signal and slowly restoring it, the compressor is changing the actual shape of the waveform on every cycle.
Looking at the frequency spectrum in Figure 4, we can see in addition to the original 80 Hz sine tone another frequency at 240 Hz, 400 Hz, 560 Hz, and so on. Dividing each of these frequencies by the original 80 Hz shows us that we have the fundamental, third, fifth, and seventh harmonic, each with decreasing amplitude. Many of you might already be familiar with this recipe: a square wave.
The attack time is not the cause of this distortion, but it can exacerbate it. Decreasing the attack time makes the gain reduction happen even faster, further changing the shape of the peaks. The result in Figure 5 is a waveform that looks less like the original, and the spectrum in Figure 6 tells the whole story. The more you change the shape of a waveform itself, the more harmonic distortion you’ll produce.
Short attack and release times allow you to tame transients and therefore bring up the overall level of an instrument or mix. You can often hear the distortion creep in if you listen on headphones.
If you are hearing distortion you have a few options.
One method is to attenuate the low end before it hits the compressor or limiter enough to reduce or eliminate the distortion effects. This could mean a substantial, and probably unwanted, alteration to the tonality of your mix. The next method is to start with an increase your release time, followed by increasing your attack time, and playing with the best combination of settings.
The last option is to simply reduce the gain into the limiter or the compression ratio, if possible. This is the best option, and probably the one you should start with. If you’re hearing distortion artifacts from your compressor, it’s most likely you’re squashing the instrument or mix too hard anyway.