Lin/Exp control of allpass phaser?

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Lets assume a simple 4-stage phaser with global feedback, and the allpass filters have different center frequencies, 100Hz, 200Hz, 300Hz, 400Hz.

1) Lin Control + 100Hz = 200Hz, 300Hz, 400Hz, 500Hz.
2)Exp Control + 1oct = 200Hz, 400Hz, 600Hz, 800Hz.

Which one would be "normal"? Intuitively no.2 seems to make more sense but no.1 would be easier both in digital and analog, assuming the latter would need no expo-converter in the analog case. Also - is there any real world models that don't use simple 1st order stages + feedback? Was thinking of SV allpass -> SV Allpass + global feedback to the first stage, would be quite flexible...

Regards
Andrew

Post

That is a great idea. One might add a switch so the user can select between exp and linear. Maybe good sounds could come from either. Or maybe a knob that varies the tracking from linear to exp, and perhaps wider than exp at the top end of the knob?

By anology, frequency shifters change the harmonics linearly, changing the harmonic mix of a sound and drastically affecting timbre. Wheras chorus or pitch shifters transpose the harmonics so that the harmonic structure is preserved. Both being different but both useful.

As far as I know, typical analog phase shifter effects would behave as in your B example. Usually implemented as a string of single opamp phase shifter stages. In cases where the stage frequencies are spread, component values in each stage are identical EXCEPT the value of the capacitor that sets each stage's frequency. And each stage has some kind of "hopefully identical" voltage controlled resistor-- fet, cds optoisolator, transconductance amp, or whatever.

So if the lowest tuning of a 100 hz stage, you apply enough voltage to halve the value of the voltage controlled resistor, the filter will go up one octave to 200 hz. If the next stage has a capacitor value tuning it to 200 hz, when the voltage controlled resistor is halved, the frequency will go up one octave to 400 hz. So the relative freq ratio of all the stages will be preserved, as in your case B.

Post

JCJR wrote: Or maybe a knob that varies the tracking from linear to exp, and perhaps wider than exp at the top end of the knob?
Now that seems like a good idea!

Another thing I was thinking about, with every allpass added the notches move, so the curve is already bent(do we need to compensate for this?), vaguely remember reading something about atan being involved...4x serial allpasses(equal cutoff) with no feedback:
Cutoff 3rd Oct: Notch 1 = ~45.5Hz Notch 2 = ~266Hz = ratio = ~5.84
Cutoff 9th Oct: Notch 1 = ~3.1kHz Notch 2 = ~13.4kHz = ratio = ~4.32

So there seems to be some cutoff "compression" going on...

Also because I'm a cheap-skate, maybe we can only modulate half of the stages and it will still move. Still wondering if 2nd order sections are worth the trouble(from a musical/end-user perspective), that way you can vary the notch width of each pair, maybe shallower at the bottom end and wider at the top. And I haven't even started to experiment with different feedback paths yet :hyper:

Post

Analog phase shifter, the notches come from mixing the phase shifted output with the original dry signal, simple cancellation effect.

Global feedback (as best I recall, AFTER the mixing stage, but that could be a bad recollection) will tend to make the notches narrower and the peaks bigger. But if done wrong or too much, would most likely squeal like a pig.

Making a phaser with series notch filters would be an interesting alternative design, but not what goes on in typical analog phasers. Analog phasers are typically a chain of allpass filters, mixed half-and-half with the dry signal. You get different behavior depending on whether output = phase + input, versus output = phase - input. The subtractive case would put the first notch at DC I believe. A bass-cut variant.

If not mixed with the dry signal, you would get a wobbly pitch vibrato effect, most noticeable with faster lfo settings, but you would get no phaser swoosh at all. Mixed with the dry signal, you get the notches even if the lfo mod amount is zero, or the lfo is turned off. But not mixed with the dry signal, if the lfo is stopped or running slow, you might be hard-pressed to hear the effect at all.

I never made a phaser plugin, but kept meaning to do it one of these days.

If I made a phaser plugin I would use a chain of second order rbj allpass filters.

The analog phaser stages are a first order RC plus feedforward with an opamp to make it allpass. The first order RC would be phase shifted 45 degrees at Fc, and 90 degrees at high freq, and 0 degrees at DC. The opamp configuration doubles the phase shift while making it allpass response, so each analog stage is 0 degrees at DC, 90 degrees at Fc, and 180 degrees at high frequencies.

So it takes a pair of analog phase shifter stages to get 180 degree phase shift somewhere and make one notch. So I believe 6 stages would make three notches, but maybe am thinking about it wrong.

Because an rbj allpass is second order, I suspect a single rbj allpass would have the same phase shift as a pair of analog phase shift stages, but maybe that is wrong. With the rbj second order allpass, raising the Q would "bunch up" the phase shift closer to Fc, and perhaps have similar or identical sound as global feedback in an analog design. I suspect that a Q of 0.707 would best emulate a pair of first order analog phase shifters. If not, my second guess would be a Q of 0.5 .

From perusing old phase shifter schematics-- I have seen some designs that spread the sections about an octave per pair, and other designs that put all the sections at the same frequency. I think most of them spread the frequencies. If all the sections are tuned identical, you would get a group of close spaced notches surrounding Fc. Probably a rather drastic effect given enough stages.

So if I ever make a phaser, would like to have a number of stages setting, a center freq knob, a "freq spread" knob, and an LFO amount knob, probably also user choices of lfo waveform. And the "tracking slope" knob might be a great addition as well.

Post

JCJR wrote:So it takes a pair of analog phase shifter stages to get 180 degree phase shift somewhere and make one notch. So I believe 6 stages would make three notches, but maybe am thinking about it wrong.
Yip, that makes sense.
JCJR wrote: From perusing old phase shifter schematics-- I have seen some designs that spread the sections about an octave per pair, and other designs that put all the sections at the same frequency. I think most of them spread the frequencies.
Most I've seen use the same frequencies, but I've not look at a lot, so I can't be sure.
JCJR wrote: If all the sections are tuned identical, you would get a group of close spaced notches surrounding Fc. Probably a rather drastic effect given enough stages.
Hmm, maybe not. Only tested a simple 4-stage with global feedback (used a basic TPT structure) but the notches only bunch up near nyquist. Interestingly I think(!) the reason why designers actually spread the caps apart is to have a more uniform group delay, this will enhance the vibrato effect you described.

Also after some research - I'm even more confused about the actual control laws, some are exp, some are 1/x, and others are driven specifically with a parabolic waveshape which leads me to believe that the control might be linear on some... Things always get too complicated too fast. :help:
JCJR wrote: But if done wrong or too much, would most likely squeal like a pig.
That sounds fun, I can call it the "PigPoker" :hihi:

Post

Thanks ichad. You are right, googling schematics of several vintage phasers I owned in the dim past, it does appear that the majority of devices tuned all the phase shifter stages in unison. Blame the disinformation on my encroaching senility. :)

Many of the voltage controlled resistor equivalents in the past were not "well behaved devices". Not a very wide linear dynamic range, and not necessarily a very wide linear control range. Perhaps some oddities in lfo waveform of classic circuits may have been the result of designers trying to modify the LFO wave shape to get a "better sounding sweep" given the defects of their chosen voltage controlled resistor equivalent?

Perhaps your observed bunching of notches in the high frequency range is due to hf frequency warping caused by bilinear transform, if that is how your filters are set up to calc coefficients. The rbj filter coefficient formulas use BLT, and generally work great, but a little oddly within an octave or two of nyquist.

http://en.m.wikipedia.org/wiki/Bilinear_transform

If that behavior bugs you, and it indeed can be blamed on BLT mapping, maybe another mapping, or alternately oversample the phaser plugin. I'm quite ignorant of the various methods of generating a discrete filter from continuous prototype.

I seem to recall that some phasers didn't seem to have smooth sounding sweeps. Some units spending too much time on the low side and not enough time on the high side or vice versa. Which might have just been non optimal setting of internal trimmers, or just not a very good design. Or however imperfect, maybe just the best the designer could get based on his chosen parts?

It may be a matter of taste what is the most desirable sweep shape.

If the most desirable smooth sweep would be "constant time per octave", then for instance at 1 octave per second it would take 1 second to sweep 40 hz, from 40 to 80 hz, then one second to sweep 80 hz, from 80 to 160, etc.

At 44.1 khz sample rate, the 1 octave per second frequency multiplier for each sample ought to be 2 ^ (1 / 44100) = 1.00001571775

CurrentFilterFreq = LastFilterFreq * FreqMultiplier // for sweep up
CurrentFilterFreq = LastFilterFreq / FreqMultiplier // for sweep down

Or the filterfreq N samples in the future, sweeping up--

FilterFreqAtNSamplesInTheFuture = CurrentFilterFreq * FreqMultiplier ^ N

Simple minded math, as I am simple minded. :)

Post

Ichad.c wrote:
JCJR wrote: If all the sections are tuned identical, you would get a group of close spaced notches surrounding Fc. Probably a rather drastic effect given enough stages.
Hmm, maybe not. Only tested a simple 4-stage with global feedback (used a basic TPT structure) but the notches only bunch up near nyquist. Interestingly I think(!) the reason why designers actually spread the caps apart is to have a more uniform group delay, this will enhance the vibrato effect you described.
Exactly, you get a notch when the phase shift is exactly 180 degrees, one notch at a time. When the phase wraps around multiple times you get several notches that's it. I'd suggest referring to the "VA Filter Design" book, where I believe pretty much all essential aspects of phasers are covered (if not, I'd appreciate the feedback ;) )

Edit: as for the cutoff control, I believe for a phaser or a flanger it has to be done in the exp scale, because the ear perceives the notches in the same fashion as pitch. A linear control scale will make the notches appear moving at a lower rate for higher cutoffs. Such variations are more appropriate (IMHO) in the explicit selection of the LFO shape. Or, if you have the stages tuned to different cutoffs, then you are actually changing the perceived distances between the notches, if you modulate in the linear scale. (Recall that the filter responses are typically plotted in the log frequency scale, unless in the digital filter design articles, where the authors wish to plot the entire range between 0 and Fs/2).

Regards,
{Z}

Post

Z1202 wrote: I'd suggest referring to the "VA Filter Design" book, where I believe pretty much all essential aspects of phasers are covered (if not, I'd appreciate the feedback ;) )
I've read your book, more than once! I think it is concise.

Btw, for anybody else reading this, a fun phaser to play with is a five stage with global feedback but the output taken from the 4th stage. If stages 1-4 have equal cutoff and the 5th is adjustable -> it can shape the feedback, and hence the notches in interesting ways. Just throw this into Maxima:

Code: Select all

declare([buf0,buf1,buf2,buf3,buf4,vin], mainvar);

  solve([

     xx = vin+r*(y4*2-y3A),
     y0 =   buf0 + f *  (xx-y0), 
     y0A = y0*2-xx,
     y1 =   buf1 +f * (y0A-y1),
     y1A = y1*2-y0A,
     y2 =  buf2 +f * (y1A-y2),
     y2A = y2*2-y1A,
     y3 =  buf3 +f * (y2A-y3),
     y3A = y3*2-y2A,
     y4 =  buf4 +fg * (y3A-y4)
     
    ], [xx,y0,y0A, y1,y1A, y2,y2A, y3, y3A,y4])
It might look a bit convoluted, but once you have a known solution it simplifies quite nicely ( I use "xx" as the known). All the "A" outputs are the allpasses.

JCJR wrote: If the most desirable smooth sweep would be "constant time per octave", then for instance at 1 octave per second it would take 1 second to sweep 40 hz, from 40 to 80 hz, then one second to sweep 80 hz, from 80 to 160, etc.

At 44.1 khz sample rate, the 1 octave per second frequency multiplier for each sample ought to be 2 ^ (1 / 44100) = 1.00001571775

CurrentFilterFreq = LastFilterFreq * FreqMultiplier // for sweep up
CurrentFilterFreq = LastFilterFreq / FreqMultiplier // for sweep down

Or the filterfreq N samples in the future, sweeping up--

FilterFreqAtNSamplesInTheFuture = CurrentFilterFreq * FreqMultiplier ^ N

Simple minded math, as I am simple minded. :)
In DSP land -> simple = elegant.
JCJR wrote:Making a phaser with series notch filters would be an interesting alternative design, but not what goes on in typical analog phasers. Analog phasers are typically a chain of allpass filters, mixed half-and-half with the dry signal.


I finally found an analog phaser that uses 2nd order stages(I think), "A/DA Final Phase", though it's also the weirdest I've seen - hard to figure out what it is actually doing (I can't figure out where the feedback is). In theory you could make 2nd order allpasses with SV filters (with any Q) and add more global feedback without it blowing up <1.

Cheers
Andrew

Edit: most analog phasers are not exactly allpass, just change the "2" to 2.1 or whatever on the allpass lines like "y0*2-xx", for a slight lowpass effect.

Post Reply

Return to “DSP and Plugin Development”