A question about phasers

Started by ElectricDruid, October 14, 2020, 06:02:36 AM

Previous topic - Next topic

ElectricDruid

Hi all,

I've been playing with a phaser design, and I've got some nice notches, but I've got a problem. If you use multiple notches, you finish up heavily reducing the signal level in the midband part where you'd hear the notches most strongly. Here's a picture:



I could compensate for the volume drop using some sort of mid-boost, but it's going to go a bit wayward when the notches start moving around. A 30dB drop in volume seems like a big deal, and that's a *lot* of boost to put in.

The other solution is to space the notches out more (on the graph, they're roughly at octave spacing) but with four notches, there isn't much point going very much wider, so there's not a huge amount of room for improvement there.

Other multi-notch phasers must have hit this problem. What do they do about it?

Thanks,
Tom

11-90-an

Never studied phasers, still a rookie, but here's my suggestion:

QuoteI could compensate for the volume drop using some sort of mid-boost, but it's going to go a bit wayward when the notches start moving around.

Freq boost that moves with the along notches?  :icon_mrgreen:



flip flop flip flop flip

Rob Strand

#2
Is that a cascade of notches?   

A notch always has some attenuation each side of the notch so when you cascade the result is always less than one (0dB).

When you use a cascade of all-pass filters and add it back the original you will get the in phase and out of phase points, which gives you the notches and the peaks.    So that method  comes out even overall by nature and you don't get a problem in the first place.  It is possible to use higher order all-pass filters.

As far as coming up with a notch based solution in the sense that the notches in the individual filters are the same as the notches in the final response: the cop-out solution is to EQ  what you have with a mid-boost. type EQ - either with one band or multiple bands to pull-up the peaks.

Going beyond that I'd have to work out how to work out the pattern in the transfer function of the cascaded all-pass.   It's like,

1 + (s/T - 1) ^n / (s/T +1) ^n

If we take n =2,

H(s) = 1 + (s/T - 1) ^2 / (s/T +1) ^2
         = [(s/T+1)^2 + (s/T - 1)^2 ]  / / (s/T +1) ^2 
         = 2 [(s/T)^2 + 1] / (s/T + 1)^2

So s->0  and s-> inf clearly have a gain of 2 which is compensation *on average* for the notches.

Unfortunately n = 2 doesn't have a central peak, so we'd have to try n = 4.


FWIW, I think Mr Penfolds did a phaser with notches and a switched-cap filter.

Oh, it might be possible with high and low-pass notches but I'm too tired to think that out clearly ATM.

--------------------
The Penfold's switched cap phaser is here,
https://worldradiohistory.com/UK/Practical-Electronics/80s/Practical-Electronics-1983-04.pdf
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

ElectricDruid

Yes, it's a cascade of notches. As you say, there's some attenuation either side of the notch, so the level drops.

And also yes, if you do a chain of all pass filters to get your phaser, you get points where the signal cancels (the notches) but also points where it reinforces, so you get two copies of the input - e.g. x2 gain, 6dB boost.


Rob Strand

QuoteAnd also yes, if you do a chain of all pass filters to get your phaser, you get points where the signal cancels (the notches) but also points where it reinforces, so you get two copies of the input - e.g. x2 gain, 6dB boost.
I've done a few phasers of arbitrary order in DSP and the gain isn't a big deal.  In fact it works out to be "more correct" than if it was unity gain.   The notches reduce the level and the gain at the peaks boosts it back up, so on average it sounds like unity gain.  It's a the same effect you get with a flanger and chorus.   Exactly right is often 1 or 2 dB lower.

For the multiple notch problem it looks like there's a few papers on it, this one and one that it references.   These are z-domain versions of the filter but you could probably re-jig it for s-domain.   Even without those papers you could probably set-up the response magnitude in Excel.   Fix notch frequencies (the numerators), then optimize the denominator w0's and Q's to get a flat response, perhaps a gain term thrown in.  You might need to add some kind of constraint to prevent it from producing very narrow bandwidth notches, since that would make it easier to get a flat pass-band.

https://www.researchgate.net/profile/Chalie_Charoenlarpnopparut/publication/252016378_Multiple_IIR_notch_filter_design_and_optimization_by_Secant_approximation/links/0deec53a0fdb17bfa4000000/Multiple-IIR-notch-filter-design-and-optimization-by-Secant-approximation.pdf?origin=publication_detail
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

ElectricDruid

#5
That's an interesting paper, but I don't think it helps here directly.

This is the filter I was working with:



I came across this somewhere and it struck me that one notch for only one op-amp was rather better than the one-notch-for-two-op-amps-and-a-final-mixer that the typical phaser manages. So then I started experimenting putting a few of them together and spreading out the notches, but I hit the problem described above. I think I'm discovering the catch with doing a phaser based on notches instead of on all pass filters...well, I *am*. I don't just think it, I'm sure!
The advantage of the allpass design is that as you add more stages, the notches become narrower (effectively) and the intrinsic 6dB boost between notches also compensates for the fact you're chopping out a chunk of your signal, which helps keep things perceptually similar in volume between input and output. That's not the case here.

It's a pity, since it would have been nice to simplify a multi-stage phaser a bit. I'll have to see if you can do a 2-pole all pass with a single op-amp. There must be an example somewhere!

T.

R.G.

You and Rob have it - it's the overlapping skirts. In practice, it's not too bad because very few signal actually contain even power distribution from bass up to high treble for it to be noticeable.

One countervailing strategy is to use feedback to insert peaks between the notches. This raises the perceived audio level. Although, again, it's not too noticeable, mostly. Do listening tests.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

Rob Strand

#7
I'm pretty sure I worked out 'a' solution.    The solution uses combination of high pass and low pass notches instead of the common symmetrical notches.     I used the all-pass solution as a starting point instead deriving the results from scratch.

The key point thing to note about the all-pass solution is the notches are not in arbitrary locations.   The all-passes are all designed with center frequency w0 = 1/RC.   However, the resulting positions of the notches are geometrically spaced above and below w0.  For example the 4-stage phaser has notches at  0.414*w0 and 2.414*w0.  Notice that 1/0.414 = 2.414 so the notches are geometrically spaced.

The 4 stage phaser has two notches and a central peak.   In order to reduce mess I'm going to set w0 = 1.  The transfer function is then,

  H(s)  = 1 + (s - 1) ^4 / (s +1) ^4

Which we can write as,

  H(s) = N(s)/D(s)           
          =  [ (s +1) ^4  + (s - 1) ^4 ] / (s+1)^4

Expanding the numerator,
  (s + 1) ^4  = s^4 + 4 s^3 + 6 s^2 + 4 s + 1
  (s  - 1) ^4  = s^4 - 4 s^3 + 6 s^2 - 4 s + 1

we get,

  N(s) = 2(s^4 + 6s^2 + 1)

Aim:  The goal is to represent this fourth order system as a cascade of two second order systems, since that's how the "non-all-pass" cascade version will be implemented.

For the denominator we can bundle pairs to form two second order factors,
 
  D(s) = (s + 1)^2 (s + 1)^2 

Each (s+1)^2 represents the poles for a second order system with a Q=0.5.  Which you expect from since it comes from separate RC networks in the all-pass circuit.

So if we think of the transfer function of the cascade version, the fourth order system will be a cascade of two second order systems, H1(s) and H2(s),

  H(s)  =  H1(s) * H2(s)
            =  [N1(s) / D1(s) ] * [N2(s) / D2(s) ]   ; all N, D are second order

So here's were be bring in the key observation that the notches in the all-pass version are geometrically spaced around the center.
The numerator for two cascaded notches is,

  N1(s) N2(s) = H0 * ( (s/k)^2  + 1 ) ( (s*k) ^2 + 1 )
                        = H0 * ( s^4  + (k^2 + 1/k^2) s^2 + 1)

For the cascade and all-pass versions to be the same we set

  N(s) = N1(s) N2(s)  ; where N(s) is the N(s) derived above

and equating powers of s we get,

  H0 = 2
  k^2 + 1/k^2 = 6

The equation in k is a quadratic equation.   And the solutions are the ones we already know for the phaser k = 0.414 and k = 2.414.

The denominator for the cascade version must also be the same as the all-pass, so we get

  D1(s) = D2(s) = (s+1)^2

So for the cascaded notch version of the circuit to have the same response as the all-pass circuit,

  H1(s)  = ( (s/k)^2  + 1 )  /  (s+1)^2
  H2(s)  = ( (s*k)^2  + 1 )  /  (s+1)^2

For H1(s) the denominator, the second order system has w0 = 1 but the zero is at wz = k
and H2(s) has w0 = 1 and wz = 1/k

So under the hood the 4th order all-pass version implements a cascaded second order system
comprised of a low-pass notch and a high-pass notch, where the denominator w0 is at the geometric
center of the notches.     The all-pass does this without actually having the gain and attenuation from
the low-pass and high-pass notches explicitly exposed, which is a good thing!

For higher order all-pass versions all the denominators will still have w0=1 but the notch positions will split wider with bigger k's.

For the all-pass version the k's are solutions and result from the structure.   For the cascade we can *choose* k's either to match the all-pass version or be something else.

The cascade version has another degree of freedom over the all-pass.  We can choose different w0 (and k) for each 4th-order section.   If we move w0 down it will move  *both* notches down.

So the hanging question is, if we changed the denominator Q, can we find a different solution for k?

Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

R.G.

@Rob: my eyes are officially crossed. I'd have to spend an hour going through that.   :icon_lol:

@E.D.: are you thinking switched-capacitor or switched resistor variables for the changing impedances? I always intended to mess with one or both of those, but never quite got to it.



 
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

Rob Strand

QuoteRob: my eyes are officially crossed. I'd have to spend an hour going through that.   
Agreed, some of these problems have annoyingly long detailed answers.

The short answer is the cascade needs a low-pass notch and high-pass notch to do what the all-pass filter does.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

ElectricDruid

Quote from: R.G. on October 14, 2020, 06:03:14 PM
@E.D.: are you thinking switched-capacitor or switched resistor variables for the changing impedances? I always intended to mess with one or both of those, but never quite got to it.

I was thinking of PWM or PDM with switched resistors, but there's no reason you couldn't do it with the caps instead. Doesn't make a lot of odds theoretically. Practically there might be differences - I'd have to try it to know, having not experimented much with that before.
I have tried PWM with 4066 switches and resistors, and that worked quite nicely. Combining a series resistor with the switch and a parallel resistor across the Switch+R lets you shape the response curve in quite a detailed way too. I spent some time plotting graphs of that, and you can get (reasonably) close to an exponential per-octave character for the modulation.


Rob Strand

#11
QuoteThe advantage of the allpass design is that as you add more stages, the notches become narrower (effectively) and the intrinsic 6dB boost between notches also compensates for the fact you're chopping out a chunk of your signal, which helps keep things perceptually similar in volume between input and output. That's not the case here.
So that circuit is a symetrical notch.   In order to make it a high-pass or low-pass notch it needs to be modified.  There's many high-pass and low-pass notch circuits (in the same way as there are different low-pass and high-pass filter circuits).   

There's some clever ones like the Boctor circuits but there's some which follow from more conventional structure like twin-loop circuits, bridge-T's.   More often than not an extra component is added to skew the response like a resistor load, and that lets the w0 and wz be different  (I spent a lot of time on this 25 years ago.)    For the Wein circuit that might be like adding a resistor or cap in series with the R2+C2 leg, or adding a resistor or capacitor across the ends of R1 & C1.       The problem with the asymmetry in the structure of the circuit is it doesn't lend itself to having the frequency shifted by varying two components.   You might be able to dig around for tunable high-pass and low-pass notches.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Mark Hammer

Some years back, Mike Irwin demoed a phaser for me that used two-pole allpass filters, instead of the cascaded single-pole stages we are accustomed to seeing and using.  What was intriguing was that the notches were noticeably closer together.

I will also note that there are two approaches to use of feedback.  The more familiar one is to take the output of the last allpass stage and feed it back to an op-amp input an odd number of stages earlier.  So, if it was a 4-stage device, the feedback path would go from the 4th stage to the 2nd.  The less familiar path is to take the feedback from the mixing stage, and feed that back to the input at the first stage, such that the feedback is not ONLY phase shifted signal, but the wet+dry output signal, which already contains notches.

Maybe one of those is the answer to what you observe, Tom.

Rob Strand

QuoteSome years back, Mike Irwin demoed a phaser for me that used two-pole allpass filters, instead of the cascaded single-pole stages we are accustomed to seeing and using.  What was intriguing was that the notches were noticeably closer together.
That's my hanging question at the end of the gobbldy-gook post.  If you choose different Q's for the second order stages does it let you choose different k's (k is the the notch spacing from the center).  The first order all-passes force you to have Q=0.5 but with the second all-passes you can choose different Q's.  So I guess that answers it.

The all-pass implementations seems to be well behaved.   The notch implementations have some issues (a common problem with filters).

Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Rob Strand

#14
Here's the idea for changing the Wein Notch to be low-pass and high-pass.  Only showing the idea.   As shown, the step in the response isn't enough to mimic the all-pass phaser.





Both have the issue that the swept resistors aren't equal.

The low-pass notch mod is good in that it adds a cap.  The cap can be fixed and doesn't need to be swept, only the two resistors sweep.

The high-pass notch mod add a resistor which isn't convenient to sweep.  So the form of the high-pass notch also needs to be one which adds a cap, perhaps in series with R2 & C2 (on your ckt)  and R2 & C2 on mine.  I haven't tried it.

The thing with notches is they tend to be quite sensitive to part variations - that's one of the things the researchers have tried to address over the years.


Here's the added cap version of the high-pass notch.



For both the LPN and the HPN the notch depth is *very* sensitive to the part values.
I'm not in favour of them over the all-pass.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

ElectricDruid

Quote from: Rob Strand on October 14, 2020, 08:49:14 PM
The thing with notches is they tend to be quite sensitive to part variations - that's one of the things the researchers have tried to address over the years.

That was one of the reasons I liked the Wien Bridge notch. Even with some part variation, there *will be* a frequency at which the top and bottom of the bridge balance, so the thing still works. Unlike some other notches where if the parts aren't tight tolerance, the notch filter becomes a "bit of a dip" filter.

But ultimately, I feel like this approach is struggling against problems of its own making. The allpass approach *is* much better behaved.

Vivek

You guys are all so amazing !!!

I'm learning such a lot just by lurking.

Respects and Thanks !!!!


Mark Hammer

Some of the most respected pedal-makers out there are lurkers here!  ;)

Rob Strand

#18
QuoteThat was one of the reasons I liked the Wien Bridge notch. Even with some part variation, there *will be* a frequency at which the top and bottom of the bridge balance, so the thing still works. Unlike some other notches where if the parts aren't tight tolerance, the notch filter becomes a "bit of a dip" filter.
The Wien doesn't look too bad.   Yes, some lose the plot quite quickly.  The higher Q filters tend to be more sensitive so it's important to battle the different notches with equal Q's to get apples to apples comparisons.

In general the notches are the toughest filters to get low sensitivity circuits - in particular the low-pass-notch and high-pass notches (these are required for Elliptical and Inverse Chebyshev filters).

QuoteBut ultimately, I feel like this approach is struggling against problems of its own making. The allpass approach *is* much better behaved.

I haven't formally tried to put one up against the other for sensitivities as there seems to be some more fundamental issues:

The main limitation of the straight Wien for a phaser is it is a symmetric notch since it's going to produce the central dip you showed in the first post.

The solution to dip problem is the High-pass-notch (HPN)  +  Low-pass-notch (LPN) cascade.   

However to get the same notch locations as the all-pass version the ratio of the notch wz to filter frequency w0 is quite high.   That means the high frequency gain of the HPN is about 15dB high than the low frequency gain.  And in order to level the response overall the LPN needs to have 15dB attenuation at high-frequencies.    The boosting and cutting in the different bands means the levels at the internal filters/opamps is somewhat higher than the final level at the output of the cascaded filter.   To me that's very undesirable as it looses headroom.  15dB might be workable for guitar if the high-pass notch is put first, sort of like a pre-emphasis/de-emphasis set-up.   (Another way is the HPN is -7.5dB/+7.5dB and the LPN is +7.5dB/-7.5dB)

For the HPN and LPN circuits I gave before the step was only about 8dB.    At the end of the day these are still essentially Wien filters. As shown the filters have maximum gains of 0dB.  As a result there is an overall loss of 8dB which I've compensated for by boosting the input voltage.  I'd have to redesign the filters to have > 0dB gain to get an overall 0dB gain.   Below shows how the cascaded LPN and HPN filters removed the central dip you get with the normal symmetric notch.    As expected the overall response is flat and has no central dip.



I wonder what the Penfold design does?  I haven't check the response of the filters.  Probably have to dig though the datasheet for that switch cap filter chip.

-------
In retrospect and in fairness, the all-pass splits the notches quite widely so it naturally avoids a good deal of the attenuation in present in the original post.   Since the HPN+LPN version is a crude copy of the all-pass it also splits the notches widely.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Rob Strand

QuoteI wonder what the Penfold design does?  I haven't check the response of the filters.  Probably have to dig though the datasheet for that switch cap filter chip.
I wasn't going to look at it but it got the better of me.

Penfold's Switch Capacitor Phaser:
- MF10CN dual switch cap filter
- Both filters are wired is cascade
- filters are both configured as *symmetric* notches (mode 1)
- center frequency f0 = f_clock / 100 (both same)
- notch gains -1 (both same)
- notch Q = 0.67 (both same)

Summary:
Two second order notches are tuned to the *same frequency* so we end-up with a single notch.
The notch is essentially 4th order.
(Didn't work out clock frequency range and f0 range.)

MF10CN config summary:
SA/B   Pin 6      +V      ; for mode 1 & mode 2
CL          pin 12       Vref      ;Vref => f0 = clk/100
R4 not present so mode 1, basic notch


So having the two notches at the same frequency side-stepped the issue of the mid peak dip!
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.