Voltage controlled all pass filter

An all pass filter sounds rather like an in joke: A filter that passes all frequencies without attenuation. A piece of wire, in other words? But no: Filters change not only amplitudes in a frequency dependent way, but phases as well. An all pass filter just specializes in the latter. Sine waves far below the corner frequency come through with one phase shift, ones far above come through with another.

What’s a phase shift? It’s the difference between the zero crossings — the stopping and starting points — of two sinusoidal waves. In the figure below, the blue sinusoid starts going upward from 0 at time 0 and completes a cycle in 4 time units. The orange curve starts going upward from 0 at time 1, a quarter of a cycle later: This is known as a 90° phase shift. The green curve starts half a cycle after the blue one, which is a 180° phase shift. Phase shifts can also be negative: The orange curve is shifted -90° relative to the green one. Note that’s equivalent to a +270° phase shift.

A one pole APF — I’ll get to what “one pole” means in a minute — will do something like impose no phase shift (0°) at low frequency and -180° phase shift at high frequency. At the corner frequency the phase shift is -90°. A two pole APF can give you 0° at low frequency decreasing to -180° at the corner frequency, then decreasing from there to -360° at high frequency — the latter being equivalent, of course, to decreasing from +180° to 0°.

Phase shift vs. frequency for 1- (blue) and 2-pole (orange) APF

What good is that? A phase shifted sine wave sounds… exactly like a sine wave. Well, but what about other waveforms? They can be thought of as the sum of many sine waves of different frequencies — the harmonics. If you put your waveform through a one pole APF the harmonics well below the corner frequency will have no phase shift. But the ones well above the corner frequency will have a -180° phase shift, and the ones in between will have in between phase shifts. Add up these harmonics, with some phase shifted a lot, some a little, some not at all, and you get an output waveform with a different shape than the input.

But not one that sounds different, or not by much. The human auditory system is sensitive to the amplitudes of the different harmonics, but not very sensitive to their phases. As long as it’s only the latter that changes, the waveform may look very different on a scope, but it’ll sound about the same.

So an all pass filter wouldn’t seem to be very useful in synthesis for audio signals. However, you can combine the output of several APFs with their input, and then get constructive or destructive interference at the different harmonics which will result in a different sound. That’s the basic idea of a phaser effect.

But here’s another application. What did I say — “the waveform may look very different on a scope”? That’s a difference that makes no difference for audio signals, but it’s everything when you’re talking about low frequency waveforms. Your typical low frequency oscillator might have sine, pulse, tri, ramp, and saw outputs. What if you’re bored with those? Put any of them — except the sine — into an APF and, voila, you have something different. Put them into a voltage controlled APF and you have morphing waveshapes — you can use an LFO to modulate the shape of an LFO! Okay, this starts to sound interesting.

If the corner frequency is far above the input frequency, then all but the highest harmonics come through with little or no phase shift, and the output wave shape will be similar to the input. If the corner frequency is well below the input frequency, then all harmonics will have nearly a -180° (for one pole) or -360° (for two pole) phase shift, and the output wave shape will be again similar to the input — though inverted in the one pole case. But with the corner frequency somewhere in between, the lowest harmonics will get little phase shift, the highest will get near -180° or -360°, and the ones in the middle will get shifts in between. So as the corner frequency is swept downwards, the output morphs from looking about like the input, through different and unusual shapes, to looking about like the input again, inverted or not. Can you think of ways to use that? I think I can.

Input waveform (top) and one and two pass APF outputs (middle, bottom) with CV sweep

How do you build an APF? One way is to use an idea called pole mixing, in which you take a multi-stage low pass filter and use some combination of the input signal and the outputs of each stage — called poles — added together to make a different filter shape. Specifically, you can make a one pole APF by taking a single pole low pass filter, doubling its output, and subtracting its input. Here it is (without voltage control) in one op amp and four passives:

One pole all pass filter

R2 and C form a one pole low pass filter. The op amp output, Vout, is -Vin, via the R1 input and feedback resistors, added to twice the filter output. At zero frequency that’s 2Vin-Vin = Vin, with 0° phase shift. At high frequency it’s 0-Vin = Vin with -180° phase shift. At the corner frequency (1/(2πR2C)) the phase shift is -90°.

For a two pole APF you can take a two pole low pass filter, subtract four times the first pole output from the input, and add four times the second pole output. No, it’s not obvious that’s the correct recipe, but it is.

So this module’s design is pretty straightforward. I started with a voltage controlled two pole LPF, simplified it by removing the resonance feedback path (resonance doesn’t do our wave morphing any real favors), and added two fixed mixer stages to combine the input, first pole output, and second pole output in the proper ratios for one and two pole APF outputs. The LPF is a simple standard OTA design, though with larger capacitors to lower the corner frequency into LFO territory. The exponential converter is standard too, except that I made its response less than 1 V/oct (which obviously it doesn’t need to be, since we’re not doing audio frequencies here) in order to increase the corner frequency range for a given CV range.

VC APF module

Schematics, KiCad design files, Gerbers, and documentation in the GitHub repo: https://github.com/holmesrichards/vcapf.

One thought on “Voltage controlled all pass filter

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s