State Variable Filter LPF noise

Started by MrStab, December 29, 2016, 08:34:57 PM

Previous topic - Next topic

MrStab

hi guys,

after a bunch of issues working on this, only 92% of which were caused by plain stupidity, i finally have a multi-band parametric EQ system that switches between peaking and shelving modes quite nicely... except for this one problem! damnit!

referring to this http://sound.whsites.net/articles/st-var-f5.gif:
i'm using a CD4053 to switch the Q pot out of the circuit, and to switch between the BP or shelving output back into the diff-amp (U1A). R6 is also switched to Vref for a permanent Q. shelving outputs must both go through an inverter to give VR1 the proper response. regular band-pass mode works fine.

as my problem seems to exist when hard-wired, without CMOS switching, here's a diagram of the effective circuit in the problem "shelving mode":



the HPF mode on the "low" band, from 25-400Hz, switches seamlessly and only introduces negligible extra noise at one extreme. the LPF "high" band (pictured) does what it's supposed to, but has a permanent "windy" noise, even with Boost/Cut (VR1) centred. not the kind of windy noise you might get with a gated fuzz. it's that high-Q-nearing-feedback sound, with a bunch of hiss generally. only as far as i can tell, the Q should be quite low at 3k3. Boost/Cut does have some minor effect on the level, but as you'd expect, the Frequency pot (VR3) that changes the pitch of this tone. the problem happens with this band in isolation, with the input grounded.

things i've tried:


  • -different op-amps, negligible difference
  • 330pF cap across R2, to kill ultrasonic oscillation above 24KHz. no luck, so i tried higher values and got rid of some hiss... along with the wanted audio range. so no dice.
  • 330pF-680pF caps across R7. this actually kinda worked! ...until the Frequency pot approched the corner frequency, causing loud oscillation.
  • 330pF+ on R15. same issue of just cutting the whole thing.
  • 100R between U3 output & CD4053. i know there's 150R (or something) series resistance between 4053 poles, but i thought maybe it could help.
  • 100nF across all op-amps' Vcc & Gnd.

could it just be a layout issue? FWIW, i've tried it on 2 layouts with the same issue. there's a gain of 3.2 before any of this, which helps with the first 2 bands but not the last. maybe the size of the Frequency pot (500k) is to blame? also, i realise i'm actually using the HPF output of the SVF to make a LPF through the magic of the diff-amp (at least i think), which i have a feeling may be related?

any tips really appreciated! i can't get a recording right now as it's late, but i could tomorrow.

cheers!
Recovered guitar player.
Electronics manufacturer.

Rob Strand

#1
The issue isn't obvious and you have done pretty well so far narrowing things down.

First-up your "phasing" of the various outputs look OK.   (For an SVF, do you know they BPF is out of phase from the LPF and HPF?)

My naming of the signals is high-pass (HPF), band-pass (BPF) and low-pass (LPF) across the state variable filter (SVF).

Quotebut has a permanent "windy" noise, even with Boost/Cut (VR1) centred. not the kind of windy noise you might get with a gated fuzz. it's that high-Q-nearing-feedback sound, with a bunch of hiss generally. only as far as i can tell, the Q should be quite low at 3k3.

Quite a vivid description.

As to the cause  it might be a "Q" thing like you describe but like you I see the Q being quite low so it doesn't make sense.   At this point I see it like this:

As shown, the tap from the SVF is the HPF output, passing high frequencies.     By nature this output contains more high frequencies than the other two.   HPF signal passes through an integrator to produce a BPF and will attenuate any hiss on the HPF signal.  The BPF then passes through the integrator to produce the LPF which further reduces the hiss.  If the source of noise is the first SVF opamp then I would expect the timbre of the noise to vary with the frequency control and be a function of the Boost-cut pot.

Quote330pF cap across R2, to kill ultrasonic oscillation above 24KHz. no luck, so i tried higher values and got rid of some hiss... along with the wanted audio range. so no dice.
That makes sense as it is just filter the whole signal.  It might be wise putting 47p to 150pF in that position.

Quote330pF-680pF caps across R7. this actually kinda worked! ...until the Frequency pot approched the corner frequency, causing loud oscillation
Fair enough too but generally not a good idea putting too much low-pass behaviour in a feedback loop because of what you saw.

[Edit fixed quote]
Quote330pF+ on R15. same issue of just cutting the whole thing.
This is filtering the overall noise from the HPF output.  If you put a resistor in series with the cap (maybe somewhere around 470R to 1k)  I suspect you might be able to stop the oscillation.   At first I thought  I though you are rolling off highs and this attenuating the noise from the HPF o/p.   *But* when I calculated the -3dB point I'm seeing 50kHz to 100kHz.   So maybe this is the key.   Maybe there is some form of oscillation.  Using the + input of the boost/cut opamp might not be helping  but many designs do this.

Quotecould it just be a layout issue?
It is possible but the fact you tried two layouts means some secondary measure might be needed.

One thing worth trying is to put a buffer on the board before the input.  Sometimes if the drive impedance is too high you can get some unforeseen feedback paths.

Some other things to try are place a small cap, maybe 10pF to 100pF, across R8.   This is an old trick use the extend the band-width of an SVF (and also the Tow-Thomas Biquad filter).  Another way to do the same thing, but better, is to put small resistors (maybe 100R) in series with both integrator caps.

Yet another thing to try is to remove the boost-cut pot altogether and connect the SVF input to the signal input.   With this configuration you have eliminated any feedback paths around the boost/cut opamp.   Obviously the noise will be it's worse in this configuration.  In fact you could just listen to the HPF output maybe the issue is nothing to do with the Boost-cut amp part or interactions with it.


Quotemaybe the size of the Frequency pot (500k) is to blame? 
It is possible, but at this point I don't think so.  You know you can also wire the pots in series with the 12k input resistors ie not as a divider.  They should perform similarly.  It's only something to try so as to give the layout a nudge.

Quotei realise i'm actually using the HPF output of the SVF to make a LPF through the magic of the diff-amp (at least i think), which i have a feeling may be related?
I think you may have the names around the wrong way.  Listen to the individual o/ps and you will soon know.

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

MrStab

#2
thanks for taking the time, Rob!

Quote from: Rob Strand(For an SVF, do you know they BPF is out of phase from the LPF and HPF?)
indeed, 90 degrees afaik. that led to some major misunderstanding about how the B/C pot worked when i realised that, but i think i figured it out by seeing it common to other filters.

Quote from: Rob StrandIf you put a resistor in series with the cap (maybe somewhere around 470R to 1k)  I suspect you might be able to stop the oscillation
sounds good, i'll try that. do you mean parallel to R7? just checking as you quoted the same bullet point twice and maybe you meant the one below it.

Quote from: Rob Stranda small cap, maybe 10pF to 100pF, across R8.
i'll give that a go later on and report back. i might be able to do the alternative you suggested fairly easily as well.

Quote from: Rob StrandOne thing worth trying is to put a buffer on the board before the input.
there's an op-amp gain stage at the very first band, but also a buffer just before this band as the volume pot precedes it for interface reasons.

Quote from: Rob StrandI think you may have the names around the wrong way.  Listen to the individual o/ps and you will soon know.
it's weird, but here's what both my ears and LTSpice show on full cut (blue is HPF output, yellow is diff-amp output):


seems the Q is upside-down as well, though in Spice, lowering that 3k resistor results in lower Q on both the diff-amp & HPF outputs. so not reverse behaviour, plus the problem exists with no resistor there at all. maybe something there, though - it's weird that i have to overshoot the Q like that because of the difference between the HPF and diffamp outputs.

thanks again, i'll try those things asap!
Recovered guitar player.
Electronics manufacturer.

Rob Strand

Quotethanks for taking the time, Rob!
No problem.

For the LPF, BPF, HPF output, the order of outputs in my mind is like this:  (don't worry about the different configuration of the inputs.)
http://mysite.du.edu/~etuttle/electron/circ528.GIF
http://electronicdesign.com/analog/second-order-state-variable-filter-consumes-less-3

Quotesounds good, i'll try that. do you mean parallel to R7? just checking as you quoted the same bullet point twice and maybe you meant the one below it.
I'm thinking R15.   There would be a series R and C network  in parallel with R15.   The idea is it reduces the hf gain and the resistor forces the phase shift back to zero (whereas the cap by itself would have a 90deg phase shift).

Quoteit's weird, but here's what both my ears and LTSpice show on full cut (blue is HPF output, yellow is diff-amp output):

Yes, something weird is going on.

If I take the HPF output (according to my reference pics at the top of this post) and feed it to the inverting opamp stage U3, then to the non-inverting input of the boost/cut opamp:   I get a set of treble boost/cut responses, which is what I expected.  In your simulations, try setting your B/C pot to both boost and cut, note the gain at high frequencies and low frequencies in each case.   In my simulation I see the a constant low-frequency gain and the high-frequency gain is above that for boost and below that for cut, implying a treble control.

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

Rob Strand

#4
Quoteit's weird, but here's what both my ears and LTSpice show on full cut (blue is HPF output, yellow is diff-amp output):

I think I understand your plot now.  Take the green (yellow?) trace that starts just above 0dB at 10Hz and dips down to about -15dB at 10kHz.   I see that as treble cut  not bass boost.    If you set the boost/cut pot to the other extreme to what you have there you should see a large gain at high frequencies implying treble boost.   You should also see on the left hand side (ie.at 10Hz) that the trace pretty much stays at 0dB.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Rob Strand

Quoteit's weird that i have to overshoot the Q like that because of the difference between the HPF and diffamp outputs.
The peak at around 30Hz is normal.  When you use a second order filter in a tone control it gets wiggles where you would normally think it would be flat.   When you do set the EQ to cut there is a region where it boosts the signal  and when you boost there is a region where it dips down - it goes opposite to what you would expect.

FYI, this paper by Bohn shows how to stop the wiggles,
http://www.rane.com/pdf/acceler.pdf
Unfortunately he doesn't have a plot showing the bad case.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

MrStab

it's green? i have red-green colourblindness but i should still have been able to tell that, should probably have looked closer!

R15 never oscillated, but a cap there had too much of the "cut hiss AND signal" tradeoff. i tried a 1k resistor along with a 2n2 cap anyway, with no improvement. i also tried a 1k resistor & 680p cap across R7, but it oscillated even worse than before. no improvement with 100p across R8.

i'm starting to wonder something, if the subtraction means the whole thing's upside-down: the Q of the noise doesn't seem to change regardless of R6 (even though it does in Spice and the actual roll-off is audibly different), and the inverter gain at R15 sets the boost/cut range, then maybe it's the Q at the opposite corner of the shape that's causing the issue? which could be determined by U3 and/or U1A?

i saved that PDF for later use, thanks for that and the other links!
Recovered guitar player.
Electronics manufacturer.

ElectricDruid

In an SVF, the "Q" control is often done by setting the thing to oscillate, and then feeding back enough signal to damp it. That might be why the LPF (final integrator) output goes back to the inverting input (though I can never keep it all straight in my head, what with the inverting integrators too)
I think you might have got it set to maximum Q when you've turned it to shelving mode. Try rearranging it so the shelving is set up as if the Q pot was at the other end.

HTH,
Tom

MrStab

#8
thanks for the input, Tom. i've tried both high and low values on either input of U1B, to no avail. i haven't tried it with an actual pot back in place (so both inputs have resistance to Vref), but the sim suggests that probably wouldn't change anything.

i've tried all sorts of things all day, trying to turn the feedback resistors into RC filters etc, you name it, no luck. i'm starting to think it's a sketchy approach. Rob hinted at it earlier, i may be wrong but it seems to me that the flat signal is being subtracted from the HPF output (U1B), where loads of high-end noise exists, hence the "flipped" effect with the result being a noisy LPF on the output of the diff-amp.

if the LPF/HPF outputs aren't inverted before reaching U1A, the Boost/Cut pot limits to the gain set by R16 at full rotation, but shoots up erratically when the pot is turned just slightly (before cancelling at the mid-point). if there were some way around that, things might be easier.  i'd really rather not reverse U1A's polarity, but if there's no other solution i'll need to consider it.

btw i realised i made a dumb error on the diagram - R9 & R10 should ofc be 10k for 16KHz.

just noticed: interestingly, according to Spice, using a non-inverting amp for U3 instead (with a gain of 5.7/15dB), that weird pot effect doesn't happen. but then i'm stuck with too loud a boost, unless R16 changes, too.
Recovered guitar player.
Electronics manufacturer.

Rob Strand

#9
We need to determine if the SVF is the cause on it's own.  If you separate the SVF and listen to the output from the HPF tap, do you hear the noise? Perhaps ground the input of the SVF in this test.
Another good test would be to measure the frequency response of the SVF alone to see if it matches the expected behaviour.  If not there's something weird going on.
If the noise present with SVF alone then there's something weird about the SVF and that needs to be debugged in isolation. Putting a buggy filter in the boost/cut feedback loop is making life hard.

Quotei'm starting to wonder something, if the subtraction means the whole thing's upside-down:
Looking at your original circuit, it looks like it works fine.  The phasing of the output looks good and the boost/cut stuff all works.   I get nice boost/cut curves on the simulator.   So the general idea looks fine.
[Edit 2: Example of circuit like yours UREI-545
http://www225.pair.com/audio/waltzingbear/Schematics/Urei/545.JPG]

It is definitely possible to use the inverting inputs of the boost/cut opamp and get that working.  At this point I don't think it is the problem.    There's another type of EQ circuit which uses two opamps for the boost/cut circuit.  This is quite common for parametrics and I have used it myself - but again we are just changing things before we know the SVF itself is OK.
[Edit 1:   see fig 23 of http://www.rane.com/note122.html  lt works without a tapped pot.]

If the SVF is good and it oscillates we will deal with that separately.  It will be some second order effect and then we need to work out where to put some caps to prevent it. I did a crude "loop gain" analysis of the HPF mode with the boost-cut circuit in and there's nothing obvious that would cause oscillation.  I did not add any extra components or change the circuit from what you had drawn originally.  I didn't do a loop gain analysis of the SVF itself.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Rob Strand

Quote15 never oscillated, but a cap there had too much of the "cut hiss AND signal" tradeoff. i tried a 1k resistor along with a 2n2 cap anyway, with no improvement. i also tried a 1k resistor & 680p cap across R7, but it oscillated even worse than before. no improvement with 100p across R8. 
BTW not sure why you see such angry behaviour.

If you have to lose highs to remove the noise that often means the noise is really there!
It's either the design itself or the opamps are noisy.   Damaged opamps can go noisy.

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

Rob Strand

Here's an example of a parametric which has shelving EQ:
http://www.gyraf.dk/gy_pd/calreq/calr_eq.gif

The interesting thing is it has caps on the feedback resistors on a few opamps and it also has the bandwidth extension cap I mentioned earlier.   The boost-cut structure is like the one from the Rane article.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

MrStab

the SVF stage itself definitely works fine, as a flick of the switch puts it into the nice & quiet peaking mode (apart from some noise when the Q pot is highest). the straight outputs from U1B & U2B don't have the problem, so at this point i think it has to be something to do with U3 or U1A.

that R7 oscillation is a weird one, and annoying because it works the best otherwise! that actually seemed to stop the problem at-source and not just cut it after the fact. i think i went up to 7k5 on the resistor! though i didn't give much consideration for the effect on the gain at the time, maybe it could help if i did? it's really loud, sudden whooping/siren oscillation. as i mentioned earlier, it seems to oscillate as the Frequency pot approaches that limit.

things i've tried over the day (that i can even remember) are 1nF to Vref at one input of U1B, then the other, various caps & resistors across R7, cap across R8, R5, various combinations across R15, 1nF to ground after R9 & R10 (getting desperate)... nothing that helpful, just the usual intrusive roll-offs. i'm overshooting a bit with these values, ofc.

the noise is definitely being introduced, or the floor hugely amplified, by this stage. i've gone through multiple op-amps so doesn't seem to be that. problem exists with both a battery and PSU.

cheers again! thanks for the link, i'll have a look just now
Recovered guitar player.
Electronics manufacturer.

MrStab

#13
i see that the mixer in the Gyraf EQ (eg. IC6A) has the + input grounded. this seems to work well in Spice, but without R16 in my diagram, i can't regulate the gain in the mixer. any idea about that? and if this scheme is likely to be less-noisy generally? it still has the HPF-becomes-LPF thing going on. it wouldn't take that much reworking, though. just enough to want to guess if it's worth it.

edit: also noticed the SVF's first op-amp has different polarity. hmm...
Recovered guitar player.
Electronics manufacturer.

Rob Strand

#14
Quotethe straight outputs from U1B & U2B don't have the problem, so at this point i think it has to be something to do with U3 or U1A.
OK cool.  That means it is extremely likely we are dealing with an oscillation issue.   One that is caused by putting the filter in the boost/cut loop.

One thing I did notice is, in the final circuit the noise from the HPF is amplified by U1A by a factor of 5 due to the gain on the opamp + input; set with R16.

Quote
that R7 oscillation is a weird one, and annoying because it works the best otherwise! that actually seemed to stop the problem at-source and not just cut it after the fact. i think i went up to 7k5 on the resistor! though i didn't give much consideration for the effect on the gain at the time, maybe it could help if i did

While it might not work now.  I believe we are on the right track.   Sometimes the fact you can make it worse is a hint on how to make it better.  The only idea I have at the moment is to try smaller value caps across the feedback resistors.

Another thing to try is see if
- decreasing R15 or
- increasing R17 or
- increase R16
can remove the problem.     Try a factor of 2.

Generally decreasing the gain in the loop helps remove oscillation.

It looks like one of those problems where the cause is in the fine details.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Rob Strand

Quotesee that the mixer in the Gyraf EQ (eg. IC6A) has the + input grounded. this seems to work well in Spice, but without R16 in my diagram, i can't regulate the gain in the mixer. any idea about that? and if this scheme is likely to be less-noisy generally? it still has the HPF-becomes-LPF thing going on. it wouldn't take that much reworking, though. just enough to want to guess if it's worth it.

I'd have to look into the details maybe you can tweak or remove R16 and adjust R15 or R17 to compensate.  I know you can only go so far doing this with some EQ's that use the + input of the boost/cut opamp.

Quote
edit: also noticed the SVF's first op-amp has different polarity. hmm...
[/quote]

That's OK.  It a consequence of the inverting boost/cut structure.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Rob Strand

Does the problem get worst in the cut position (ie. pot wiper at the output of U1A)?

I'm also having trouble understanding how the SVF can be OK yet it oscillates in the boost position (ie. pot wiper at the EQ input).  In this configuration there isn't really any feedback going on where the SVF is inside the loop, it is just an adder/feed-forward structure.

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

MrStab

the lowest i could go on R7 without any dog-whistle oscillation at the very top was 51pF, but at that point there was no beneficial effect. all i can think of is maybe increasing the resistor in series with that cap so the gain reduction of the noise isn't so sharp, if that would somehow reduce the likelihood of oscillation.

i have R16 lowered to 4k7 in the first place to compensate for R6's effect on the level, and the right combination of those two resistors (aiming for +/-15dB) can mitigate the problem slightly, but i'm wondering if too much attenuation at this point could increase noise as the difference is amplified back up in the diff-amp?

it's hard to say if it gets worse in the Cut position but i'd have to say no, it's very slightly better than in the Boost position. it is a pretty confusing issue, i'm no expert but all i can suggest is it's the noise floor being emphasised and/or some kinda annoying perma-Q.
Recovered guitar player.
Electronics manufacturer.

Rob Strand

OK one idea.  Ground the input of the SVF but leave the output connected to the +input of U1A.
If you want you can completely remove the boost/cut pot but I suspect you don't need to.

Can you still hear the noise?

In this configuration:
- there is no feedback to cause oscillation (unless there's a layout issue).
- the output of the SVF is amplified as it is in normal operation

Quoteall i can think of is maybe increasing the resistor in series with that cap so the gain reduction of the noise isn't so sharp, if that would somehow reduce the likelihood of oscillation.
It may well reduce the likelihood of oscillation.  However if you are attenuating hf noise in anyway that means you are also attenuating the hf part of the signal - which you shouldn't do.   The way normal way out here is to use a pre-emphasis/de-emphasis arrangement around the thing that is noisy.    That way the signal doesn't get affected.

I played around with a few schemes to reduce the chances of oscillation and they are all things you have tried, which did not work.   For example a cap across R2, maybe 100pF, usually fixes oscillation problems. 

It's quite puzzling (and frustrating)!


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

Rob Strand

Quotesee that the mixer in the Gyraf EQ (eg. IC6A) has the + input grounded. this seems to work well in Spice, but without R16 in my diagram, i can't regulate the gain in the mixer. any idea about that?

The gain is set by the 5.1k resistor on the input of IC6A.

I'm stuck at this point.

The "best" config for loop gain robustness is, altogether:
- 33pF across R7, 
- 680pF in series with 100R then that in parallel with R15
- 100pF to 150pF across R2

Not much different to what you have tried.  This assumes a cut configuration for worst case.
The boost config should work with or without it (provided no layout weirdness).




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