Info on "Theta-Processing" for flangers

Started by DrAlx, February 23, 2014, 12:40:06 PM

Previous topic - Next topic

DrAlx

I've done an analysis of "theta-processing" techniques for flangers.
I hope it adds some clarity to the subject as I could find precious little information available on it on the web. 
I wrote everything up with pretty pictures and shared it as a PDF document here...

http://1drv.ms/1flKf0d

Hopefully someone will find it useful or interesting.

armdnrdy

Useful, interesting, and long overdue!

Thank you for taking the time to put this together.
I just designed a new fuzz circuit! It almost sounds a little different than the last fifty fuzz circuits I designed! ;)

jdub

Well done, indeed. :o  Highly informative and useful- much appreciated!
A boy has never wept nor dashed a thousand kim

Fender3D

"NOT FLAMMABLE" is not a challenge

StephenGiles

I'm sure that is a highly informative document, and it's very well presented indeed, but I get lost at the first formula. So what is the difference in the sound made by a theta processor?
"I want my meat burned, like St Joan. Bring me pickles and vicious mustards to pierce the tongue like Cardigan's Lancers.".

DrAlx

Quote from: StephenGiles on February 23, 2014, 03:35:06 PM
I'm sure that is a highly informative document, and it's very well presented indeed, but I get lost at the first formula. So what is the difference in the sound made by a theta processor?

Quote from: StephenGiles on February 23, 2014, 03:35:06 PM
I'm sure that is a highly informative document, and it's very well presented indeed, but I get lost at the first formula. So what is the difference in the sound made by a theta processor?

Ha Ha.  Good question. :D
I actually have 8 all-pass filters breadboarded at the moment and I'll post some soundclips as soon as I find the time.
If you are expecting something that sounds like a phaser, forget it.
It's always going to sound like a flanger, because it is really difficult to shift all those peaks in the frequency response.

The best description I can give is to say that is sounds like a flanger that has a different EQ on it.
There's nothing in the sound that makes theta-processing sound like its own distinctive effect.
At least that's how it sounds to my ears.   It's a bit like the difference between additive and subtractive flanging.

There are some noticeable differences in certain situations.  One is that it seems to sweep slightly higher (though that's because the all-pass stages are acting like a crude delay line).  Another case is if you kill the flanger sweep and use a low delay in "filter matrix" mode.  That normally gives a whiney whistle sort of sound on a regular flanger.  The theta processing seems to lessen that.  So if you call that whiney sound "metallic" then TP works as advertised ;)

I will probably add the all-pass filters as an add on board to the EM3207 electric mistress clone that I built, because there are cases when I think sounds nicer with the TP on rather than off.

Juergen Haibles claims the real big difference in the Eventide and Storm Tide flanger comes from running the effect in stereo, with different delays and all-pass filters for the 2 channels.  Maybe I'll build a 2 BBD stereo flanger and see for myself because I haven't found any sound clips.

StephenGiles

Wasn't there something in Electronotes about Theta processing?
"I want my meat burned, like St Joan. Bring me pickles and vicious mustards to pierce the tongue like Cardigan's Lancers.".

DrAlx

Quote from: StephenGiles on February 23, 2014, 05:16:38 PM
Wasn't there something in Electronotes about Theta processing?
Apparently so, but I haven't managed to find it which is why I worked everything out for myself.
I hope I haven't got the wrong end of the stick.

jimbeaux

#8
A Delay-Line / Phase Shifter Based Filter Bank (Theta Processor): by Bernie Hutchins appeared in Electronotes EN#117 (included plenty of math and an experimental circuit)

http://electronotes.netfirms.com/

Mark Hammer

#9
The Electronotes document is pretty decent.  Probably just as math-intensive, but still informative.  Happy to pop a copy of it to anyone who wants it.

Theta processing uses lag-type allpass sections.  When we think "phase-shifter", we are usually thinking of lead-type allpass where the amount of phase-shift imposed increases with frequency.  For lag-type allpass, phase-shift is increased with decreasing frequency.  At a non-mathematical level, simply note that in many respects phase-shift=time=delay, except that time-delay is generally constant across the spectrum, whereas phase-shift  is generally different for one part of the spectrum than another.  Adding phase-shift is akin to adding juuuussssttt a teeny bit more time-delay for one part of the spectrum.  If (let me make up some numbers here) that added phase shift was roughly equivalent to 200usec for stuff under 200hz, then that 200usec would always be added to whatever time-delay the BBD was producing, except that it would not apply to anything above where the phase-shft is applied.  So if the current delay-time was 1.5msec, it would be equivalent to 1.7msec for the low end.

The net effect of imposing that additional phase shift on lower-frequency content is that it essentially "stretches out" the space between notches/peaks at the low end.  As you are well aware, in normal flanging, notches are spaced closer together (in terms of absolute frequency) when the sweep goes low (i.e., at longest delay time), with the end result that sound at the low end of the sweep is rather metallic or boxey-sounding.  Because the same time-delay is applied to the entire frequency spectrum, there is little way around that.  Sure you can cut some of the low end in the wet signal so that the resonant peaks in the low end aren't quite as noticeable, but you sacrifice something in doing that.  Perhaps most importantly, higher-resonance settings will lose that certain something.

The added phase shift (and this is fixed phase shift not swept) spaces the low notches out so that they are not quite as harmonically related in their location.  I have not done the experiments myself, but I imagine that using different cap values for some allpass stages could provide even more phase shift at the very bottom and make the notches even less harmonically related.  Exactly what point in the spectrum that needs to happen is a matter for empirical investigation (this part mysteriously omitted in orignal post)

I perfed 4 lag stages, as per Juergen's Stormtide circuit, to install in my Hyperflange (still not done), but have no idea how much of a difference a meagre 4 stages would make.  Clearly more stages would be nice, but the aim is to identify the fewest number of stages needed.  Here I trust our dear departed friend Juergen's judgment.  I encourage folks to whip up a 4-stage daughterboard with a quad op-amp, insert it between BBD and dry/wet mixing node, and see if they like the difference.  In principle, it ought to make even the most mundane flanger a little more "musical-sounding".

armdnrdy

Great explanation Mark.

Is this Juergen's all pass filters that you refered to?

http://www.jhaible.com/sonofstormtide/sost_sch5.pdf
I just designed a new fuzz circuit! It almost sounds a little different than the last fifty fuzz circuits I designed! ;)

DrAlx

#11
Just had another idea based on what I wrote in the document.

You can put a phaser in series with a flanger and get an interesting effect that is a combination of the two.
I know that sounds cool 'cos I tried it.  Here are the signal paths for a flanger followed by a phaser:  
(You need to use a courier font for the symbols to line up.)

   |-----|     |-----|
---|     +-->--|     +--->
   |--D--|     |--A--|

A flanger works by splitting the signal into a clean path and a path with a delay line "D", and then sums them.
A phaser works by splitting the signal into a clean path and a path with some all-pass filters "A", and then sums them.

There are 2 x 2 = 4 different combinations of path that a signal can take through the system.
So the above system is equivalent to a system where we split the signal into 4 paths, do different things in those paths, and then add the 4 results.  Like this...

   |----A----|
   |         +---|   
   |----D----|   | 
---|             +--->
   |---------|   |
   |         +---| 
   |--D---A--|

So why would you want to double the number of components to get exactly the same effect?  Well my idea is that you could output things to 2 channels as follows, so that the (flanger + phaser) sound recombines spatially in the air (or spatially in your head).

   |----A----|
   |         +---> Left   
   |----D----|     
---|             
   |---------|   
   |         +---> Right
   |--D---A--|

The left channel is a flanger with what I call "parallel" theta processing in my document, only with variable all-pass filters instead of a fixed ones.
The right channel is a flanger with what I call "series" theta processing in my document, again with variable all-pass filters.



Mark Hammer

Quote from: armdnrdy on February 23, 2014, 10:22:37 PM
Great explanation Mark.

Is this Juergen's all pass filters that you refered to?

http://www.jhaible.com/sonofstormtide/sost_sch5.pdf

Thanks.  Yes, that drawing is them.  In the more commonplace drawing of phase-shift stages, the cap would be where you see the 10k resistors, and there would be either a fixed resistor, LDR or JFET where you see the cap.  If my math is correct, those 4 stages apply 360 degrees of phase shift (90 degrees per stage) below 1590hz.

DrAlx

#13
Quote from: Mark Hammer on February 24, 2014, 12:40:18 PM
Quote from: armdnrdy on February 23, 2014, 10:22:37 PM
Great explanation Mark.

Is this Juergen's all pass filters that you refered to?

http://www.jhaible.com/sonofstormtide/sost_sch5.pdf

Thanks.  Yes, that drawing is them.  In the more commonplace drawing of phase-shift stages, the cap would be where you see the 10k resistors, and there would be either a fixed resistor, LDR or JFET where you see the cap.  If my math is correct, those 4 stages apply 360 degrees of phase shift (90 degrees per stage) below 1590hz.

You've got things the wrong way around.  The phase lag increases with frequency.
You correctly say that you can think of phase lag as being a bit like a time delay.
Well a time delay always produces a phase shift of zero at DC, and the phase shift then increases with frequency.
Just think about it.  A DC signal does not change in time.  Therefore delaying a DC signal cannot possibly change its phase.
And in fact its phase is always zero by definition.  (That's the phase assigned to it in it's phasor representation).

Consider one of those stages in Juergen's PDF for a low frequency signal near DC.
The capacitor acts as an open circuit.
So if the input voltage is Vin, then the voltage at the non-inverting terminal is is also Vin.
Therefore the voltage at the inverting terminal is Vin (due to the rules for op-amp with feedback)
Therefore no current flows through either of the input resistors.
Therefore no current flows though the feedback resistor.
Therefore the output voltage is Vin.
So the filter is just acting like a non-inverting voltage buffer at low frequencies.
Therefore the phase lag is zero.
(The other type of all-pass filter acts like an inverting voltage buffer at low frequencies).

As I explain in my document, there is no significant difference between the two different types of all-pass filter.
A better choice of names for these filters would be:
  "phase lag"   ==>  "Non-inverting phase-lag" all-pass filter
and
  "phase lead"  ==> "Inverting phase-lag" all-pass filter.

They both produce exactly the same "true" phase lag (i.e. zero at DC and 180 degrees at infinity).
It's just that the "phase-lead" filter then goes and flips the signal at the output.
You should not confuse a signal inversion (which produces an additional "fake" 180 degree lag across the whole spectrum) with a "true" phase lag.  
The "true" phase lag must be 0 at DC for both types of filter (by definition).  The phase of the output from the "phase lead" filter is 180 degrees at DC, but that's not due to the DC signal being "lagged" somehow.  No.  It's just been inverted.

You would never say a voltage follower gives a phase lag of 360 degrees at all frequencies.
You would just say it doesn't change the phase.
Similarly you should not say an inverter gives a phase lag of 180 degrees at all frequencies.
That is very misleading.  You should just say that the signal is inverted.

If you have an EVEN number of all-pass filter stages of the same type, then it doesn't matter what that type is.
i.e. 4 "phase-lead" AP filters in series will gave the same phase change as 4 "phase-lag" AP filters.
Each"phase-lead" filter inverts the signal as you go down the chain,
but since the signal ends up being inverted an even number of times, there is no overall sign change at the output.
So you just get the sum of the 4 "true" phase-lags at the output.

Does that make sense?





amz-fx

Not sure if they are closely related, but this reminds me of the Schroeder reverb algorithm, which uses delay lines in series with all-pass filters.

regards, Jack

DrAlx

Quote from: amz-fx on February 25, 2014, 07:49:21 AM
Not sure if they are closely related, but this reminds me of the Schroeder reverb algorithm, which uses delay lines in series with all-pass filters.

regards, Jack


Thanks for mentioning that Jack.  Just looked it up.  Very interesting and it is almost exactly like the "series" type of theta processing.

With the series theta-processing approach, the aim of the AP filters is to add phaser-like notches to the left of the regular flanger notches.
So the notch distribution looks phaser-like on the left but is eventually regular on the right
** *  *  *     *        *                    *                    *                    *                   *                   *                                 
The more AP filters stage you use, the more notches you can put in the phaser-like bit on the left.
The only problem is that it's only possible to squeeze those extra notches to the left of the first flanger notch.
Therefore it's only practical to do when the flanger notches are widely spaced and leave a big gap on the left.

I don't know what the aim is with the reverb.  My gut feeling is that rather than try and stick all the notches on the left,
they would probably just disperse them over a much wider range. 
This does not mean that will see random clumps of notches throughout the flanger response.
Rather, it means all the flanger notches would see some small modification.  I'll read about it some time.


culturejam

Quote from: amz-fx on February 25, 2014, 07:49:21 AM
Not sure if they are closely related, but this reminds me of the Schroeder reverb algorithm, which uses delay lines in series with all-pass filters.

regards, Jack


And your comment reminds me of the reverb theory comments by Keith Barr (of Alesis and Spin Semi) on adding a ton of all-pass stages to reverb algorithms to make them sound more natural.

tubegeek

Quote from: DrAlx on February 24, 2014, 07:42:05 AM
(You need to use a courier font for the symbols to line up.)

If you use the "code" and "/code" tags before and after your desired fixed-width Ascii-matics, they will look the way you want them, preserving white space and lining up column-wise correctly. The little button with the octothorpe (#) on it is the one you want in the post editor. Plus, I was just able to work "octothorpe" into a sentence, so I win.

(replace the quotation marks I put in the tags with square brackets for proper results)

Quote


   |-----|     |-----|
---|     +-->--|     +--->
   |--D--|     |--A--|



A flanger works by splitting the signal into a clean path and a path with a delay line "D", and then sums them.
A phaser works by splitting the signal into a clean path and a path with some all-pass filters "A", and then sums them.

There are 2 x 2 = 4 different combinations of path that a signal can take through the system.
So the above system is equivalent to a system where we split the signal into 4 paths, do different things in those paths, and then add the 4 results.  Like this...

   |----A----|
   |         +---|   
   |----D----|   | 
---|             +--->
   |---------|   |
   |         +---| 
   |--D---A--|

So why would you want to double the number of components to get exactly the same effect?  Well my idea is that you could output things to 2 channels as follows, so that the (flanger + phaser) sound recombines spatially in the air (or spatially in your head).

   |----A----|
   |         +---> Left   
   |----D----|     
---|             
   |---------|   
   |         +---> Right
   |--D---A--|

The left channel is a flanger with what I call "parallel" theta processing in my document, only with variable all-pass filters instead of a fixed ones.
The right channel is a flanger with what I call "series" theta processing in my document, again with variable all-pass filters.



"The first four times, we figured it was an isolated incident." - Angry Pete

"(Chassis is not a magic garbage dump.)" - PRR

armdnrdy

Alex,

Sorry for necroposting but...

I read through your document on Theta Processing and...although I don't understand much of the math....I do understand the pretty pictures and your explanations of the results.  ;)

You gave examples of adding delay line feedback, which had the result of "canceling out" the effect of the all pass filters, and restoring the flanger notches.

I had a thought!  :icon_idea:

I am curious what the result would be by introducing feedback to the all pass filters to reinforce the phaser notches.

The phaser and delay feedback would have to be separated in such a way to where they would not interfere with one another.

Thoughts?
I just designed a new fuzz circuit! It almost sounds a little different than the last fifty fuzz circuits I designed! ;)

DrAlx

#19
Hi Larry.

It's easy to check..

Here's a picture when you have 6 all-pass stages in one arm, and a BBD with feedback in the other arm that is parallel to it.
The "0.5" means 50 percent feedback.
(If you wanted to change the 6 all-pass stages to just 2 stages, then change all the 6's in the formula bar to 2 and replot.)
The following generates one of the pictures in the document and you can see you get interesting set of flanger notches.

http://www.wolframalpha.com/input/?i=plot+abs%28P%2BD%2F%281-%C2%AD0.5*D%29%29+where+D%3Dexp%28-%C2%AD2*pi*ix%29+and+P%3D%28%28pi*ix%C2%AD-6%29%2F%28pi*ix%2B6%29%29%5E6+from+x%3D0+to+10

Added a separate feedback loop back for the phaser stages would give this... 
In the following I used "0.4" to mean 40 percent feedback for the phaser arm, just to show you don't need to use the same feedback factor as the delay arm.

http://www.wolframalpha.com/input/?i=plot+abs%28P%2F%281-0.4*D%29%2BD%2F%281-%C2%AD0.5*D%29%29+where+D%3Dexp%28-%C2%AD2*pi*ix%29+and+P%3D%28%28pi*ix%C2%AD-6%29%2F%28pi*ix%2B6%29%29%5E6+from+x%3D0+to+10


So you basically get the same plot only with deeper notches.  The notch positions don't change.

Correction. The phaser becomes more dominant than before, so some flanger notches get weaker by comparison.
http://www.wolframalpha.com/input/?i=plot+abs%28P%2F%281-0.4*P%29%2BD%2F%281-%C2%AD0.5*D%29%29+where+D%3Dexp%28-%C2%AD2*pi*ix%29+and+P%3D%28%28pi*ix%C2%AD-6%29%2F%28pi*ix%2B6%29%29%5E6+from+x%3D0+to+10



I did actually build and experiment with both the "parallel theta processing" and "series theta processing" schemes well over a year ago now, and tried different numbers of stages.  The effect is very subtle and I did not think it made a massive difference to the sound. It basically sound like a flanger with some EQ applied.  What made more of a difference though was listening in stereo (I think I put about 4 all-pass stages in one arm for the left channel, and no all-pass stages in that arm for the right channel).  So you could hear there was something "spatial" about the sound in that case, but even then it still sounded like a flanger to me, and I didn't find that TP  got rid of the metallic sound that occurs for large delays.