The CLEANEST Compression Possible

Audio Compression and the Hilbert Transform

I’ll keep this section brief since this is a topic for a mathematics professor, but in short, the Hilbert transform consists of measuring EEG signals and assigning the signals as real data.

Then, by rotating positive information by 90 degrees, we’re provided with the needed imaginary data. At this point, we have enough information to convert the data into measurements of the frequency, amplitude, and phase angle.

That’s a simplification of how it works, for sure, but the key takeaway here is that it allows for very accurate measurements of everything needed to reproduce an audio waveform.

Like FFT processing, the Hilbert transform can recreate more accurate divisions of a signal’s amplitude, frequency, and phase.

How Amplitude Accuracy Relates to THD

If a processor mismeasures a waveform, it’ll distort it.

For example, if a waveform looks like this - a symmetrical sine wave, but a processor either inaccurately measures or purposefully processes the wave with the peak and trough clipped, the differential between the original wave and this reshaped wave is harmonic distortion.

That’s because the differential is a new waveform with a length that corresponds to the length of the original waveform - in other words, this shorter oscillation is a multiple of the original oscillation.

So, if the original sine wave was 100Hz, and this new waveform is 300Hz, the synthesized or new waveform is a 3rd-order harmonic.

This means that if a processor could measure a waveform perfectly, no distortion would occur, again, unless it shaped the waveform on purpose, or introduced a process that causes distortion.

To demonstrate this, here’s this free ADC drive plugin—the green points represent the peaks and troughs of the sine wave I’m feeding into the plugin.

As I increase the input and shape the wave, the differential between the input and the output creates harmonics.

As the peaks and troughs are reshaped, multiples of the original signal, in this case 100Hz, are generated and become higher in amplitude, the greater the differential between the input and output.

So, we’ll notice 300Hz. 500Hz. and so on.

All this to shows that if we want incredibly accurate processing with little to no harmonic distortion, then we need a processor capable of accurate measurement so that the input waveform more closely matches the output waveform and vice versa.

What is the Cleanest Compressor?

When I was testing compressor plugins last week, I came across something strange.

This Toneboosters Compressor behaved like most compressors I’ve encountered —it affected dynamics and left the frequency response alone, except for introducing harmonics.

However, I noticed that as I switched from algorithm to algorithm, one stood out.

Whereas most compressors with a moderate attack and release increase the THD by 30dB on the lower end and up to 120dB on the higher end, this compressor’s punch algorithm increased it by only 3 dB.

Thinking I had messed up, I tested a bunch of compressors.

When that didn’t give more insight, I read the manual. Finally, I reached out to the developer, who had this to say:

We don’t want to reveal all [of the] secret sauce to create high-quality plugins, but yes, Hilbert Transforms are an essential ingredient to create low-latency, low THD compressors, as they alleviate any estimation errors when measuring levels of tonal signals (which is an essential part for low THD).

When I pressed for a little more info on the Hilbert Transform, he responded:

Hilbert transformers are quite complicated, and the relation between a Hilbert transformer and a compressor side chain is probably only suitable for explanation in an academic paper ;-) 

Which made me feel a bit better about not fully understanding some of the finer details.

The practical takeaway, though, is that it looks like the Hilbert transform’s accuracy in this compressor, and with this particular punch algorithm, creates some of the cleanest compression possible. This is particularly true when it’s combined with an attack above 10ms and a release above 50ms to ensure the compressor’s attenuation isn’t quicker than the waveform’s full oscillation.

I’ll compare this setting to other compressors in a moment, but for now, let’s listen to our signal attenuated with these settings - let me know if you hear any distortion.

Watch the video to learn more >

Other Compressors and Why They Distort

One big reason compressors distort is the attack and release times—no compressor can avoid this.

For example, if I use the tone boosters plugin again but lower the attack, release, or both, we’ll achieve harmonic distortion.

The compressor is moving faster than one full oscillation. When it attenuates before the oscillation completes, waveshaping occurs—this differential between the input and the output results in harmonics.

Since lower frequencies have longer wavelengths and require more time for a full oscillation, these distort more often.

So, if the frequency is 80Hz or 80 oscillations per second, we could divide 1 second by 80 to find the time of 1 oscillation in seconds.

The result is 0.0125s or 12.5ms.

So, attack and release times shorter than 12.5ms will typically distort an 80Hz. Wave.

Other variables play a role, but look at how harmonics form right when the attack time is reduced to below 12.5ms.

As we covered earlier, the other main causes are inaccurate amplitude measurement and any purposeful waveshaping introduced by the plugin.

For example, if we look at this Pro C2 plugin and select its punch algorithm with a 12ms attack and 50ms release compressing 80Hz, the THD is -37dB.

This is likely purposeful. If we switch to the Mastering algorithm, notice how the THD drops to about the same as Toneboosters when it’s set to punch mode.

Interestingly, though, the Pro C2’s mastering algorithm introduces significant distortion at extreme low and high frequencies (if oversampling is off). In contrast, ToneBooster’s compressor introduces significantly less distortion at extreme lows and no distortion at extreme highs.

Even though the amplitude in a track may be too low at the extreme lows and highs to trigger the compressor when processing just that frequency, remember that they could still be compressed when another range triggers the compressor since the full spectrum will be subject to compression.

Let’s take a quick listen to these 2 compressors on the same segment of the mix. Given the tiny variations between the 2, I have trouble hearing a difference, but let me know if something sounds different to you.

Watch the video to learn more >

Let’s look at one more compressor that’s said to sound clean - the Weiss DS1 MK3.

Although I really enjoy this compressor, calling it clean isn’t too accurate. It sounds awesome, but the distortion it introduces is pretty significant—not something you’d want to use for most mastering applications, although that’s up to you or the engineer mastering.

That said, if the goal is to alter a signal’s timbre as little as possible, this probably wouldn’t be a good choice.

Let’s compare the 2 compressors while using identical settings. In this case, you should hear a little more of a difference than in the previous example.

Watch the video to learn more >

Some Possible Complications with Hilbert Transforms

One concern I’ve seen about using Hilbert Transforms in audio plugins is the somewhat unknown consequence of phase rotation. Remember, 90 degrees of rotation is needed for the processor to measure the amplitude, frequency, and phase angle correctly.

Although this is an understandable concern, phase rotation should be inaudible if it occurs to both left and right channels identically.

That’s why I could invert the polarity of a master, and you wouldn’t be able to tell a difference.

The amplitude and frequency are the same, while the phase angles are equal and opposite to what they were. Granted, inverting the polarity is a 180-degree rotation, whereas the Hilbert transform requires a 90-degree rotation.

That said, mastering engineers have been rotating the phase of a mix for a while now to ensure that peaks and troughs are accurately represented—in other words, to ensure the mix doesn’t have an offset before it hits a processor.

So, it seems our inability to cue in on identically shifted phase angles comes in handy here.

As for excessive latency, it’s easy to understand why some would be skeptical about a low-latency FFT-adjacent form of processing.

After all, FFT processing in an audio editor can be so CPU-intensive that it requires a separate platform.

However, it looks like computers can quickly introduce the Hilbert Transform.

The Tonebooster’s Compressor requires 144 samples in a 48kHz session, so it takes only 3ms to make the needed changes to the input.

Overall, it’s exciting to see this form of measurement have such a beneficial effect on a processor’s accuracy.

We’ve talked a lot about this plugin, so let’s spend some time listening to it. I’m going to use subtle settings on a full mix and vary some parameters. The effect should be transparent attenuation of peaks, meaning no alteration to the mix’s timbre, just controlled dynamics.

Watch the video to learn more >