EQ causality, plus warm distortion

Your EQ plugin can predict the future. Plus the warmest distortion ever

In this post, I demonstrate how EQ can predict the future, and how we can use this to approximate transformer distortion, with examples. We won’t be breaking any laws of causality, but we will see how audio signal processing is unintuitive. Also, I won’t make you do any actual maths.

Background: phase shift in EQ

Any audio signal can be represented as a finite (or possibly infinite) sum of sine waves of varying frequencies, phases, and amplitudes. In the digital world, the number of sine waves needed to represent any section of audio is finite. In the theoretical world, the number of sine waves can be infinite (eg, a perfect theoretical square wave can be thought of as an infinite sum of various sine waves).

In this post, I assume that you have used EQ a lot before, and have a vague sense that you are adjusting the relative volume of different frequency ranges in your signal.

We hear a lot about “phase shift” in equalizers. Most digital and analogue EQs are “minimum phase”. (Not to be confused with “linear phase”, which is very different). Without going into lots of maths, what this means in practice is that there is a minimum amount of phase shift for the given change in frequency response. (You might think that linear phase EQ would have even less phase shift than minimum phase EQ, but we don’t think of it in that way, as linear phase EQ introduces a large delay to the overall signal).

It gets slightly more confusing when we think about some of the definitions of phase shift and its related terms, such as phase delay, and group delay. But I don’t want to go into a lot of maths, so we will sweep this under the rug for now. Just imagine some frequencies being delayed by a bit.

In a minimum phase EQ (most digital and analogue EQs are minimum phase or close), phase shift is proportional to the rate of change of frequency response. This means that if your EQ has a graph display, the phase shift is proportional to the steepness of the curve. In this EQ screenshot, I have pointed arrows at the steepest parts of the graph, where there would be the most phase shift:

PhaseShiftWhere_Annotated.jpeg

Wherever the line is horizontal, including at the top of the peak boost, there is either very little or no phase shift.

Note: the word “filter”

The word filter has come to be associated with highpass and lowpass filters, because they more commonly have the word “filter” in their name. But it actually refers to any type of single EQ filter. These include highpass filters, lowpass filters, shelving filters, peak/band/bell filters (all the same thing), tilt filters, allpass filters (which are not minimum phase!), and many other types of filter.

As we shall see, a “minimum phase” EQ consists of one or more minimum phase filters placed in series (one after the other), but not in parallel.

Aside: what does extreme phase shift actually sound like?

It is useful to be able to learn what phase shift actually sounds like. (And no, it sounds absolutely nothing whatsoever at all like phaser or flange effects). When using a typical minimum phase EQ, you won’t be able to hear the phase shift, unless you’re doing very extreme, high-order filtering.

But to actually hear some phase shift, we can use the classic multiband compressor plugin, Waves C4. (Don’t worry, you don’t need to own a copy, I will provide audio examples below).

Waves C4 uses lowpass and highpass filters to split your audio signal into four bands. Each band is compressed / expanded separately, and then the bands are re-combined.

When C4 is doing no compression or expanding (range of all bands set to 0, as in the screenshot below), it has a completely “flat” frequency response, which means that no frequencies are boosted or cut. But it still introduces some phase shift. C4 is not minimum phase. Why?

C4_01.jpeg

Well, individually, the highpass and lowpass filters that C4 uses to split the audio into bands are minimum phase. But, to split the incoming signal into four bands, the filters have to be applied to four different versions of the signal in parallel. And this gives us an important rule about minimum phase EQ: When several minimum phase EQ filters are applied in series (one after the other), the minimum phase rule still applies: phase shift is proportional to the rate of change of the resulting frequency response. But when several minimum phase EQs are applied in parallel, this rule goes out the window. Later on, we will see how weird this becomes as it relates to minimum phase EQs in series.

So Waves C4 is not minimum phase. This allows us to listen to some phase shift without changing the frequency response. Here’s a dry drum loop, with no C4:

And here it is with one instance of C4, doing no compression or expansion. It sounds pretty much the same:

Here it is with two instances of C4 in series:

Here it is with four instances of C4 in series:

Here it is with eight instances of C4 in series:

Here it is with 15 instances of C4 in series (The maximum number of inserts I can have on a single channel strip in Logic Pro X):

As we can hear, we get a pew-pew sound effect. There is no change in frequency response or tone. It’s just that all the different frequencies are arriving at completely different times.

If you’ve seen the cover of The Dark Side of the Moon, the prism spreading out the light is similar to what we’re doing here with sound.

Now you’ve heard lots of phase shift, when you load up just one instance of C4, or anything similar, and get a little bit of phase shift, you will notice it, and it will be very annoying. In particular, drum transients become very smeared and not very tight sounding at all, even with just one instance of Waves C4.

(I’m not criticising this plugin though – it has one of the best user interfaces for quickly dialling in clean sounding multiband compression on non-percussive sources where the phase shift doesn’t really matter).

If you like this sound effect, there is a plugin by KiloHearts called Disperser that allows you to dial in huge amounts of phase shift as an effect. It can be very useful for creative sound design.

The weirdness of minimum phase

So, according to the laws of minimum phase, when you use several minimum phase EQs one after the other (not in parallel), the result is also minimum phase.

This is where it gets weird.

If we use one zero-latency, minimum phase EQ plugin and do a large peak boost, it will introduce some phase shift. Some frequencies will get “delayed”. (I put “delayed” in quotes because that isn’t quite what’s happening). But if we follow it up with an equal but opposite peak cut, those same frequencies will get “un-delayed” by exactly the same amount.

There is no trickery going on here, no “lookahead” or anything like that. But as we will see below, EQ isn’t really doing any time travel or breaking the laws of causality – it’s simply to do with our misunderstanding of what phase shift actually means.

Sine wave phase shift examples

Let’s start with a 200Hz sine wave, which fades in instantly via a zero crossing. I’ve created a sine wave which peaks at -18dBFS so we have some headroom:

SinewaveDry_annotated.jpeg

(Note that those jagged edges are due to the way that Logic Pro X renders waveforms, the sine wave itself is perfect when played back through your audio interface’s brick-wall lowpass filter).

Now let’s get out our trusty Fabfilter Pro-Q and apply a +10 dB bell filter at 190Hz, with a Q of 6:

ProQ_10dbBoost_190Hz_Q6.jpeg

Why have I chosen 190Hz? Because at the top of the bell filter, the frequency response curve is flat, like the top of a hill. And if we remember, the phase shift is proportional to the steepness of the frequency response curve. So if we were to boost at 200Hz, our 200Hz sine wave would change in volume, but there would be no phase shift for us to see.

When we process our sine wave through that filter, this is what it looks like. I have bounced it in place to a new track. The top wave is the original, the bottom wave is filtered:

SineWaveBoost01_annotated.jpeg

There’s lots of interesting things going on here. The EQ takes a while to get started. (And no, Pro-Q is not a “dynamic” EQ in any way, it is a completely “static” standard digital EQ). Let’s zoom in to the beginning. Again the top wave is the original, and the bottom is filtered:

SineWaveBoost01_Zoom01_annotated.jpeg

As we can see, the EQ’d wave starts off the same, then rises in volume and starts to become shifted in phase. If we move further along in time, and zoom in even more, we can see that the changes in phase and volume become stable:

SineWaveBoost01_Zoom02_annotated.jpeg

We can now clearly see that the bottom wave is “delayed” slightly. This is the phase shift that the EQ has introduced.

What happens if we then try to undo what we did, by applying this equal and opposite EQ? We simply put a new instance of Pro-Q with a bell cut at 190Hz, with a cut of 10dB instead of a boost, and the same Q of 6:

ProQ_10dbCut_190Hz_Q6.jpeg

Here’s what our twice-filtered sine wave looks like, compared to the unfiltered original:

SinewaveBoostCut02_annotated.jpeg

They are literally identical. There is now no phase shift whatsoever. They both start at exactly the same time. And we can prove this, as they null with each other.

Let’s look at another example, where we do the opposite: start with a 200Hz sine wave, and cut at 190Hz. This is what it looks like after the cut:

SinewaveCut_01_annotated.png

We see something similar, in that the filter doesn’t “kick in” straight away. Again, let’s zoom in and see what the waves look like further along:

SinewaveCut_01_zoom01_annotated.png

Here, the phase shift is seeming defying the laws of causality, because the sine wave is shifted backwards in time. It’s weird, but fortunately we aren’t breaking any causality laws.

And, yes, when I put that waveform through an exact opposite 10dB boost again, it returns back to, and nulls with, the original 200Hz sine wave.

(Note that I don’t want you to think that bell boosts delay the phase and bell cuts do the opposite, as in reality a bell cut or bell boost in fact does both to frequencies either side of its peak).

Part of the reason why these filters seem dynamic, or that they don’t “kick in” immediately, is that our 200Hz sine wave appears suddenly out of nowhere, instead of fading in gently. This is what’s called a “discontinuity”. Our wave, in fact, starts with an “impulse”. For an instantaneous moment at the beginning of our wave, where there are lots and lots of other frequencies also happening – representing our sudden volume change from nothing to everything. So really, we’re putting a sine wave AND an impulse through our filters. I could go into much more detail on this, but this blog post is already too long.

But the main point is this: The negative phase shift looks like a “negative delay”, where audio from the future is brought to the present, but really it isn’t.

This “undoing” EQ trick works for bell filters and shelving filters. It doesn’t work so well on highpass or lowpass filters, as they completely eliminate some frequencies (Eg, any highpass filter will completely remove the 0Hz DC component), or reduce the volume of frequencies so much that they fall below the noise floor and can no longer be recovered.

In the analogue world, doing an EQ cut followed by an EQ boost can introduce noise. However, in the digital world, due to the nature of how floating point numbers work, this is much less of a problem.

So why does this actually work?

A “standard” (12dB / octave) minimum phase digital EQ is essentially just two extremely short delay taps, with feedback. One of the delays is one sample long, and the other is two samples long. The taps’ output feeds back into their input. But also, some of the original “dry” signal is included. You can read the full details of how this is calculated here, courtesy of Robert Bristow-Johnson: Audio EQ Cookbook. (Archive in case it is down).

The way it works with minimum phase analogue EQ circuits is kind of similar. I’ve seen versions of the myth that analogue EQ adds more phase shift than digital, or that digital EQ adds more phase shift than analogue. But if they are minimum phase and have exactly the same frequency response (which, in reality, they often don’t or can’t), the phase shift will be the same.

So, in conclusion, the “delaying” of certain frequencies always leaves enough information in the signal to “undo” what you did and reconstruct the original signal. (But this is not always true in the case of highpass or lowpass filters, where some of the signal might be completely lost).

Why is this useful or interesting?

Why is it useful or interesting that we can do some EQ, and then undo the EQ, without incurring any phase shift, delay, or latency whatsoever, and keep our transients nice and “tight” sounding?

Well, it turns out that this is similar to what happens inside an audio transformer. For those of us who grew up doing everything on computers (which includes me), audio transformers are big metal electronic components. Hundreds of years ago, when people used analogue mixing consoles and tape machines, any piece of recorded audio would have passed through quite a lot of transformers during the recording and mixing process.

Audio transformers add some nice low-end weight to sound, particularly kick drums, bass guitars, and synths, and there are specific technical reasons for why this is so.

I know nothing about electronics, so my description of how a transformer works is going to be very crude. Essentially a transformer works by winding some wire around a piece of metal, and winding another piece of wire around another piece of metal, and then putting them next to each other.

Your audio signal travels along one wire, gets converted into a magnetic field, and then gets picked up by the other wire. The reason for this is to step between different voltages.

However, when your audio signal gets converted from the electronic signal in the wire into magnetic flux in the transformer, it gets “integrated”. And when the magnetic flux gets converted back into a voltage on the other side, it gets “differentiated”.

These are posh terms for saying the signal first goes through a lowpass filter, which gently rolls off the high frequencies. Then it goes through the almost-exact opposite of that filter, which boosts the high frequencies in such a way to almost exactly undo the high frequency loss.

This is part of the natural process of converting the signal into magnetic flux and then back again.

However, the magnetic flux has limited headroom, and past a certain point it starts to “saturate” (distort). So we have:

Gentle lowpass filter -> Distortion -> Un-lowpass-filter

(As an aside, the differentiator (un-lowpass filter) can’t pass a DC (0Hz) signal, which I think is why transformers can’t pass DC, but don’t quote me on that).

This has the effect of distorting the low frequencies, while mid and high frequencies are mostly left undistorted.

There is also very little phase shift. The only phase shift that occurs is due to the band-limited nature of the device (ie, very low and very high frequencies can’t get through). So real transformers do introduce phase shift, but not a lot of it, and mostly at the high and low ends of the spectrum.

The Jensen transformer FAQ has some interesting information: http://www.jensen-transformers.com/transformer-faqs/

Approximating transformer distortion

I’m going to use Fabfilter Saturn, but I’m not going to recommend that you buy it, as it’s not my preferred distortion plugin (although the modulation section is quite powerful). To me, it sounds a bit harsh, and “all-or-nothing”.

But because most of its distortion modes are not frequency dependent, it means we can use it to test our ideas.

What we’re going to do here is use a combination of EQ and Saturn distortion to crudely emulate audio transformer distortion. First off, here’s a short audio clip with drums and bass guitar:

Here’s an example of Fabfilter Saturn distorting that loop on its own. I don’t really like it: it sounds a bit brittle, and breaks up in a slightly harsh way:

So, knowing what we know about transformers, and about how equal and opposite EQ moves in serial introduce no phase shift, we can use EQ, followed by distortion, followed by the opposite EQ, to distort specific frequency ranges, without introducing any phase shift or latency.

To start, I’ve applied a 6dB / oct high shelf cut, with a corner frequency of 420Hz and a gain of -30dB. The reason we use a shelf instead of a lowpass filter, is that it’s easier to dial in the exact opposite shelf later on. You don’t have to use these particular EQ settings – this is just what I have chosen. This is what it looks like:

BassPreEQ.jpeg

Then we apply some very simple distortion. You don’t have to use Fabfilter Saturn for this. I have it set to “Warm Tape”, which actually isn’t a tape emulation – it appears to be a simple wave shaper that adds odd harmonics evenly across the whole spectrum (I tested it earlier with a sine sweep):

BassDistortion.jpeg

The only controls that matter in this screenshot are the drive level, and the “Warm Tape” setting. The drive control is volume-compensated and sets the amount of distortion. Ignore all the other controls, as they are all set to their defaults, and doing nothing.

Then we follow this up with the equal and opposite EQ, which s the 6dB / oct high shelf 30dB boost:

BassPostEQ.jpeg

And here’s what it sounds like:

As you can hear, compared to the dry loop, there is a lot more weight in the low end. (Interestingly, I could have done something similar using Saturn’s multiband mode, but that wouldn’t be authentic to how transformer distortion really works, and would smear transients slightly as in our Waves C4 example above).

The nice thing about this approach, is that we’ve changed the tone without actually doing any EQ. And of course, there is no phase shift.

Smoothing out the high end

Now, let’s take the same approach to soften some of the high frequencies, and reduce some of the harshness.

In music, high frequency sounds tend to peak a lot lower than low frequency sounds, so first we’re going to boost the high frequencies with a shelf, then distort, then cut the high frequencies with an equal and opposite shelf.

This is our pre-EQ:

TreblePreEQ.jpeg

Then we use very similar distortion settings on Saturn, so I won’t provide another screenshot. Finally, this is our post-EQ, equal and opposite to what’s above:

TreblePostEQ.jpeg

And in case you’ve lost track, this is what our channel strip looks like, with 6 plugins in order:

ChannelStrip.jpeg

And this is the result, which now includes both low and high frequency distortion:

Compare again to the original, distortion-free version:

As you can hear, the high frequencies are a little bit softer and smoothed out, and the low end is warmed up. Overall, it has a nice vibe compared to the dry version, but there isn’t any obvious “distortion” going on. This is the kind of “do-no-harm” distortion that would be really nice on the master bus of a whole mix. Or to “warm” up individual tracks if needed, without ever sounding obvious. It’s almost “stealth” distortion.

If we wanted some really obvious distortion as an effect, here is another version with both a lot more low-end and a lot more high-end distortion:

This is a bit too much, but if we want heavy distortion as an effect, this is a good approach to take without sounding harsh.

To plugin developers

If there are any plugin developers out there reading this, then I’d love to see a simple, basic plugin that has a standard digital IIR shelving or peak EQ, followed by a wave shaper, followed by an automatic equal-and-opposite EQ, for easily changing the tone of audio without doing any EQ and without resorting to multiband processing.

There are already lots of distortion plugins that combine EQ with distortion, but not in the specific and manually controllable way that I outline here.

A tip for even more authenticity

Set your EQ shelves to slightly different values for the left and right channels on stereo tracks, as no two analogue components are identical – they work within tolerances.

Finally, a plugin recommendation

Finally, Sonimus Burnley 73 is my favourite all-round distortion plugin at the moment. It is primarily marketed as an EQ, but I personally just use it for distortion. Often on the master bus. It is very good value for money, and uses next to no CPU. It seems to sound very warm and frequency dependent. Sonimus also have other distortion plugins, but Burnley 73 is my favourite of them.