DIYstompboxes.com

DIY Stompboxes => Building your own stompbox => Topic started by: MrStab on December 29, 2016, 08:34:57 PM

Title: State Variable Filter LPF noise
Post by: MrStab on December 29, 2016, 08:34:57 PM
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 (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":

(https://www.dropbox.com/s/41nzj1aic5yyg0n/svfhinoize.png?raw=1)

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:


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!
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on December 29, 2016, 11:12:17 PM
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.

Title: Re: State Variable Filter LPF noise
Post by: MrStab on December 30, 2016, 01:29:12 AM
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):
(https://www.dropbox.com/s/pbwbjpckj1x85qs/hplp.png?raw=1)

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!
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on December 30, 2016, 02:06:46 AM
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.

Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on December 30, 2016, 02:25:30 AM
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.
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on December 30, 2016, 03:08:54 AM
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.
Title: Re: State Variable Filter LPF noise
Post by: MrStab on December 30, 2016, 01:22:02 PM
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!
Title: Re: State Variable Filter LPF noise
Post by: ElectricDruid on December 30, 2016, 04:38:08 PM
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
Title: Re: State Variable Filter LPF noise
Post by: MrStab on December 30, 2016, 05:36:08 PM
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.
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on December 30, 2016, 07:54:39 PM
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.
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on December 30, 2016, 08:16:50 PM
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.

Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on December 30, 2016, 09:02:02 PM
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.
Title: Re: State Variable Filter LPF noise
Post by: MrStab on December 30, 2016, 09:32:05 PM
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
Title: Re: State Variable Filter LPF noise
Post by: MrStab on December 30, 2016, 09:49:09 PM
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...
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on December 30, 2016, 09:55:11 PM
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.
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on December 30, 2016, 09:59:28 PM
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.
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on December 30, 2016, 10:21:23 PM
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.

Title: Re: State Variable Filter LPF noise
Post by: MrStab on December 30, 2016, 10:29:34 PM
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.
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on December 30, 2016, 10:55:42 PM
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)!


Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on December 31, 2016, 12:00:53 AM
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).




Title: Re: State Variable Filter LPF noise
Post by: MrStab on December 31, 2016, 01:27:56 AM
thanks for the info. i'll try that combination, but unfortunately it'll have to be after new year. i might have a spare 5 minutes to try grounding the input when i get up later, though. FWIW, the noise isn't there when the connection between U3 & U1A is cut. as far as i can tell, the SVF itself keeps functioning as usual in either state.

here's something that may or may not matter: if a cap is used between one of the shelving outputs and the inverter stage, and it's too small, then it oscillates, too. that's going from memory so i can't remember if it's quite the same type of oscillation, or whether this was from U1B, U2B or both. i thought it was just the small size making the inverter unstable at the time, more an issue with the actual capacitance than the effects of the frequency.

the low band, using U2B into the inverter, is a-ok (i'm just naming the op-amps instead of filter names so i don't confuse myself with semantics because of all the inverse effects). lol
Title: Re: State Variable Filter LPF noise
Post by: MrStab on December 31, 2016, 01:47:37 AM
...also, the Frequency pot is microphonic, again just like what i'd expect when the Q is high in peaking mode.
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on December 31, 2016, 02:08:07 AM
Quotei'll try that combination, but unfortunately it'll have to be after new year.
From what you saying, especially your second paragraph, I'm thinking the problem isn't high freq type oscillation, which those mods address, but some sort of in-band oscillation which points to a fundamental problem.
i might have a spare 5 minutes to try grounding the input when i [/quote]
That is still worth trying.
QuoteFWIW, the noise isn't there when the connection between U3 & U1A is cut. as far as i can tell, the SVF itself keeps functioning as usual in either state.
OK, that at least makes sense.  (It might rule out some layout issues later on.)

Quotehere's something that may or may not matter: if a cap is used between one of the shelving outputs and the inverter stage, and it's too small, then it oscillates, too. that's going from memory so i can't remember if it's quite the same type of oscillation, or whether this was from U1B, U2B or both. i thought it was just the small size making the inverter unstable at the time, more an issue with the actual capacitance than the effects of the frequency.
I'll try to analyse this case.  If you have an specific examples of good and bad cap values it might be useful.  If you has a smallish cap + a second order high-pass filter your get a third order high-pass filter which has more phase shift.   Now my gut feeling is it should not be able to cause oscillation because the loop gain should be less than one - this is what I will check.

Thanks for the update/info.   It's a tricky problem.
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on December 31, 2016, 03:43:49 AM
Quotei'll try that combination, but unfortunately it'll have to be after new year.
Maybe give it a go.   I really do feel some parts like this are required.  At least the cap across R2 but the others may help.

My gut feeling is something isn't what we think it is.  A wrong part value or something.  Maybe around U1A or U3.  If the overall gain around the loop is higher than what we think it will show the symptoms we are seeing.   *but* if that  was the issue then I would expect cut to be worse than boost - which is not what you observe (grrrr.).

Title: Re: State Variable Filter LPF noise
Post by: MrStab on December 31, 2016, 08:33:38 AM
ok, i've figured out part of the problem. i should've been more meticulous, i must've tested without the CD4053 with a higher-gain resistor in place, and not dug deeper because the other channel worked fine. seems the Q was jammed within some margin by the 4053. no peaky sound anymore.

i thought wiring the Q pot lugs to Common instead of the other way around would avoid switch pops for some reason, in case you're picturing it the other way around. maybe the other way would be better.

still a lot of white noise, but i'm about to quickly try a cap across R7 to see what the status is now, with a lower Q. don't have any time for anything else, unfortunately.
Title: Re: State Variable Filter LPF noise
Post by: MrStab on December 31, 2016, 09:02:23 AM
no more oscillation with a 510p across R7! it's hard to compare noise levels with the peaking mode without the switch in place, but the signal now outweighs the hiss a lot more, and the BC pot is more responsive. still some bleed-through with Frequency turned high and BC in the middle, but maybe it'll play nicer with the other measures now. i'll retry some stuff when i next get the chance. shame the CMOS will have to be removed or reconfigured.

update: here's what i think happened so far: there's another, fixed R6. while i was probably able to lower the CMOS' high Off resistance by paralleling across it with the other R6 (i'll draw a diagram of this convoluted setup later), that one still kept it at 10k. so i'll try lowering that before abandoning the 4053.
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on December 31, 2016, 07:42:36 PM
Cool. It's pretty much done.

If you aren't happy with the noise you can add pre-emphasis/de-emphasis.
Look at the boss GE7 and the Korg parametric:
http://www.diystompboxes.com/pedals/schems/korgpeq1.gif

Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 02, 2017, 05:14:24 PM
happy new year!

i've found the how of the problem, but i'm a bit stumped as to why. that extra resistor was a minor oversight i would've probably remembered at some point, and the main issue is with the CMOS itself. this is how i'm switching the Q pot with the 4053:

(https://www.dropbox.com/s/vhy2wetdudh1llq/qsw.png?raw=1)

(just imagine there's another fixed resistor to Vref to replace R6 [R1 above] for shelving mode!)

i chose this way as i thought it'd minimise pop and prevent interference with the SVF, as opposed to making the op-amp side common. the perma-high-Q would suggest that U1B's non-inverting pin has a permanently-low path to Vref when Off. i can't find any material on why this might be happening - at best i can find leakage current on the datasheet, which is little help as it suggests the really-high resistance i'd expect, and as far as i can tell doesn't refer to the separation between outputs.

a CMOS switch is vastly preferred for space and reliability reasons. maybe i should wire em the other way around, and switching between the pot or a fixed resistance. unless there's some way i can make the current scheme workable.

i tried to incorporate some kind of emphasis-ish system at one point, but then i thought i should iron this out first. i've been looking at the CE-2/GE-7 schems. cheers though!

Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 02, 2017, 06:22:47 PM
....aaand it's now i realised i mixed up pin ordering slightly. my proof-checking skills are seriously awful, i went over it about 4 times. lol
Title: Re: State Variable Filter LPF noise
Post by: anotherjim on January 03, 2017, 05:06:09 AM
If the +in of the amp is really disconnected when the switch is off, then that connection is floating at a really very very high impedance and will pick up any radiant or leaked crap going. Inputs should have a tie resistor to Vref that's about x10 the source resistance when switched on, so it doesn't load the source or mess with pot range.
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 04, 2017, 03:36:20 PM
interesting you should mention that, Jim, as i was about to post about an issue i'm facing in that region (edit: not quite!):

there's a DC offset when the Boost/Cut pot is turned. when fully cut (U1A output side shorted), the DC at U1B+ is roughly 300mV lower than Vref, which approaches 4.5V as the pot is turned. At the centre there's a small click, and the whole other half of the pot (boost) is a firm 4.5V. this problem also seems to extend into the switching, creating a big pop when that pot is rolled back.

i've tried a few things, some of which might've been a bit unorthodox, but hey. coupling and biasing the inverter output (what would be C6 on the ESP diagram), and coupling between U1A's output and the BC pot. i've tried fixed resistors of 10-100k to Vref (on my OP diagram) before R1, R14 and a few other places. i can't list any more because i have no idea wtf my notes say. lol

i think this is the final hurdle, and would iron out 2 issues for a well-behaved pedal! i've run out of ideas, so any are welcome. i don't suppose R12 & R13 on the ESP diagram could be to blame? when the frequency pot is turned near the 16KHz limit, the pop goes away. i've run out of caps so can't really try right now.

cheers!
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 04, 2017, 04:39:13 PM
the switch never cuts signal to U1A+ completely btw, afaik the 4053 is break-before-make but generally in the Boost position, the switching is quiet

edit: coupling between B/C wiper and R4 makes no improvement either. i don't get it! the inverting input of U1B wiggles slightly, but nowhere near as bad as the non-inverting. so i assumed something attached to the + was to blame.
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 04, 2017, 07:39:44 PM
Quoteinteresting you should mention that, Jim, as i was about to post about an issue i'm facing in that region:
The other resistors (shown in your schematic) should prevent any issues here.
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 04, 2017, 08:28:54 PM
gah! i meant it's actually U1B as the op-amp with the offset. sorry about that. resistance to Vref on either input, and no resistance at all, makes no difference. i've edited the posts as needed, if it helps - i still reference U1A correctly where appropriate
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 04, 2017, 08:57:52 PM
Quotegah! i meant it's actually U1B as the op-amp with the offset. sorry about that. resistance to Vref on either input, and
From your original schematic both U1A and U1B have feedback resistors which provide a path for DC bias.  Which is fine.

All opamps have some form of DC offset which varies from unit to unit.   What can happen is if you have DC connections around the opamps (ie. no AC coupling caps)  then the DC gain that results in the circuit will multiply the opamp's DC offset and you will see this larger value at the output.   For U1B the DC gain is set by R6, R7, and R8 and ends-up at about 7.8.  If your opamp has a large offset, say 10mV, then you would see 78mV at the output.  I don't expect it to be that big; also I have ignored the effect of the other opamps.

This doesn't necessarily represent a "problem", it just is.  If the offset cause pot scratching and pops only then it become a problem.   This is when it might be wise to add caps in series with the resistors which set the DC gain.

If the offsets are larger than expected then that usually means a circuit problem or a damaged opamp.




Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 04, 2017, 09:30:00 PM
thanks for the info Rob, appreciated as always! i didn't even think to check the datasheet for inherent offset! thanks to your explanation (and past help) i'm starting to realise exactly why these things are going on. pot scratching is there (albeit slight), and while it might be cool to have an "aural centre-detent", i'd rather kill it. also it's likely tied into the parametric switch pop.

the TLC274 (SVF) seems to have 2-3mV offset at worst, and the TL072 (input stage & inverter) are slightly worse, at up to 10. neither on their own would seem to account for a whole 300mV, though.

U1A receives a pre-biased signal from the input stage, with C8 separating the amp from DC. U2A and U2B are basic integrators and i'm reading a more-solid 4.5V out of em. hmm... narrowing things down, at least.

interestingly, Spice suggests that a cap from BC wiper to R4 would kill the offset, but it doesn't seem to in reality. Spice makes the offset appear to be a matter of microvolts, though. i'm not taking it as gospel for any of this.

i'm still at a loss tbh, but i'll try to digest the info and see if i can come up with anything else.

cheers!
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 04, 2017, 09:41:07 PM
at this point i think it might be worth trying caps at the end of the Frequency pot - the ESP article does mention offset, albeit in BP mode, and the problem does have a relationship with the Freq pot. i'll score some caps tomorrow and give it a go.
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 04, 2017, 10:09:39 PM
Quoteat this point i think it might be worth trying caps at the end of the Frequency pot
It might help.  There is something a little tricky going here with amplifying offsets: 
If U2A has an offset then, via the feedback loop via R5, it will force U1B'a output up in order to match that offset.  The integrator cannot have an offset at the input otherwise it will keep accumulating of difference.  Without the feedback via R5 the integrator output would continue to rise or fall depending on the sign of the of the offset.
If you have the frequency pot down at the 33k end, the voltage at the top of the 500k frequency pot will be about (500+33)/33 = 16 times the offset of U2A.   With the frequency pot caps in then the multiplying factor is only 1.



Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 04, 2017, 11:08:27 PM
U2B's output doesn't seem to wiggle but i'll double-check when it's a sensible time of day. just to clear up one thing: do you mean R5 should prevent (or at least limit) the issue you describe with the integrator's offset? if caps on the Frequency pots don't help things, maybe there could be some benefit to placing a cap between R5 & U1B+?

i think looking at the relationship between U1B-U2 makes a lot of sense now, as i've pretty much tried everything with U1A.

cheers!
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 04, 2017, 11:39:37 PM
Quotejust to clear up one thing: do you mean R5 should prevent (or at least limit) the issue you describe with the integrator's offset?
No.  It's about *how* the circuit finds the final equilibrium state that you see.   Without R5 the circuit will go nuts (in that the integrators will continue ramping up to or down until they hit positive or negative saturation) as there is no means for the circuit to find set of DC conditions where an equilibrium is reached such that all the DC offsets are taken into account.   

It's like if you stand in the middle of your bed all the spring forces balance out and you reach a certain equilibrium height, if someone put an extra mass (an offset) on there, there is a new equilibrium height,  but if you stand in the middle of a pool there no upward spring force and you keep sinking.  (sorry think of a rock not a person as obviously you will float)

Quote
if caps on the Frequency pots don't help things, maybe there could be some benefit to placing a cap between R5 & U1B+?
The caps on the pots allows the DC to get through without multiplying it - that's a good as you can do.  If you brak the DC loop then it will go nuts.


Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 05, 2017, 11:58:55 AM
no improvement with 100uF caps connected to R12 and R13. it's getting kinda annoying now, maybe there's absolutely no way to fix it. FWIW noise increases in the Cut position. i think you might've mentioned something like that a while back, Rob. i'll re-read.
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 05, 2017, 01:09:29 PM
i've made a list of side-by-side voltages of the quad op-amp the SVF uses. screenshotted it so i didn't have to mess with tables.
(edited because i got the amp labels wrong. wish i'd saved the original spreadsheet file!! lol)

(https://www.dropbox.com/s/hnzawcs1z1aqsnv/svolt.png?raw=1)

U2B's output seems to be misbehaving. didn't notice that before. this is with a 1uF cap between BC wiper and R4, which seems to solve the U1B+ offset quite a lot.
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 05, 2017, 04:31:38 PM
i'll need to go over this again tomorrow, my head's in a mess. though i'm 90% sure the above is correct apart from pin 6, which goes down to about 4.4V in full Cut. i've been taking readings from either side of the board as some of the kludges i've put in through these experiments made it hard to access pins, which confused me more.

certain conclusions from today are that caps to ground from the Frequency pots don't fix the issue, and neither does a cap before R8 (which went against your similar advice with R5, Rob, but i thought i'd give it a go as it wasn't R5. lol)

*shrug* not a clue. i'm tempted to test it in BP mode to see if these conditions are normal but somehow don't play nice with the shelving outputs, but that'd take some re-soldering.
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 05, 2017, 05:06:43 PM
QuoteU2B's output seems to be misbehaving. didn't notice that before. this is with a 1uF cap between BC wiper and R4, which seems to solve the U1B+ offset quite a lot.

At this point the symptoms to me look  oscillation rather than DC issue.

Here some of the key points why:
- higher than expected DC shifts
- No success on frequency pot caps  =>  no change in DC offset
- Cap on R4   =>  no change in DC offset

Finally:
- DC offset changes on an AC coupled circuit ie. the boost/cut pot + cap =>  strong suspicion of oscillation.
- cut case is worse.

The reason cut is worse than boost is the cut configuration puts the SVF in a inside a loop containing U1A.  The boost config essentially connects the input of the SVF to the signal input, it's not in a loop as such.  Partial boosts are in a loop but the gain around the loop is lower which makes is less susceptible to oscillation.

The problem with oscillation is you can't always hear it as a tone.  It could be at frequencies anywhere in the 10kHz to 10MHz region.   What you do see is indirect symptoms like distortion, things heating-up, DC offsets, changes in behaviour with minor layout and pot settings.  A whole heap of stuff that doesn't make sense by looking at the schematic with "normal eyes".

If you have an oscilloscope you can see the oscillation.

So what to do?
I would be going back to putting small caps on things starting with a 100pF to 150pF cap across R2.

Once you get rid of the oscillation you will probably need to try the caps on the frequency pots again.

How the DC outputs settle is a little confusing.  I don't know if this helps but I'll try to show the interactions:  In order that integrator U2B doesn't ramp U2A must provide an offset to match U2B.  The output of U2A then adds to the offset at U1B.  In order that U2A doesn't ramp U1B must provide an offset to match U2B.  Now the only way it can do this is via the output of U2B.  So U2B ends-up taking up the slack and must provide the final DC offset that keeps everyone happy.  Because of the divider formed by R8 and R6 the offset at U2B needs to be high in order that the output of the divider can provide the small corrective offset.  Without a cap in series with R4 the offset from U2B might need to be more.

Anyway if it's oscillating the DC conditions might struggle to find an equilibrium and you see the large offsets you are seeing now.





Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 05, 2017, 08:59:48 PM
wrote out a whole reply but it got buried in tabs and i closed the browser. damnit. apologies if this reply is less detailed.

i put 120pF caps in parallel with R2, R7, R8 and R15, individually and altogether. no luck. i could try higher caps once i find them!! i have a small margin until i hit the audible range.

your description of the DC changes going on, compared with my readings, has led me to this idea - not in the oscillation ballpark afaik, but nonetheless: from what i've read on integrators, a high-value resistor can be used to stabilise the DC while being large enough to avoid affecting the RC network's response (if i got that right-ish?). maybe worth a shot? seems the resistors would have to be pretty high to get the same gain from the SVF, though. unless maybe R16 could compensate. i know it's not in the oscillation ballpark, but just not to rule anything out.

cheers!
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 05, 2017, 10:02:55 PM
Quotewrote out a whole reply but it got buried in tabs and i closed the browser. damnit. apologies if this reply is less detailed.
Don't worry it's happened to me too, always on long posts, and usually followed by expletives.

Quotei put 120pF caps in parallel with R2, R7, R8 and R15, individually and altogether. no luck. i could try higher caps once i find them!! i have a small margin until i hit the audible range.
I'm extremely surprised one of those combinations didn't fix it.  It's also a bit weird to have a such fine margin before you actually hear it oscillating. It's not normal!  For things like this circuit once you have couple of stabilizing caps in there (even remotely in the ball-park) it's usually pretty tough.  BTW: I was assuming you had a largish cap across R7.   

Quote
your description of the DC changes going on, compared with my readings, has led me to this idea - not in the oscillation ballpark afaik, but nonetheless: from what i've read on integrators, a high-value resistor can be used to stabilise the DC while being large enough to avoid affecting the RC network's response (if i got that right-ish?). maybe worth a shot? seems the resistors would have to be pretty high to get the same gain from the SVF, though. unless maybe R16 could compensate. i know it's not in the oscillation ballpark, but just not to rule anything out.
You can try it but I'm not expecting that to fix it, well not because of the DC aspect.  Yes they will be quite large resistors.   I've build quite a few SVF's and never had to do that.  There's a circuit called the Tow -Thomas biquad, a filter similar to the SVF, which adds a resistors.  IIRC it does this in order to tune some aspect of the performance.  Using your simulator, check out the frequency response before and after the mods.   Err on the lowest resistor value you can get away with as that will help the DC issue.   The caps on the frequency pots should help more.

One thing you can try is to lift the ground side of the frequency pots completely.  This way the pots are in series with R9 and R10.   This is a perfectly valid alternative connection for frequency pots and the SFV.  It has the advantage of reducing DC issues to a minimum.

Swapping out the opamp might shed some light on things as well.

Other things to try would be bypass caps on the power rails:  100nF, 10uF, 100uF.


Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 05, 2017, 11:15:26 PM
ah - i meant the audible spectrum that i'd rather not cut, not the oscillation. R7 was the one that caused oscillation with a cap across it, but doesn't seem to be oscillating with 120pF this time as the Q's set fairly low. R6 is currently a 20k hooked up to U1B's + input (i wonder if switching that round and still having the issue is some clue.

is that also called a "Fleischer-Tow Biquad"? Google suggested it for Thomas-Tow and it came up with more results. cheers for that info, i'll read up properly on it soon. at the very least it could teach me more about the effects of a cap on U1B and a resistor on U2B. did they have a falling-out with Thomas?

say it isn't oscillation - is it at all a known thing for some kind of noise when DC bias on op-amp inputs reaches equilibrium?

Spice alleges the resistors shouldn't affect corner frequency, with 100k bringing down the 15dB maximum gain to about half that (including the BP stage, had to check both modes would work). the frequency response stays the same, as far as i can tell. i'll give it a go tomorrow before i have to leave for the weekend and report back. i have a feeling the trade-off there would be Johnson noise in those feedback loops vs. amplifying the noise floor with R16.

cheers again!
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 05, 2017, 11:23:20 PM
sorry missed the last few things you said. 100nF bypass caps on the power rails didn't help unfortunately. i'll try lifting the end of the Frequency pots if the integrator resistors don't help. i've tried 4558s and TL072s in the inverter positions, and TL074 and TLC274 for  U1 & U2
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 05, 2017, 11:40:37 PM
Quoteis that also called a "Fleischer-Tow Biquad"? Google suggested it for Thomas-Tow and it came up with more results. cheers for that info, i'll read up properly on it soon. at the very least it could teach me more about the effects of a cap on U1B and a resistor on U2B. did they have a falling-out with Thomas?
You should find it with "Thomas-Tow"
https://www.ece.uic.edu/~vahe/spring2012/ece412/biquad.pdf

Fleischer is another famous filter dude. 
http://convexoptimization.com/TOOLS/FleischerTow.pdf

FYI: look at the refs at bottom of the first page of the first link.  It predates the second link.  Second link is a more general form and has design equations.

You are probably better just tweaking your integrators.

QuoteR7 was the one that caused oscillation with a cap across it, but doesn't seem to be oscillating with 120pF this
time as the Q's set fairly low
Without a CRO it's hard to know.

Quote- is it at all a known thing for some kind of noise when DC bias on op-amp inputs reaches equilibrium?
Once you know the opamp offsets it is a know thing.  Opamp offsets a like transistor gains they vary from unit to unit.
If the opamps have no offset everything should settle at 0V.   If you want to play with your simulator just add a DC voltage source (maybe 10mV) in series with the opamp + input.  Do it one at a time.  Look at how the DC levels change from 0V. The voltages see doing that will be indicative of what you see in the real circuit.    You can also see the effect of adding caps on the freq. pots etc.   If the simulator complains add a 100MEG resistor in parallel with the voltage source, or to ground.

QuoteSpice alleges the resistors shouldn't affect corner frequency, with 100k bringing down the 15dB maximum gain to about half that (including the BP stage, had to check both modes would work). the frequency response stays the same, as far as i can tell. i'll give it a go tomorrow before i have to leave for the weekend and report back. i have a feeling the trade-off there would be Johnson noise in those feedback loops vs. amplifying the noise floor with R16.
Try to find a point which looks pretty much the same.   You will find the added resistors shouldn't effect the noise much. 

Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 05, 2017, 11:41:44 PM
Quote
sorry missed the last few things you said. 100nF bypass caps on the power rails didn't help unfortunately. i'll try lifting the end of the Frequency pots if the integrator resistors don't help. i've tried 4558s and TL072s in the inverter positions, and TL074 and TLC274 for  U1 & U2
Hmmm, the options are thinning out a bit!
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 06, 2017, 11:54:17 AM
Thanks for the links and for clearing that up. On a train right now but will give them a try later. Those sim tips should help better than the idealised situation I have at the moment.

The integrator resistors idea didn't remove the centre click at 500k or 100k across both U2A and B. Using the frequency pot as variable resistors didn't help either. I also tried a 1uF cap between U1A output and BC pot for fun, nothing.

If it's inevitable i can live with it as audio-wise it works quite well, but the switch pop caused by it needs addressing. Can you delay CMOS switch turn-on time with 2 resistors and a cap...?

Sent from my Vodafone Smart ultra 6 using Tapatalk

Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 06, 2017, 06:20:38 PM
Quotethere's a DC offset when the Boost/Cut pot is turned. when fully cut (U1A output side shorted), the DC at U1B+ is roughly 300mV lower than Vref, which approaches 4.5V as the pot is turned. At the centre there's a small click, and the whole other half of the pot (boost) is a firm 4.5V. this problem also seems to extend into the switching, creating a big pop when that pot is rolled back.

I've been pondering thinking what could be wrong.    When I see that I can't help but think oscillation.

QuoteIf it's inevitable i can live with it as audio-wise it works quite well, but the switch pop caused by it needs addressing. Can you delay CMOS switch turn-on time with 2 resistors and a cap...?
You should need t delay it.
In order to prevent switch pop you normally have to ensure the DC conditions before and after do not change.  A bit like the 1M resistor at the input of an effect.  I can't suggest a changes as I'm not 100% sure how the switching is done.  When I look back at your switch connections (in the post with "Happy new year" in the top).  So I'm not sure how R1 in that schematic and R6 in your original schematic are equivalent.   Also one of the switch configurations leaves R1 floating.

One thing to realize is you might be able to  leave RV connected across +in and -in of the opamp then connect R1 (R6) to ground, and disconnect R2 from ground.   This greatly simplifies the switching and the change in DC condition issue.  Further you could add caps in series with R2 and R1 and put say 2.2M across each of those switches in order that the DC voltage across the caps doesn't change.   To me this would be a normal way to ensure pop-free switching.

A couple of other things I realized is when the pot is disconnected from  +in and -in of the opamp  it has a minor effect on the conditions that cause oscillation.    So leaving RV connected in both might help change the way it is oscillating , possibly for the better.

Regarding detecting oscillation you might be able to build something like this:
http://s1232.photobucket.com/user/mikeyb3649/media/DVA.png.html
Use say C= 100nF, D = 1N4148 or 1N914.  You might try adding 100ohm in series with the diode as well.

You connect it to the output of each opamp.   You would expect to see Vref-Vdiode.  But if oscillation is there it is likely you will see a *higher voltage* than this a it grabs the peaks.   It's not 100% guaranteed as some oscillation is low level and hard to see with this simple set-up.    It's especially useful to do this fr the cases where pots change the behaviour.

Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 07, 2017, 12:11:18 PM
Dropbox has disabled my original schem, here it is: https://www.dropbox.com/s/41nzj1aic5yyg0n/svfhinoize.png?dl=0 (https://www.dropbox.com/s/41nzj1aic5yyg0n/svfhinoize.png?dl=0)

i've had the 4053 work well mid-circuit without being coupled & rebiased, so long as the biases are close, so i figured i could save space here too. as far as i can tell it's just a tiny, harmless click when the offset isn't "engaged".

basically, R1 in the switching schematic is the "real" R6 in the original. with the switch bypassing the Q pot, R6 was rendered useless, so i decided to bypass it with a fixed resistor in "shelf mode" for testing purposes. it later turned out i'd got the poles wrong on the + side of the op-amp, meaning the resistance to Vref was jammed at the >150R On resistance. so i've bypassed that, too. clearly i'll need to rework the switching a bit, just thought i'd try to figure out the other issue first. although...

that switching alternative you suggested is genius! that's the first thing i'm trying when i get back on Monday. a DPDT was as high as as i was willing to go for the physical switch, so this could save me the CMOS altogether. i'll sim it before then if i have the time. simplification + stability benefit = win. it'd mean my maximum Q setting for peaking mode is the same as that in shelving mode but that's fine.

in a past version i remember lowering R16 made a lot of difference in lowering the BC click effect, but it took far too much reduction in gain to do so. i didn't take much notes around the time, though. i'll give that region a bit more thought. at the time i was testing & debugging other stuff so didn't really take notes.

thanks a lot! i have a good feeling about that new switching approach. i'll move onto oscillation-hunting beyond that.
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 07, 2017, 12:34:06 PM
...and i wonder what effect that fixed 10k across U1B's inputs would have generally...
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 07, 2017, 05:58:15 PM
Quoteit'd mean my maximum Q setting for peaking mode is the same as that in shelving mode but that's fine.
.
I suspect I've missed something if that's the case.  We should aim at keeping all the features. When I look at your switching circuit above one of cases connects both sides of the pot to Vref, effectively disabling it.   
Is that how it is?

Quote
in a past version i remember lowering R16 made a lot of difference in lowering the BC click effect, but it took far too much reduction in gain to do so. i didn't take much notes around the time, though. i'll give that region a bit more thought. at the time i was testing & debugging other stuff so didn't really take notes.
Hmmm, R16 affects the loop-gain and cause a marginally stable circuit to oscillate or not.   There's many symptoms that look like oscillation to me.  That doesn't mean it is but I have trouble reasoning out all the behaviours due to other causes.

Quote...and i wonder what effect that fixed 10k across U1B's inputs would have generally...
There's no primary effects but there's quite a few secondary effects.  For example it could increase the DC offset a small amount but it is better to have a fixed DC offset than one that varies with the circuit configuration (as that is the cause of the pops).    It can also increase noise.  It can affect stability, usually for the better.    I should emphasized these effects are normally very small.    It's not until you put 10 or 30 pots in parallel on a graphic equalizer before you start to worry.   It is one of those things where the benefits are great and the detrimental effects are small.
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 09, 2017, 04:12:58 PM
that's pretty much how the switching is done, Rob. both outer lugs of the Q pot are at the Common of one SPDT each. for now, i've completely removed the CMOS again. so i can re-confirm the problem's definitely there without it. so right now it's wired as per the OP.

probably not much help, but i made a quick phone recording of me turning the BC pot. it's a bit on the quiet side. every click you'll hear is the centre point being passed. https://www.dropbox.com/s/m174uang78o1by4/clicky.m4a?dl=0 (https://www.dropbox.com/s/m174uang78o1by4/clicky.m4a?dl=0)
as you can hear, it's not that intrusive, but might concern some people.

i just tried completely surrounding each BC lug with caps and rebiasing as necessary, no change. though at one point the click disappeared but the circuit oscillated and distorted at the far ends of the pot. i think that was with caps on all lugs, but before i'd remembered to re-bias the wiper afterwards (100k to Vref before R4). i wonder if that's a clue... you can't really hear it on the recording, but there's that characteristic "DC on pot" scratch going on just before the centre. so i figured i'd try a blanket-cap approach.

i've only been home for a few hours so i'll do some more thinking later. if putting all focus on the inverter as the culprit makes no difference, i may move on and try to silence the switching.
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 09, 2017, 06:03:39 PM
progress! i think!

i tried changing R15 to ~2k for a ridiculous gain of -0.1 AND lowering R6 to 1k to compensate for the loss (now back on the inverting input of U1B). the click is gone. ofc, this restricts control over the Q, but it still does the job. i wonder if R16 could be changed instead.

all this is with the coupling around the BC pot, so i'll need to roll all that back before i can confirm this is the fix. if it is, wouldn't that 10:1 attenuation be really bad for noise? it's too late to test that tbh.
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 09, 2017, 06:41:04 PM
Quoteprobably not much help, but i made a quick phone recording of me turning the BC pot

Thanks for that.  It's *very* pronounced,  to the point where I was thinking it might be a faulty pot.  Then I read your second post and now I'm thinking oscillation.

Quotei just tried completely surrounding each BC lug with caps and rebiasing as necessary, no change. though at one point the click disappeared but the circuit oscillated and distorted at the far ends of the pot. i think that was with caps on all lugs,
The fact you have removed all DC paths and there is still an issue pretty much writes-off any DC causes.  The other suspicious symptom is you changed DC related components and got oscillation.  To me that just the circuit is riding close to the cusp of oscillation so small changes just push it over the edge.  FYI: The circuit doesn't need to have the Vref connection before R4 because the opamp +input pin gets DC via R5.

Quoteprogress! i think!

i tried changing R15 to ~2k for a ridiculous gain of -0.1 AND lowering R6 to 1k to compensate for the loss (now back on the inverting input of U1B). the click is gone. ofc, this restricts control over the Q, but it still does the job. i wonder if R16 could be changed instead.

Yes, definitely progress.    When you reduce the gain via R5 it reduces the entire gain around the loop of
U3 ->  U1 -> BC pot -> SVF (back to U3).    The gain around the loop is what causes oscillation.  If you reduce the gain at one point in the loop then push is back-up an another point, then, to first order you, are back to where you started.   When you compensate with R6 it widens the bandwidth (Is what how you see it?) but from what I can see doesn't change the gain.  [Edit: sorry I was thinking band-pass, R6 affects the HPF and LPF gains - I need to think about this.] If you compensate with R16, the gain around the loop increased again and, in theory, you are back where you were.  If R15 + R16 did fix the issue it would be a very marginal fix.

What your test has revealed is we are within a factor of around two in gain between good and bad (ie. the amount you reduced the gain).   I'm fairly convinced we are dealing with oscillation.  One idea is: split R15 into a series combination of 2k + 2.7k.   Then bridge-out the 2.7k with a cap.    You will need to find the smallest cap value that works, then give your self some safety mark by using a bigger cap.   After that evaluate if the audio is affected/filtered.   The idea is that at high frequencies, where the oscillation is,  it looks like the 2k that works but at low frequencies, where the audio is, it is like 4.7k (ie. no change to your original design).

When you changed R15 to 2k, was the circuit free from oscillation with R6 = 3.3k?

Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 09, 2017, 06:43:13 PM
BTW, I realized your C7 is around the wrong way.
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 09, 2017, 08:07:54 PM
okay, i think i get what you're going for with the R5 thing. i'll give that a go tomorrow.

with inverter gain lowered, am i right in thinking that a lowered R6 is limiting the problem at-source, whereas compensating with R16 is bad because it puts us right on the edge again? having a super-tight slope isn't essential so long as it's useful. a guess as to why only shelving mode shows this behaviour is because of the abundance of frequency content beyond the cut-off point, like how too many lows cause strong oscillation in a phaser feedback loop.

i've tried as high as 10k for R6 with the inverter gain lowered, and that's click-free, too.

with the amount of ugly spaghetti i have to roll back, there's a chance i might completely break the circuit a few times before i try anything new, but hopefully not.

cheers, Rob!
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 09, 2017, 08:21:01 PM
C7's orientation error is in the original diagram. i'm surprised how often it comes up on this forum but no-one seems to have noticed till now!
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 09, 2017, 09:46:41 PM
Quoteokay, i think i get what you're going for with the R5 thing. i'll give that a go tomorrow.

Quote
with inverter gain lowered, am i right in thinking that a lowered R6 is limiting the problem at-source, whereas compensating with R16 is bad because it puts us right on the edge again?
Sometimes you do the you do get that local fix effect.   For this case (lower inverter gain and smaller R6) it seems the reason is quite subtle and is related to the whole loop (U3 ->  U1 -> BC pot -> SVF).   The puzzle is why no oscillation when the the gain is restored by R6.    From what I can see reducing R6 works because it reduces the phase-shift in the whole loop.  While this effect works without the cap across R7 but having the cap there seems to put the reduced phase shift in the right band of frequencies.  Just to make things harder to understand the bandwidth of U1B is helping.   I'd like to give you a nice clear explanation and point the finger but there's too many interacting things going on.
My explanation above is wrong - to be revised.  I don't know at this point!

Quote
i've tried as high as 10k for R6 with the inverter gain lowered, and that's click-free, too
That's a good indication things have settled.   Once the gain around the loop is reduced it's not uncommon for oscillation to be disappear.

If it helps your wiring at all.  Rather than split R15 into two series it is possible to put a series C + R network across R15.   This is *absolutely identical* in function it just requires a different cap value; which we don't know yet anyway.   At low frequencies we want the resistance to be 4.7k as it was before, so that means just leaving the existing 4.7k in place.  At high frequencies we want 2.0k  so  we make R = 3.5k  so R in parallel with 4.7k equals the target 2k (C shorts out and puts R=3.5k in parallel with the 4.7k to give 2.0k).  I'd use a lower value of R say 3.3k to start maybe caps around 100pF to 500pF.

Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 09, 2017, 11:09:49 PM
i know i shouldn't be thinking in such crude visual terms, but i can't help think about the "dip" in Spice i mentioned way back. maybe it's a clue. it's not anywhere near as prominent direct from the SVF outputs, nor the inverter, but seems to be an artefact of the diffamp process. with R6 at 20k and R15 at 4k7, above is the output from U1A in full Boost and below is the output of U1B:

(https://www.dropbox.com/s/49i80qckcbfnlcn/bumpcompare.png?raw=1)

maybe i'm talking crap but it's been vaguely poking the back of my brain as a potential issue for a while now. i can't put my finger on why, though - i need to sit down & visualise the subtraction going on.

you said i should try splitting R5 before, then mentioned R7 - did you mean one or the other or should i try both? i might hold out for a while in case another revelation comes up, as this is still a new development. i have to rehearse for a gig most of tomorrow so i can give it some thought (...while i should be remembering the next verse).

cheers!
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 10, 2017, 12:04:25 AM
Quoteyou said i should try splitting R5 before, then mentioned R7 -
Sorry about that.   I'm not switched-on today at all - it's like the drink driving version of posting - it's dangerous!

For the split resistor I meant R15 (I at least got that right).  I'll try to clean-up the other posts.





Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 10, 2017, 12:25:03 AM
no problem, at least it's not the post-drinking version of driving! :D

R15 is a lot easier to access than resistors in the SVF section, i'll get on it asap.
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 11, 2017, 10:41:34 PM
success! i hope!

i adjusted all the values somewhat - R6 and R15 are currently 10k, which should provide roughly +/-15dB gain from U1A. in parallel with R15 is a 4k7 resistor followed by a 2n2 cap. through the noisy POS USB interface i use to mess around at night, there's no centre-click!

naturally i want to double-check this tomorrow, through an actual guitar amp, but for now it seems to have done the job. that gives a roll-off of about 15.4KHz, so if it is cured then i'll try lowering the cap a bit.

i didn't realise that the resistors in this configuration should be considered paralleled for the high-frequency gain btw, now i know. makes more sense. the actual corner frequency calculation would just be 4k7 though, right?

thanks a ton for your help, Rob! i'll let you know if it does definitely work. in addition to a decent show, this has been a good end to a day that began with our bassist telling us he was violently ill at the last minute. lol
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 12, 2017, 11:43:22 AM
confirmed! no more noise through a loud amp! i've yet to return the Frequency pots to voltage dividers, but i'm pretty confident. i changed the cap to 1n5 for a 22.6KHz roll-off, still no click. so definitely ultrasonic. can't thank you enough, Rob!
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 13, 2017, 07:03:47 PM
Quoteconfirmed! no more noise through a loud amp! i've yet to return the Frequency pots to voltage dividers, but i'm pretty confident. i changed the cap to 1n5 for a 22.6KHz roll-off, still no click. so definitely ultrasonic. can't thank you enough, Rob!

No problem at all - that's really great news!
It's been quite a tricky one, I get the idea, but when I look at the details it shouldn't have been so hard!
It was getting to the point where I nearly bread-boarded it myself.

(BTW - glad you sorted it out.   I've been afraid of posting more junk as I haven't sept so well over last few days.)


Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 16, 2017, 02:46:40 PM
still working fine, apart from some noise. i can't figure out if it's just the nature of the SVF beast at this range (1-16KHz) or related to the inverter problem. i still have some articles to get through re. general noise reduction, but i'm curious about any possible correlation.

it's only a potential problem when the highs are boosted, which is what you'd expect, really. minor hiss is audible when BC is flat - there is some minor bleed (noise) with this band in BP mode as well, which leads me to think it's probably not the shelving circuitry. no unwanted noise coming out of other bands.

i've read this is one of the rare instances in Pedal Land where op-amp choice matters a lot. the TLC274 datasheet says 25 nV/√Hz @ 1k, so i may try TLC2274 which is about 9, iirc. they're not too cheap, though, so i'm not betting my bottom dollar on that being the problem just yet. (edit: just realised i have some 2274s, no major improvement)

reducing R7 & R8 to about 6k does help, i can't tell what helped more, though: the fact i lowered the gain, or that i lowered the impedance. i might try again later in a different room with a different amp, but my past experience suggests that's not the problem (just a router and PC in here, a good coupla metres away).
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 16, 2017, 06:06:07 PM
Quotereducing R7 & R8 to about 6k does help, i can't tell what helped more, though: the fact i lowered the gain, or that i lowered the impedance. i might try again later in a different room
Without changing the amount of gain and Q' etc.  I suspect you won't be able get far.   If you have high resistances it is often a source of noise.   I'd be looking at the integrators, as there are largish 500k pots.  The rest of the circuit doesn't look too bad in terms of scaling.

If you imagine scaling the *all* resistors and caps around the integrators (ie. 33k, 12k, 500k and 1n)  by a certain factor  then the circuit should behave the same from a frequency response perspective.   By making the resistance smaller and the caps bigger you decrease the noise.  Once you decrease the noise from the resistors below a certain point then the opamp noise starts to dominate again and so to improvement further you have to find a new opamp and possibly reduce the resistors further.  In some circuits changing from bipolar inputs to cmos input opamps helps as the input noise *current* no longer contributes noise.

The problem with this stuff is you have to analyse the fine details of the circuit and weigh-up where the main noise contributions come from.   If you change *all* the opamps often this helps because in a circuit with many opamps the noise all adds up.  However if one part of the circuit is causing trouble then you might be able to get just as much noise reduction by scaling down that one area and leaving the opamps (or do both).

One way to find out if the integrators are noisy is to set-up the frequency pots to the 33k end, listen to the noise.   Now change the integrator caps from 1n to 10n and set the frequency pots so the wiper is at about 100k from the top (opamp end) and listen to the noise again.   The aim here is both configurations produce the same frequency - maybe check by ear.  It's not a precise test but it might give you an idea.  - I did a quick check in spice and it seems like you should get more than 9dB noise reduction from the integrator which you should be able to hear.    (I only looked at the integrator not the whole circuit.)   So to some degree this does show the integrator scaling is potential problem area.

Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 16, 2017, 06:20:44 PM
*kicks self* the noise is greatest with the full 500k in the signal path. given what i've tried, i think it's quite likely to be that. i used to make these pedals (BP only) with 100k pots without issue, but settled on sourcing C500k so i could use em in wider-range, single-band pedals too. the problem didn't make itself anywhere near as obvious in BP mode either, so i thought the CMOS op-amps had let me get away with such a high value. wish i hadn't just bought a bunch of C500k's. lol

i don't actually know a good source of dual C100k pots. i'm well & truly done with AliExpress - i had a good deal going for a while, but then i got stuck with some really poor-quality ones. i know linear pots are recommended for their tracking, but every reverse-log unit i've built has been more than accurate enough for guitar use.

i'll try to aim for the same frequency with different R/C conditions as you suggest and let you know how it goes.

cheers!
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 16, 2017, 08:22:24 PM
Quotei don't actually know a good source of dual C100k pots
The 100k's would help.

Keeping the frequency range to a minimum is good also.  Too much range makes the pot hard to set consistently.  I like 10:1 you can go maybe 20:1.

Interestingly the connection of the frequency pots to ground (via the 33k') appears to be quite detrimental to noise!
If you just lift the 33k's the reduction in noise when the frequency pot is at the 33k end is substantial (> 4dB). At the other pot extreme it has not effect.  The frequency range is reduced by about 1.36.   If you want to reclaim the frequency range use the 500k pot but reduce the 12k's to say 10k and up the cap to 1.2n (33k's obviously evicted).
----------
Edit:
----------
Here's the result of various configurations of 100k pot, 500kpot, pot gnd lifted, pot to ground via resistor.
The other parts around the integrator were scaled to have the same min and max frequency.
(To compare apples to apples I used exact scaling of the other parts resulting in weird part values.)

Values are relative (A-weighted) noise of one integrator and frequency pot set to the lowest frequency.

Opamp FET input 25nV/rtHz.

500k "to gnd"  (as is)          0dB
100k "to gnd"                      -3dB
500k lifted                          -6.0dB
100k lifted                          -9.1dB

Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 16, 2017, 10:43:16 PM
just saw your latest post as i was about to post this one, definitely wasn't expecting those 33ks to play that big a role! as it happens, i changed those (see below). thanks a lot for the noise readings, gives me a better picture of why the below might've helped:

--

ok, so i reduced the pot to 100k, reduced R12/R13 to 6k2 to roughly compensate (too low?), R9/R10 to 1k and C2/C3 to 10n. i also lowered R7 and R8 again (i'd returned them to 20k), and through this combination of changes, i think i have noise at a minimum.

it's barely audible when the BC pot is flat. at full Boost, it's there, but reduced. that's 15dB on top of a full-spectrum pre-gain stage of 10dB (switchable to unity), so i think it's the best i can reasonably ask for. some hiss is pretty much inevitable in that situation, right? i'm testing straight into the FX return of a 100W combo with one 12" speaker. i'll try and get a quick recording of guitar signal vs. noise later, not the most scientific data but should give a reasonable idea.

performing these tweaks on the preceding bands could also help. actually, here's a question: i put the "High" band last in this build as i thought maybe it'd avoid having unwanted highs worsened by two subsequent (lower-frequency) stages, but now i'm thinking it's the opposite, ie. the final High stage will worsen noise accumulated by the bands before it. so would it be better for noise performance to have the High band first or last? having it first (which would put it on the bottom, visually) could make the interface a bit confusing as EQs with their pots stacked vertically usually have the highs nearest the top, like on mixing desks. but ofc that's not priority!

FWIW i chose to lower R7 & R8 in particular as i figured the method of boost/cut in this circuit allowed for some attenuation in the SVF section. there doesn't seem to be a gain penalty from U1A's output and both HPF & LPF are reduced equally.

thanks again!
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 16, 2017, 10:47:15 PM
is that effect of the ground resistors proportional or fixed? ie. will having reduced them by the same factor as the pots negate any improvement?
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 17, 2017, 12:00:47 AM
Quoteok, so i reduced the pot to 100k, reduced R12/R13 to 6k2 to roughly compensate (too low?), R9/R10 to 1k and C2/C3 to 10n. i also lowered R7 and R8 again (i'd returned them to 20k), and through this combination of changes, i think i have noise at a minimum.
6.2k is correct.  For that mod I would have scaled equally by 5 ie use R9 & R10 = 12k/5 = 2k4 and C = 5*1n = 5nF.    They keeps everything the same.  I'll have to check what happens with the 1k's.  It will make the frequency range wider.

2nd post
Quotes that effect of the ground resistors proportional or fixed? ie. will having reduced them by the same factor as the pots negate any improvement?
Basically having them in there makes the noise worse.   I'd have a very strong motivation to remove them as the circuit works fine without them and they don't add any "goodness".  It's kind of like putting a divider before an opamp then up-ing the opamp gain to compensate.  The noise source is just before the opamp gain-stage so it gets amplified.  The larger you make the ground resistors relative to the pot resistance the more it looks like the circuit they doesn't have them at all (imagine making them 100MEG).

Quotebut now i'm thinking it's the opposite, ie. the final High stage will worsen noise accumulated by the bands before it. so would it be better for noise performance to have the High band first or last?
Yes!  It is best to put the HF stages early in the chain.   If you have a accumulation of  noise sources before a HF boost the HF boosts the accumulated noise and the signal. If you put the HF boost before a noisy block of circuit you are effectively making the input signal stronger but not the noise, so the signal to noise is better.  (That's how pre-emphasis/de-emphasis works.)

QuoteFWIW i chose to lower R7 & R8 in particular as i figured the method of boost/cut in this circuit allowed for some attenuation in the SVF section. there doesn't seem to be a gain penalty from U1A's output and both HPF & LPF are reduced equally.
I'd have to check the details. Generally if you reduce the amount of boost you perceived noise will be lower and to some degree it doesn't matter how you do it.  If the gain ends-up being the same I'd expect the overall result to be close.

I probably should have tried sticking the modified integrators in the real circuit.  I didn't have time to do it.  There's many combinations of no pot ground lift/pot ground lift, 500k/100k, 25nV opamp/9nV opamps to get find where the true sources are.  A quick check showed the improvements for the whole circuit are nowhere as good as for a integrator (I expected this).

Here's the three mods:
- lift ground of pot  (reduce noise by -2dB)
- change to 100k pot (reduce noise by -1dB)
- change opamps from 25nV/rtHz to 9nV/rtHz  (reduce noise by -3dB)
Unfortunately it is difficult to assign an independent noise decrease to each one.   On it's own one effect might be weak as it is not the dominant noise noise, but if you take the dominant noise source away then it will have stronger effect on the smaller remainder.   For example if I do the first two mods and the opamp noise last, the step in noise is more like -5dB.   It's a game of nudging the noise down.

The total of the opamps appears to be dominant.  Lifting the pot is next,  but the large improvement is only at the low frequency pot setting.  Then finally the 100k change.   Nonetheless, any combination of these mods is worthwhile.

The following are equivalent:
Original:      500k pot, 33k to gnd, 12k to opamp, 1nF
Ground lift:  500k pot, no connection to ground, 8.79k to opamp, 1.37nF
For the 100k mod in either case divide all these resistors by 5 and multiply all caps by 5.
After that pick the closest standard value.


Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 17, 2017, 01:05:24 AM
just tried lifting the ground resistors and no major improvement. as you say though, it's a combination of things, so maybe i've reduced it to the point that the extra -2dB wouldn't be very noticeable. currently the setup is: rheostat, a TLC2274 with 9nV/rtHz, 100k pot and 1k/10n RC network, and R7/R8 reduction. so those mods besides the ground-res-lifting must've been the biggies.

much food for thought about the Frequency pot arrangement on this thread, actually. the only advantage i can think of to the voltage divider configuration is that it's easier to fine-tune the low end of the frequency range, but i can see that a 10k pot would give me almost the same low end (~1.44KHz).

i've been trying noise sims in Spice btw, but got a bit overwhelmed when i wasn't sure where the problem even was. or if i was using that function properly. your data is much more helpful than what i managed.

after typing all that, i realised the inverter's passband gain was at -0.5 to allow +/-15dB with the original values, but the R7/R8 reduction needed compensating for, so i restored it to -1 (ie. both R14/R15 are now 20k). the noise is louder, but still improved.  i'll mess around and see what balance of R7/R8 vs. R15 makes the least noise, actually. probably negligible.

i have the luxury of being able to have the shelving gain differ from that of the peak, so maybe i could leave it at 12dB or so, but i'd need to see how much that limits usability. i did manage to get some tones that measured on the Richter Scale earlier with a hard 12dB cut earlier. all the times i told bassists not to use guitar amps have been invalidated.

i'll try this band in isolation when it's sane o'clock just to see what the situation is, and whether i should keep tweaking before i move it to the front. i'll get that recording, too.

cheers, Rob!
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 17, 2017, 12:40:59 PM
i took a quick phone recording with the High band isolated (just a unity-gain buffer on the input), R7/R8 at "stock" 20k and the inverter at -0.5 gain. naturally the crappy phone mic distorts and kills lows, and there might be the odd noise like the board moving about slightly, but it should give a basic idea:

https://www.dropbox.com/s/z8sqiocwkfai70e/svfnoise3.mp3?dl=0 (https://www.dropbox.com/s/z8sqiocwkfai70e/svfnoise3.mp3?dl=0)

and just for good measure, here's one with the High band in its original position, with 3.2 gain and two flat SVF stages before it:

https://www.dropbox.com/s/eu52fzpvccsb1mz/svfnoise2.mp3?dl=0 (https://www.dropbox.com/s/eu52fzpvccsb1mz/svfnoise2.mp3?dl=0)

different balances of R7/R8 vs. R15 result in the same level of noise, so not really relevant. do you think the hiss is inevitable at this point? i could maybe try tweaking the anti-oscillation RC network in the inverter's Fb loop, i haven't touched that since the "centre click" problem was solved, but i can only see that eating into the wanted spectrum. i can't really think of any conditions i can change with my test equipment or environment, other rooms and a Marshall DSL100 have the same result. still testing with a battery.
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 17, 2017, 06:07:01 PM
Quotejust tried lifting the ground resistors and no major improvement.
With your current mods the incremental improvement might only be 1dB (and only when the freq. pot is at the lower frequency end.)

Quotei've been trying noise sims in Spice btw, but got a bit overwhelmed .
It's easy to overwhelmed - tricky stuff to get right.  I'm not sure what noise results your simulator produces but there are often many noise values output. Some are the contribution from only one circuit element.  Some values are noise-squared/Hz and some are noise/square root Hz.  Also the raw values aren't that useful or require good judgement to interpret.  Better is to make an A-weighted noise meter in spice: First the output through an A-weighted filter (which you make in spice) then, a non-obvious step, is to integrate the noise-squared, then take the square root.   You should plot the cumulative integral over frequency, it should start to level off at 10kHz or so.  (If not then noise measurement has a odd property and you need to re-interpret the results or use a different noise metric.)

Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 17, 2017, 06:23:24 PM
Quotenaturally the crappy phone mic distorts and kills lows, and there might be the odd noise like the board moving about slightly, but it should give a basic idea:
I can hear some noise but it's a bit tricky for me to get a handle on the base-line signal level.    Like when you crank the gain to full on an amp  You get a lot of noise but you know when you play something it's going to take out the windows and doors.

Quotedifferent balances of R7/R8 vs. R15 result in the same level of noise, so not really relevant. do you think the hiss is inevitable at this point?
If one of those configurations is better it is probably the one with the lower R15 value.  Yes, you do reach a point where you start grasping for every dB.  It's a long process squeezing out noise and sometimes you have to make compromises with performance.   One thing I did try early on was to scale-down *all* values in the circuit by a factor of 2; other than the integrators which we already changed.  You would expect an improvement but it was only like 0.5dB or so.   For a circuit with 22k resistors and FET input opamps that amount of reduction was all I was expecting (1dB max).
Quote
i could maybe try tweaking the anti-oscillation RC network in the inverter's Fb loop, i haven't touched that since the "centre click" problem was solved, but i can only see that eating into the wanted spectrum
Yes you can gain a lot here.  Personally I don't like a lot of HF junk on shelving EQ's for bass but other guys do.  It's a matter of taste and to some degree the nature of the tone of the bass.

Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 17, 2017, 07:22:13 PM
admittedly that stuff about the noise measurements is way over my head, but i'll read up on the basics (and re-read your last paragraph a few thousand times) when i have some time. as far as i can tell, LTSpice shows the square root, and requires that the input source and test node be specified (for which i chose U1A's output).

i'm having another noise issue with a dated USB interface since my last PC build unfortunately, so i can't get a better recording at the moment or it'd seem 20 times worse!

with any other pedal, i'd gladly kill off everything above 6KHz or so. that would save a ton of hassle! so many times i've wished i could just do that here. it's the occasional non-guitar-amp use i'm trying to cater for. i'm doubtful anyone would have a need to boost everything past 1KHz by 15dB, and the flat noise compared to bypass seems reasonable to me. when i box it up properly again i might get a tad less noise. i'm making all the changes a bit more "permanent" right now, and i'll give it a proper acid test tomorrow.

talking bout bass: i gave one of my BP-only EQs to a bassist friend of mine a few years ago, and (for some reason) he used it on a recording in such a way that it sounded like a guitar! i actually asked "who's that?". i was really impressed. maybe that's why he doesn't seem to be in that band anymore. lol
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 17, 2017, 08:06:30 PM
Quotebut i'll read up on the basics
This is a good start,
http://www.epanorama.net/sff/Audio/Semi_Specs/AN-104.PDF

Quotewhen i have some time. as far as i can tell, LTSpice shows the square root, and requires that the input source and test node be specified (for which i chose U1A's output).
OK.  You will find there is something like INOISE (noise referred to input) and ONOISE total noise at the output both probably in V/rtHz.    You need to add-up the noise squared and do it in the frequency domain.    Look over that links first.
Quotei'm having another noise issue with a dated USB interface since my last PC build unfortunately, so i can't get a better recording at the moment or it'd seem 20 times worse!

One trick is to record the noise into a PC then analyse the noise levels using some sort of sound analysis tool software.  The simple way is to just filter the results using a 10kHz second-order (or more) filter but you might find an A-weighted filter plug-in.   You need a way of getting the rms of the signal too.  If you don't use filters you will get very misleading results.  Wide band noise makes the numbers much larger but they aren't the components you hear.  Eg. you won't hear the effect of a 20kHz low pass filter but the measured noise value before and after filtering can differ enormously.





Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 17, 2017, 09:21:48 PM
thanks for the PDF, i had a wee Google earlier and couldn't really find a good foothold to get started learning about it. that should help me get further than "oh, the numbers go down a bit if i do this".

i use freebie spectrum analysis software and a tone generator from a phone or laptop to test the ranges, Q and gain of my EQs, but i wouldn't have even considered using my current setup to detect noise. as you suggest, it's definitely not as straightforward as looking at the pretty shapes. i do want to figure out how to get a noise spec, though - i was gonna ask but thought it might be impossible with the gear i have. if it is possible, i'll try to get my PC hiss problem fixed and maybe switch to Cubase or something, if there is a plugin(s) that would help.

FWIW here's a handy program i found one day when i was a bit annoyed with the clutter in other swiss-army-type analysis software:

http://www.techmind.org/audio/specanaly.html (http://www.techmind.org/audio/specanaly.html)

they had to be extra-careful with that URL.

Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 18, 2017, 08:29:59 PM
QuoteFWIW here's a handy program i found one day when i was a bit annoyed with the clutter in other swiss-army-type analysis software:
http://www.techmind.org/audio/specanaly.html

Looks like it might do the job and it has A-weighted measurement.    For A/B comparisons you don't need much.   Consistent results between runs on the same device is a good thing!  Some software is all over the place.

BTW, thanks for the link.  It's good to have these things kicking around.
Gradually I'm moving over to Ubuntu so I've been trying to force myself to use Audacity - it certainly has it's limitations.
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 18, 2017, 11:23:04 PM
no probs! my condolences for having to use Audacity, i've had to use it from time to time and the lack of realtime processing and intuitive dragging/cutting is soul-destroying.

applying the oscillation fix to the low band removes the crazy-loud switch pop as it did on the high band btw, despite there being no similar issues with the BC pot. so an extra win there. i haven't gotten round to any "proper" testing yet, but i had a good jam with it earlier and it seems fine. giving it to some friends in another band tomorrow to try at rehearsal volumes.
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 19, 2017, 06:01:47 PM
Quoteapplying the oscillation fix to the low band removes the crazy-loud switch pop as it did on the high band btw, despite there being no similar issues with the BC pot. so an extra win there.
It's good feeling when you know you have weeded out some issues.

Quoteno probs! my condolences for having to use Audacity, i've had to use it from time to time and the lack of realtime processing and intuitive dragging/cutting is soul-destroying.
LOL. 

My dream (cough) of creating a parallel universe of software on Ubuntu has generally gone down similar paths.  I'm impressed how well Ubuntu works out of the box but once you get past a browser and OpenOffice things tend to go backwards.  The "geek level" required to fix OS issues is way beyond the level of any of my family members.
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 20, 2017, 08:07:03 AM
i've given the pedal to some friends in a death metal band to try out - between the 2 guitarists and bassist, there should be a good range of pickup types, amps and pedals to put the EQ through its paces. i also tried it through single-coils on a crap Kustom practice amp at my charity shop earlier, no unacceptable noise except when the settings are abused. just some mains hum from the only adapter i could find.

SVF EQs seem really, really unforgiving with mains hum IME, while i'm on the subject. i tried to be somewhat meticulous with my Spyder PSU, and even high-gain distortion pedals don't pick it up, but SVFs seem to. even if just slightly. maybe reducing that cap to Vref in the diff-amp would help, but a 10R/1,000u or 100r/100u on the power rail always takes care of it. without the filter, it happened with the random adapter i used earlier, too, which the manager of the shop uses all the time for pedals. weird. i'm open to the possibility of magnetostriction from either PSU though, the transformers are big and quite near the rest of the circuitry.

as traitorous as it is to hardcore nerd-dom, i've always been a Windows fan and after disabling a long list of Ministry of Thought connections, i even kinda like Windows 10! tried a portable Linux distribution once, but i realised i wasn't up for re-learning some of the basics. and there's just more stuff to shoot on Windows. but i don't doubt Linux's advantages if you put the work in.

i'll be giving that noise PDF a read over the weekend now that build's out of my hands for a bit. at risk of excessive gratitude, thanks once again for all the help! will be re-reading much of this, it's been interesting to see such a looped feedback relationship between all the stages as opposed to just a linear in-out deal with only parasitics, capacitance and preceeding gain to address.
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 20, 2017, 07:40:21 PM
QuoteSVF EQs seem really, really unforgiving with mains hum IME
That's a bit weird.

If any parts connecting to ground symbols on your schematic are going are actually going to 0V, connections like R12, R13, C8 then moving the 0V connection to Vref might help.

Maybe increase the Vref cap?

It might have something to do with the new opamps but I doubt it.

QuoteLinux's advantages
My conclusion is for specific tasks the software choices are very limited compared to windows.
After a forced update, one windows machine at work completely barfed and the OS has to be reloaded/reset.
It was fairly new with minimal software installed.  I'm not fond of any updates especially forced ones - your machine works today and might do weird stuff or be broken tomorrow.

Quotethanks once again for all the help! will be re-reading much of this, it's been interesting to see such a looped feedback relationship between all the stages as opposed to just a linear in-out deal with only parasitics, capacitance and preceeding gain to address.
No problem at all.   

Regarding stabilizing the feedback loop: One thing I was going to mention was to look up "stability", "loop gain" and "phase margin".  You can do this stuff in spice.  Unfortunately with your circuit how the circuit behaved didn't match up with spice.   That's one of the remaining puzzles of your circuit.

Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 21, 2017, 02:42:05 AM
It occurred to me that what ever is causing the high sensitivity to the supply hum might actually explain why the circuit was hard to stabilize!  Maybe it is worth digging  a bit deeper.
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 21, 2017, 07:45:27 AM
All reference "grounds" within the in/out caps are Vref. The circuit as built exactly like the ESP schem (and that Japanese variation schem floating around), without any of the additional stuff, have been prone to it if the PSU isn't 1,000,000% hum-free. That one's over 3 different layouts!

I wonder if something about the Vref routing is to blame here. I have a dedicated buffered Vref just for this band for testing, so it's only gonna be contaminating itself.

Maybe even the actual ground has a routing flaw board-side, tho i try to "star" it within the board and offboard as much as possible. Power filter cap/rev. polarity diode go straight to PSU ground, before going on to the chassis with the rest of the circuit's grounds.

The oscillation fix had no noticeable effect on the hum sensitivity, but it is a weird one so I'm open to it!

I've definitely been taking op-amp stability for granted a bit until now - there's always been an obvious fix to why an op-amp wasn't responding well that probably prevented me digging too much deeper.

Cheers!

Sent from my Vodafone Smart ultra 6 using Tapatalk

Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 21, 2017, 08:51:40 AM
QuoteI wonder if something about the Vref routing is to blame here. I have a dedicated buffered Vref just for this band for testing, so it's only gonna be contaminating itself.

An opamp buffer seems like it should be a solid low impedance output *but* at high frequencies, at and above frequencies where stability issue occur, the output impedance isn't that that low at all.  So maybe the opamp buffer is the reason for the stability issue.   A good example is the Sallen and Key second order low pass filter.  The attenuation is poor at high frequencies (believe it or not)  The feedback caps leak signal through to the output because the output impedance is not longer low!

QuoteThe oscillation fix had no noticeable effect on the hum sensitivity,
What I was thinking is not so much the fix but the cause.  The thing that is causing the hum is causing the stability issue.    The buffer impedance won't have an effect at low frequencies.

One thing though.  On your buffered Vref, there is a voltage divider (divide by 2) before the buffer, yes?   On that voltage divider do you have a largish cap to ground?  If not then that is the reason for the hum sensitivity.    The hum on the supply is divided by 2 but the hum then feeds straight into Vref.   In the normal 2xR + Cap type Vref circuit the cap act as low frequency low pass filter that removes hum from Vref.   The cap also ensures Vref has a low impedance at high frequencies - better than an opamp!

Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 25, 2017, 02:08:19 PM
sorry for the delay, had a busy few days.

there's a 47u cap to ground off the Vref divider, but it doesn't seem to affect the hum. if an RC on the power supply kills it, where it shouldn't be to begin with, then methinks it's just a matter of sub-par PSU filtering. friends haven't ever mentioned the issue with their commercial power bricks, but it is inconsistent when other pedals aren't as susceptible. if the hum is caused by instability, it's either in the original SVF/Urei design or is caused by some kind of proximity. a scope would help figure that out.

at one point i had a LT1054 set up for a bipolar supply - that made noise debugging even more fun. lol

Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 25, 2017, 06:31:08 PM
Quotethere's a 47u cap to ground off the Vref divider, but it doesn't seem to affect the hum. if an RC on the power supply kills it, where it shouldn't be to begin with, then methinks it's just a matter of sub-par PSU filtering. friends haven't ever mentioned the issue with their commercial power bricks,
That's very very strange.  It means the hum is not on Vref but on +V.

Most power bricks have an internal filtering cap of about 1000uF.  I've measured the ripple on many of them and derived the cap value.  I'd say that would be fairly universal except for high current units (and perhaps the odd unit that has 470uF).

If you add a 1000uF across power *with no series R* and it fixes the problem then I'd suspect the internal filtering cap has failed in the PSU.   If the hum only goes down by half then there's something weird going on with your eq

Many pedals have a local 100uF across the power rail.  So the other effects which don't have the humm might be filtering enough to keep the ripple down with the failed cap - effectively hiding the failed cap problem.  If your board has no local electrolytic caps on the power rail that would explain why you get hum on the eq but not on the high-gain effects.

Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 26, 2017, 10:43:35 AM
as far as my own PSU goes, iirc there's 470uF on the input side of each regulator and 100uF on the output side, identical over 6 outputs. the original GeoFex Spyder design called for 220u and 10u respectively, so i figured 470/100 would cover more bases. there's almost definitely some magnetostriction going on, because there are 3 stupidly-oversized 12VA transformers in there (i was shopping while unsober and needed 12V...) and they're not toroidal.

then there's usually a 100uF across the rails of the EQ, or 10R+1,000u to kill hum with minimal voltage drop in this case. i don't think the hum went away with just a cap last i checked, but i'll give it a go next time i score some bigger values. no doubt the regulator output caps could be bigger, though. i have no clue what's inside the other adapter i used.
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 26, 2017, 06:03:02 PM
Quoteiirc there's 470uF on the input side of each regulator and 100uF
If you have regulators you should get about 250mA per output with that input size cap.

Quotestupidly-oversized 12VA transformers i
Sometimes you have to take what is available.   If the transformers are distant from everything it shouldn't be an issue.
I once had a preamp with only a 2VA transformer, for some reason I would get hum though the pickups from that and not the 100W amp sitting right next to it.  (I suspected the transformer was running near magnetic saturation.  There was an era where such practices were common).

Quotethen there's usually a 100uF across the rails  ... i don't think the hum went away with just a cap last i checked
What about the wiring of the ground to those caps.  You want:  PSU inlet ->   100uF caps ->  circuit. You don't want any signal connections between "PSU inlet" and "100uF caps".   I think you had an issue like with the TDA2030 amp.

Beyond that I'm running out of ideas.

You have had an unfair number of weird problems on this project!
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 26, 2017, 07:23:13 PM
i only used 78L09s unfortunately, so 100mA per output max. i guess that's why the Spyder specs were so small. there were 6VA transformers available for much cheaper at the same source (and for much less muscular pain when carrying it!), i was just an idiot and it was too late to send back. there's about 2 inches between the transformers and the circuitry, so i'm not too optimistic about it.

i did run the pre-amp grounds on the same path as the PSU filtering cap on that TDA2030 amp, but it's not an error i usually make. honest! the filter caps on the actual board (usually 100uF/100nF ceramic) have their ground going straight to to the PSU negative. the connection to signal ground is either done on-board just before that, or from a wire from the DC jack to star ground on the chassis. neither placement helps any, though they are essentially the same routing. there aren't any loops going on.

just wrote a bunch of stuff analysing my onboard grounds (only really op-amps, Vref divider & pulldowns), but then i remembered it's happened in previous versions with different grounding layouts. i guess it's just the PSU at this point - as i say, it's only me who's really noticed it.

cheers!
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 27, 2017, 06:41:44 PM
Quoteonly used 78L09s unfortunately, so 100mA per output max. i guess that's why the Spyder specs were so small. there

At this point all you tests point to the fact there really is ripple on +V and that is the source of the hum.

The parametric is could be pulling more current than your other effects current because of the high opamp count.      The 78L09s don't have heatsinks so they heat-up easily.  It is possible they are going into thermal shutdown (or riding the edge of it).  When that happens the regulator won't remove the ripple as well.   A sledgehammer approach would be to break out one DC rail with 1000uF filter cap and a 7809 (not the L) and see if you still see the problem.  The larger cap guarantees no dropout and the 7809 guarantees no shutdown (check it's not getting hot as well).    If that solves the problem maybe work back to see which one is the cause.

If it is none of those then err ...  you might have to play around with layout or isolate one parametric channel at a time.   General stuff to narrow down the problem.

Another thing you can check is the parametric's current draw.  If it's way over the expected current then there could a damaged opamp, or, .... wait for it ... something could be oscillating..

Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 30, 2017, 04:28:32 PM
the hum is there even on a basic 6-op-amp configuration, unfortunately. i can't recall the exact figure, but i usually measure about 20-30mA for a 3-band EQ. no op-amps wasted in this one.

btw the alternative switching scheme where the Q-setting resistor and Q pot wiper are switched between Vref makes too loud a pop compared to the original system, though that's with a plain mechanical switch. i wonder if using the CMOS would quiet things up a bit, but i'd imagine the noise is from such sudden shifts in the biasing and any type of switch would have this problem. i think i'll just stick with the "short the lugs to Vref" approach for now.

cheers!
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 30, 2017, 07:47:49 PM
(deleted original post because headphones revealed something a speaker didn't, so i made a mistake)

in a subsequent build with slightly different values for the same SVF frequency and range (3k/3n3/6k8 as opposed to 1k/10n/6k8 for 1-16KHz), i have squealing as a result of the inverter oscillation fix. i know because removing that RC kills it, but brings back the BC pot centre-click.

i haven't messed with the values much tbh, and i see right now i'm only reducing the troublesome highs by a gain of about -0.23, just under half the -0.5 of the full signal. so i'll try reducing it further. it'll be good to sort that out, as it implies the previous circuit may have been on the brink, too.
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 30, 2017, 11:19:08 PM
Quotethe hum is there even on a basic 6-op-amp configuration, unfortunately. i can't recall the exact figure, but i usually measure about 20-30mA for a 3-band EQ. no op-amps wasted in this one.
Not sure what is going on then.  The fact you can put an RC filter on the power rail and remove the hum means it is extremely likely the hum is on the +V rail.  The only things that are letting the +V get through to the audio output are the opamps and the Vref.

Quotebtw the alternative switching scheme where the Q-setting resistor and Q pot wiper are switched between Vref makes too loud a pop compared to the original system, though that's with a plain mechanical switch.
That's strange.   Any resistors that get switch must have a series cap and also a large resistor (10MEG) across the switch.   The caps ensure the DC level does not change between the two switch states and the resistor ensures the cap stays at the same (usually tiny) DC voltage.     The idea is there is no change to the DC levels *at all* so no chance of pop.  So if you are getting a pop something is wrong for sure.
IMHO the CMOS switches can only make things worse (due to other causes not the root cause you are seeing with the mechanical switch).

Quotein a subsequent build with slightly different values for the same SVF frequency and range (3k/3n3/6k8 as opposed to 1k/10n/6k8 for 1-16KHz),

I'm not overly surprised since taming the oscillation was tricky and within factor of two gain.   Not much margin to cope with variations.     The first build, the working one, I suspect is OK as a one off.  It's just the second build the characteristics of the parts are different and has kicked it over the edge.

Quotei have squealing as a result of the inverter oscillation fix. i know because removing that RC kills it, but brings back the BC pot centre-click.

All that means is you have moved the oscillation frequency.  The real issue is it is still oscillating.   The quick fix is  to go back to playing with the RC values on the inverter.

IMHO there's something not normal going on  as it is normally not so hard to stabilize a circuit like that.  Another weird thing is the simulation results do not show any extreme sensitivity to instability - despite me antagonizing it by changing the opamp characteristics.    Putting my engineer's hat on ... I would never let a circuit that oscillated out the door unless I *really* understood the cause and the fix.   So the real fix is to work out what is causing it to be so close to instability.
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 31, 2017, 01:07:45 AM
your suggestions and my latest efforts ran in parallel - turns out it was the inverter RC, and i should've played with it some more instead of settling on the first values that made it work with the right frequencies. i didn't notice the issue previously as the low band only went up to 400Hz.

with 2k2/100p for 723KHz rolloff (wtf!), it works fine in both modes. problem solved.

i must've taken you too literally re. the Vref switching - i assumed you meant without any additional parts, and that the voltage shift wouldn't be too big as-is.

my gut still tells me the instability is caused by the way the LPF/HPF are mirrored at the mixer output. it's been held back from the door for at least 6 months while everything's ironed out - the last thing i wanna deal with is this confusion AND complaints! i think it's solved now, but i'll be giving it a lot of testing before i confirm that. i might push the frequency ranges to unrealistic levels while i do so.

weird nuance, FWIW: at certain values where both click existed in one mode and squeal in the other, they'd kick in at the same point on the BC pot (which actually makes me think it's frequency-independent, as the ranges for lo & hi mode are totally different...)

cheers!
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 31, 2017, 02:02:29 AM
i've finally given up my obsession with the "it's the mirroring!" thing. i'll read this like there's no tomorrow and see if there's anything else i'm missing:
http://cds.linear.com/docs/en/application-note/an148fa.pdf (http://cds.linear.com/docs/en/application-note/an148fa.pdf)

also, phase has my gears turning... i wonder if something outwith the audible range is lagging to just the right phase-difference for oscillation. i'll need to read more on how that works, i get the basic criteria for oscillation but i'm not quite sure what data to look for beyond op-amp phase margin. i am finding a lot of useful articles & posts though, so hopefully it won't be long.
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 31, 2017, 04:13:21 PM
i was reading up on Gain-Bandwidth Product and phase margin etc., had a wee look around in Spice to try and spot any problematic phase alignments in the ultrasonic range, then i came across this big b******!

(https://www.dropbox.com/s/l2g5q13drw7041a/anomaly.png?raw=1)

blue is U1A's output, green (?) is the inverting input (referring to https://www.dropbox.com/s/41nzj1aic5yyg0n/svfhinoize.png?dl=0 (https://www.dropbox.com/s/41nzj1aic5yyg0n/svfhinoize.png?dl=0) again). both the Full Cut and Full Boost graphs are without the oscillation fix. from the centre position of the BC pot onwards, the notch disappears.

i'm unsure what values to pump into LTSpice's "Universal Op-amp", if it's not universal enough already. i've set GBW to 2.2MHz as per the TLC2272, whereas the rest of the parameters remain at open-loop gain is 1Meg, slew 10Meg, phase margin 45, input impedance is 500Meg.

the sim on my phone ("EveryCircuit", surprisingly good for small stuff) even shows it, and allows for a "live" turning of the pot, which shows the notch disappearing VERY suddenly at the centre position.

(https://www.dropbox.com/s/ljob2ysjshh7as0/sneaky2.png?raw=1)


current oscillation fix is 2k2 & 200p, for 362KHz roll-off. could it be that lowering the Q of that notch via. that RC is what's fixing the problem? it seems to respond more to that than where in the spectrum it's at, but that's inconclusive for now. i mean the resultant Q on U1A's output, as opposed to the signal returning to U1A's inverting input.
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 31, 2017, 06:59:17 PM
Quotei've finally given up my obsession with the "it's the mirroring!" thing. i'll read this like there's no tomorrow and see if there's anything else i'm missing:
http://cds.linear.com/docs/en/application-note/an148fa.pdf

That's a good reference and it discusses the right things but it might be hard picking up the subject from it.  Also, and more importantly, the emphasis in that paper is a single opamp.  It shows how things surrounding the opamp affect it's own local feedback loop making it unstable etc (despite the amplifier being designed to be stable - hence the title.)


When you have a large number of opamps arranged to form a loop, like your circuit.  The cumulative effect of all the phase shifts of the opamps causes instability around *that* loop.  This is a system level effect not a local effect.  This is independent of any local effects the paper mentioned (you have to fix the local problems first).

Quote
i was reading up on Gain-Bandwidth Product and phase margin etc., had a wee look around in Spice to try and spot any problematic phase alignments in the ultrasonic range, then i came across this big b******!

OK cool.   The first thing is you have to plot the  gain and phase of the "system level" feedback loop.  Not the response of circuit as it would be used.   For your circuit you must break loop as follows:
- Set the input voltage source to a short circuit.
- Cut the line between the output of U3 and the +input of U1A.
- Add a source drivng the +input of U1A
- Observe the output of U3
Doing this lets you see the gain and phase the loop sees.
Note also the behaviour depends on the controls.  It will be worst in the full cut-connection.

You then plot the frequency response.  It is quite a different view of the world compared to the normal operating frequency response.   If you look at the normal frequency response you might see peaks which indicate potential oscillation but it is not a reliable method and the "Phase Margin" and "Gain Margin" concepts don't apply.

So far I can't find any clear references on the topic mainly because this is a control theory problem and as a result you will get a lot of s-domain maths explanations.  The things to search for are "Stability", "Frequency Response Method", "Phase Margin" and "Gain Margin".
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 31, 2017, 07:03:17 PM
Quotewith 2k2/100p for 723KHz rolloff (wtf!), it works fine in both modes. problem solved.

Those type of values are more what you would expect.    The 200kHz and above zone is where the common opamp circuits start to misbehave in terms stability.

Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 31, 2017, 07:15:18 PM
thanks for the info, Rob - i must've edited some stuff in my post while you were typing. main edits were that 2k2/200p were the actual working values for the oscillation fix (i forgot i paralleled 2x100p), and that it seems to be the resulting Q from U1A's output that has more effect than the placement on the spectrum. rolling off the erroneous value of 723KHz actually brings the problem back.

i'll use your walkthrough to try and dig deeper. i found a few more articles on oscillation since yesterday, so i'm taking on board all i can. i'll report back, possibly about 2 minutes in when i get confused. lol

cheers!
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 31, 2017, 07:21:34 PM
do you mean short the very input to ground, and anything particular for the voltage source? just a 1VAC sine?
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 31, 2017, 07:42:57 PM
Quotedo you mean short the very input to ground, and anything particular for the voltage source? just a 1VAC sine?
The original input source is replaced by a short circuit to ground.   The added voltage source is 1V AC so the final dB plot represents the gain of the circuit (1Vin 1V out ==> 0dB gain).    The source is just an AC source, same as what you have been using for your AC analysis (sine as such often implies a transient analysis in spice).



Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 31, 2017, 08:17:31 PM
ok, input shorted, 1VAC sine on U1A+ input, output from U3A shows:

(https://www.dropbox.com/s/n2qybna1fbjuq0h/anomaly2.png?raw=1)

hmm, nothing too weird that i can see. the phase does veer towards a full 360 from the input, towards the end of the slope, but as you said, those concepts don't apply. seems the evidence disappears when the circuit is configured like this.

control theory... that's a new lead i haven't tried before. i'll do some googling, with "for dummies" suffixed. i'm a bit excited, even though the problem has a solution for a while, it's both interesting and reassuring to start realising what the actual cause is.

the build i gave to that band seems to be working well, i asked them to pay particular attention to this issue and they had no clue what i was on about. they wanna stress-test it some more, so i'll know more by the end of the week.

cheers!
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 31, 2017, 08:24:00 PM
I think the boost/cut pot is on boost as the gain is very low.  Try setting to cut.

Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 31, 2017, 09:17:55 PM
those are definitely the readings from either extreme, with the one with the slight bump at 400KHz being the Boost. maybe i'm doing something wrong. input is grounded (on the DC-free side of a cap, ofc), U3 to U1A+ line is cut, voltage source goes to the + input and measuring is done from U3 output.

results seem to be the same whether or not the input buffer is there, but if i disconnect it and short the input side of R1 straight to Vref, there's a very slight but unremarkable difference.

what the hell have i created?!! lol
Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 31, 2017, 09:22:36 PM
here are the results with the input buffer removed and R1/adjoining BC pot lug shorted to Vref (same order: full cut, full cut w/ fix, full boost):

(https://www.dropbox.com/s/fiwavz4bvh6ivrc/anomaly2b.png?raw=1)
Title: Re: State Variable Filter LPF noise
Post by: Rob Strand on January 31, 2017, 09:37:04 PM
OK I think I know what is wrong now, it's because your simulation is single supply.  The added AC source that connects to the +input is stuffing-up the opamp biasing.  Instead of connecting that source to ground connect it to Vref instead.    (This configuration isn't 100% correct but it should improve things.)

Title: Re: State Variable Filter LPF noise
Post by: MrStab on January 31, 2017, 09:59:43 PM
gah, i'm an idiot - i forgot to set the DC value on the voltage source. levels much more logical now:

(https://www.dropbox.com/s/jjcgrourgw4h40e/anomaly2c.png?raw=1)

the crazy-low values should've given me some clue, but in fairness, i've never done this before so wasn't really sure what to expect.
Title: Re: State Variable Filter LPF noise
Post by: PRR on February 01, 2017, 12:58:39 AM
> LTSpice's "Universal Op-amp"
> GBW to 2.2MHz...open-loop gain is 1Meg, slew 10Meg, phase margin 45, input impedance is 500Meg.


"2.2MHz" -- my SPICE reads that as MILLI Hz. I have to spell "meg". However I suspect a 0.0022 Hertz GBW would not be giving even dubious audio plots.

OL Gain 1Meg with GBW 2MegHz is accurate above 2Hz, which is all you need. 45 deg is a customary phase margin. As none of your nodes are as high as 1Meg, 500Meg or even 500K input is "don't care" because this will bootstrap.

I do not know what "slew 10Meg" is. If you are only doing .AC analysis it does not matter (.AC is a fictional world anyway). In .TRANS a poor slew will slice large high frequency waves, you can find pictures in the interweb. This opamp will not be slewing for any reasonable audio, so if .TRANS says it does, you know this parameter is wrong or wrongly-expressed (SPICE is fussy).
Title: Re: State Variable Filter LPF noise
Post by: MrStab on February 01, 2017, 01:06:19 AM
it's good to know that the parameters are fine for this application at least, thanks Paul. i entered "2.2Meg", not "MHz", but i have noticed that a plain "M" will make things milli.

hey that is a weird one for the slew rate, now i think about it. i want a 10 megavolt/second slew rate!
Title: Re: State Variable Filter LPF noise
Post by: PRR on February 01, 2017, 01:14:55 AM
Slew is often specced as "micro Seconds". So 10 Meg "could" be 10 million Volts in one second, which would be 10V/uS, which is a fine fast audio rate.

> i want a 10 megavolt/second slew rate!

You may have it. Expressed in Volts/SECOND, TL0xx is 7,000,000 Volts per Second, and faster chips abound.

So I guess it makes perfect sense. Just real units instead of the customary shortcuts.
Title: Re: State Variable Filter LPF noise
Post by: MrStab on February 01, 2017, 01:36:04 AM
right enough, i shouldda multiplied it. strange to look at it in whole numbers like that, i guess the software has to have some sort of consistency with so many variables. next time i'm messing around with a 4558 dirt circuit or something where slew matters, i'll have some clue what to change.