Today I’m going to be writing about a neat little thing called an all pass filter, and how to use it for drum layering.

What is an All Pass Filter?

An all pass filter is one of the greatest tools in a DSP engineer’s tool box. What it does is shift the phase of different parts of an incoming signal’s spectrum by different amounts, without affecting frequency response. It is called an “all” pass filter because it passes all frequencies, that is to say there is no attenuation across the entire spectrum, or it lacks a stop band.

One of the first audio effects to use an all pass filter was the phaser. In the 60s, using tape machines to create flanging effects was made popular by artists like the Beatles and Jimi Hendrix. The inherent problem with using a tape machine to do it was the musicians couldn’t perform with it in real time, they had to have somebody creating the effects separate from them playing the instrument. When you analyze what a flanger is doing, it’s the same as delaying the signal by increasing or decreasing amounts and feeding it back to the input to create a moving comb filter. However, these delays are on the order of less than 50 ms (within the range of human hearing) and because these delays are shorter than the period of a sine wave, engineers had the bright idea that you could think of these delays as simply phase shifts. Delaying a sine wave by a fraction of its period for example is nearly the same to shifting it’s phase by the same fraction. Using this theory, they designed the first “all pass” filters. These filters would cause the phase to shift of an incoming signal without attenuating any part of the spectrum. By placing these in a feedback loop, positive or negative, it would cause comb filtering much like a flanger. However, it could work in real time and be put into a pedal for a guitarist or vocalist to use live. The catch is this: the phase shift is not the same for all frequencies. At the corner frequency of the filter, there will be a 90 degree phase shift. Before it is a curve, approaching 0, and after it is another curve approaching 180 degrees. The intensity of this curve is dependent on the design of the filter. Below is a graph of the phase response of several allpass filter designs (Phase is in radians and frequency is radians/second)

In a flanger, the delay or phase shift is the same across all frequencies, which causes the teeth of the comb to be equally spaced. In a phaser, the teeth are not equally spaced. This fundamental difference is why flangers and phasers, while similar, have very characteristic sounds.

In a digital system, all pass filters are incredibly useful because they allow us to delay the signal by fractional amounts. Keep in mind that in a digital system, time is discretized so you can’t in theory delay the entire signal by smaller than 1 sample. An all pass filter works by delaying the different portions of the spectrum different amounts so that the average delay is less than 1 sample. This is incredibly powerful, and is responsible for many digital audio systems.

Today though, we won’t be worrying about the finer points of DSP and all pass filters. It’s a shame that there aren’t all pass filter plugins, because they can be very useful! I’ll be using a Reaktor ensemble I made to illustrate what we’re doing. You can download it here. If you want to copy it in PD or something else, these pictures illustrate the signal flow

with just a few controls for the corner frequency and mix because Reaktor is dumb and makes things louder

What can all pass filters do for me?

Layering drum samples is popular in electronic music, and when doing it one thing to be worried about is phase. If you want a layered kick for example, you may like the attack of one sample, the body of another, the sub of a third, etc. The problem is that it’s rare for these samples to be of the same pitch, or even of an intelligible pitch. The differences in samples can cause phase cancellation. You might want a tight, punchy, thick kick but through layering you get a weak and wimpy one instead.

Some techniques that are most common in building up a layered drum sound are delay, EQ, and pitch shifting. There is a problem with all of these that become pronounced in layering drums. If you’re trying to get the kicks to line up so their bodies stack in a way that sounds pleasing, you will often move one or more samples slightly back or slightly forward so their bodies stack in phase. The problem with that is it shifts the transient forward or back too, which means now the transients are out of phase. You can compensate by cutting and crossfading, but that doesn’t always sound great. You could also use an EQ to cut out the portions you don’t want, however that has problems where the lower you start cutting the more it can smear the transient, giving the same problem. Or you can pitch up or down a sample until they line up in phase, but again most pitch shifting algorithms have problems with transient smearing. So one way to layer drums so you can line up their bodies and transients to get a thick, full, punchy sample with a single effect is to use an all pass filter. What it will do is shift the portions of the sample just as much as we want.

Of course, this is just one technique to use, some may prefer using the more straightforward methods that don’t require a third party plugin.

So to begin, I have two drum samples. If you have the XFer sample pack, I’m using XF_Kick_A_003, XF_Kick_A_010, and XF_Kick_A_017. Looks just like this:

I dropped them all in as you can see, the faders are all set to -9dB to prevent any clipping and to illustrate that the only thing I will do is apply all pass filtering.

Here is what they all sound like together.

Next, I’ll just add the Reaktor ensemble to each channel and then drag up the knob while listening to how things are shifting. After getting one, I’ll move to the other, then the next. After all is said and done, with these settings:

I get something that sounds like this.

You can hear the transient and punch of the kick a little more clearly, and the low end is fuller. I have done no compression, no EQ’ing, no mixing between the samples. All that is going on is shifting around the phase of each sample’s spectrum a little differently to get things to line up in a more pleasing manner. I get a punchy, tight kick by doing without any tedious processing.