Help with Constant Q Graphical Equalizer Design

MrAl

Joined Jun 17, 2014
13,704
Oh yes H(s) is the BP transfer function, I forgot to mention that.
Yes i'll be using spice now, I downloaded it yesterday. So I'll see to rebuild it in Spice and i'll upload it later. Multisim gives you some wacky responses tbh...and they vary ALOT once you use different op-amps geeze (Even with virtual op-amps the response was wacky)




Woa this makes perfect sense, this what explains why a value 10K for R6 gives 6dB, its because of the (A+1). I'll expand out my transfer function some more and see if I can get this relationship:

G= ((AAAA*R23*R3+2*R1*R23+2*R1*R22)*R4+2*R1*R22*R23)/((AAAA*R22*R3+2*R1*R23+2*R1*R22)*R4+2*R1*R22*R23).

which was obtained by setting the 10R resistor to 0. Should this be done when simulating or in real life? To get the behaviour as close to the theoretical model as possible?
Hello,

To understand the circuit theoretically it is best to set the 10 ohm resistors to zero. The 10 ohm resistors force approximations in the theoretical operation and that just makes it harder to comprehend what is going on with the main theory of the circuit.

If you get the LT Spice version ready i'd be happy to look at that too.

[UPDATE]
I see now the 10 ohm resistors are not about protecting the inputs of the op amps. They apparently set a limit on the range of the pot setting. The designer must have thought that it would be better to limit the gain slightly. However, 10 ohms does not do enough when combined with the tolerance of the other resistors. I would think 100 ohms minimum. However, they may be completely unnecessary.

To deal with the 10 ohm (or 100 ohm) resistors in theory, we can simply add them to the value of the pot resistors in the equation. Thus instead of using 100k which divides in half as 50k and 50k at the center setting, we could use 100k+10+10 and that would divide in half as 50k+10 and 50k+10, which as we can see is very minimal and so should have very little effect.
 
Last edited:

Thread Starter

Ronaldo95163

Joined Sep 2, 2018
52
Hello,

To understand the circuit theoretically it is best to set the 10 ohm resistors to zero. The 10 ohm resistors force approximations in the theoretical operation and that just makes it harder to comprehend what is going on with the main theory of the circuit.

If you get the LT Spice version ready i'd be happy to look at that too.

[UPDATE]
I see now the 10 ohm resistors are not about protecting the inputs of the op amps. They apparently set a limit on the range of the pot setting. The designer must have thought that it would be better to limit the gain slightly. However, 10 ohms does not do enough when combined with the tolerance of the other resistors. I would think 100 ohms minimum. However, they may be completely unnecessary.

To deal with the 10 ohm (or 100 ohm) resistors in theory, we can simply add them to the value of the pot resistors in the equation. Thus instead of using 100k which divides in half as 50k and 50k at the center setting, we could use 100k+10+10 and that would divide in half as 50k+10 and 50k+10, which as we can see is very minimal and so should have very little effect.
Yes also this when I was deriving my TF above(not sure if mine is correct) since I included it in series...been trying tonight to get what you got here for G:

G= ((AAAA*R23*R3+2*R1*R23+2*R1*R22)*R4+2*R1*R22*R23)/((AAAA*R22*R3+2*R1*R23+2*R1*R22)*R4+2*R1*R22*R23)


Can't seem to get mine to minimize down to that. Worked over my transfer function and i'm getting the same thing as what I posted earlier...do you mind showing how you arrived at that for G?

Will see how soon I can have the LT Spice built and posted, been up a while trying to work out G :(
 

MrAl

Joined Jun 17, 2014
13,704
Yes also this when I was deriving my TF above(not sure if mine is correct) since I included it in series...been trying tonight to get what you got here for G:

G= ((AAAA*R23*R3+2*R1*R23+2*R1*R22)*R4+2*R1*R22*R23)/((AAAA*R22*R3+2*R1*R23+2*R1*R22)*R4+2*R1*R22*R23)


Can't seem to get mine to minimize down to that. Worked over my transfer function and i'm getting the same thing as what I posted earlier...do you mind showing how you arrived at that for G?

Will see how soon I can have the LT Spice built and posted, been up a while trying to work out G :(
Hi again,

Since it took a lot of work let me first outline how i was able to arrive at that solution. If you still have problems i'll try to go into more detail later.

First i used nodal analysis, and ended up with an equation for the output Vout(s). The output was complicated so i looked for simplifications.
I found that the 10 ohm resistors were really too small to have too much effect, and later found they are actually redundant, so removed both and replaced with a short. If we dont do that we can not reach the theoretical solutions for the two pot extremes as easily and as neatly.
So i get an equation:
Vout(s)=F(s)
Next, solve F(s) for the center frequency. This is done by replacing s with jw and finding the magnitude and then the max of the magnitude of F(jw). That gives us w0.
Next, replace w in the magnitude of F(jw) with w0 and solve for the peak amplitude Av. That gives us the peak Av at the center frequency.
The gain is then Av/Vin or if you set Vin=1 then the gain is simply Av.
What else i did beforehand was set the gain of that one op amp stage to A=-R6/R5 to help lower the variable count.
Also what helps sometimes is to lump several resistors together such as when one divides another. For example, a set Ra/Rb can be reduced to Rc to help simplify the equation and later it can always be added back in when needed after the solution has been found.
I kept R22 and R23 separate because i wanted to see the effect with both of these. It may get more complicated if we replace
R23 with 100k-R22 right away.
Another thing you can probably do is just short out the last coupling cap (10uf) because in theory there is probably not any offset to worry about. In real life there is. What i did was after i got an equation for Vout i let the value go to infinity, but that was probably not necessary as just replacing it with a wire for now would have probably done the same thing.

See if all this makes sense and report back if you need to, and would be interesting to try this in LT Spice at some point too.
 

Thread Starter

Ronaldo95163

Joined Sep 2, 2018
52
Hi again,

Since it took a lot of work let me first outline how i was able to arrive at that solution. If you still have problems i'll try to go into more detail later.

First i used nodal analysis, and ended up with an equation for the output Vout(s). The output was complicated so i looked for simplifications.
I found that the 10 ohm resistors were really too small to have too much effect, and later found they are actually redundant, so removed both and replaced with a short. If we dont do that we can not reach the theoretical solutions for the two pot extremes as easily and as neatly.
So i get an equation:
Vout(s)=F(s)
Next, solve F(s) for the center frequency. This is done by replacing s with jw and finding the magnitude and then the max of the magnitude of F(jw). That gives us w0.
Next, replace w in the magnitude of F(jw) with w0 and solve for the peak amplitude Av. That gives us the peak Av at the center frequency.
The gain is then Av/Vin or if you set Vin=1 then the gain is simply Av.
What else i did beforehand was set the gain of that one op amp stage to A=-R6/R5 to help lower the variable count.
Also what helps sometimes is to lump several resistors together such as when one divides another. For example, a set Ra/Rb can be reduced to Rc to help simplify the equation and later it can always be added back in when needed after the solution has been found.
I kept R22 and R23 separate because i wanted to see the effect with both of these. It may get more complicated if we replace
R23 with 100k-R22 right away.
Another thing you can probably do is just short out the last coupling cap (10uf) because in theory there is probably not any offset to worry about. In real life there is. What i did was after i got an equation for Vout i let the value go to infinity, but that was probably not necessary as just replacing it with a wire for now would have probably done the same thing.

See if all this makes sense and report back if you need to, and would be interesting to try this in LT Spice at some point too.
Yuppp my approach was pretty similar to that, this was what I did from start to finish.
Should be done with the Spice model by this evening
 

Attachments

Thread Starter

Ronaldo95163

Joined Sep 2, 2018
52
The spice model thus far.
I still have to put in the values and power the op-amps etc but everything's there...apparently spice doesn't have default Potentiometer models so I had to model them as the two resistors
 

Attachments

MrAl

Joined Jun 17, 2014
13,704
The spice model thus far.
I still have to put in the values and power the op-amps etc but everything's there...apparently spice doesn't have default Potentiometer models so I had to model them as the two resistors
Hi,

Oh ok good. It would also be good to put in the actual values of the resistors, even if you stick with just three sections for now.
Did you test the op amp model to see if it worked ok? I ended up changing the op amp model but that was before i realized a feedback resistor for the first op amp was missing and that is why the sim did not work.
I am using just one section for now, and it seems to sim ok.
 

Thread Starter

Ronaldo95163

Joined Sep 2, 2018
52
Hi,

Ok, i'll see if i can retrace my steps to the solution.
Oh oks no probss

Hi,

Oh ok good. It would also be good to put in the actual values of the resistors, even if you stick with just three sections for now.
Did you test the op amp model to see if it worked ok? I ended up changing the op amp model but that was before i realized a feedback resistor for the first op amp was missing and that is why the sim did not work.

I am using just one section for now, and it seems to sim ok.
Just finished putting the entire thing together.
Have no idea how to get bode plots etc on this yet lol but this is the completed circuit which runs
 

Attachments

MrAl

Joined Jun 17, 2014
13,704
Oh oks no probss



Just finished putting the entire thing together.
Have no idea how to get bode plots etc on this yet lol but this is the completed circuit which runs

Hello again,

Ok nice. Just one thing, the first op amp stage is still missing the feedback resistor.
For my analysis i skip that stage because it has little influence on the theoretical solution.

Here is a diagram that shows my approach.
Each op amp is represented with a voltage controlled voltage source (EE1n invert input, EE1P output, and all non invert inputs are grounded, and each stage has gain 'A' where A is later taken to infinity).
Those are the node equations, where each node is represented by a voltage v1, v2, etc.
The idea is to solve those 14 nodes for all 14 node voltages, then take v1 and start to substitute values like R10=0 R11=0 etc., and set zC21=0 where zC is an impedance. Then allow A to go to infinity. The result is the transfer function. Once you have that, you can solve for w0 which turns out to be the same as w0 for the band pass section alone so that's a good sanity check. From there you can get the gain.

One thing i found was that leaving R10, R11 in the circuit just to write the equations seems to make writing them simpler, then later set them to zero after solving for all the node voltages symbolically..
Also, if you want a little more realistic gain for each op amp set A to some finite value like 100000. That however will lead to a more complicated theoretical solution.
If you dont like letting A go to infinity but want the pure theoretical solution still, replace each node solution that contains A with the appropriate solution for that op amp output voltage, then solve for all the nodes. Sometimes taking A to infinity takes a long time.

See if that helps.
 

Attachments

Last edited:

Thread Starter

Ronaldo95163

Joined Sep 2, 2018
52
Ohh okay I'll go through it and compare it with what I did on paper.
This is what I got when I simulated the entire thing. Im guessing it's because of the op amps?
The response you got was obtained using your op-amp models?
 

Attachments

MrAl

Joined Jun 17, 2014
13,704
Ohh okay I'll go through it and compare it with what I did on paper.
This is what I got when I simulated the entire thing. Im guessing it's because of the op amps?
The response you got was obtained using your op-amp models?
Hello again,

That's great, but you have to fix that first stage yet. If you want a gain of +1 then run the input into the non inverting terminal and keep the feedback a short as you have now, but if you want a gain of -1 then you need to change that feedback short to a resistor of the same value as the other resistor (2.2k).
You should start to see some interesting results soon :)
 
I performed a nodal analysis on the whole circuit minus the input stage, which is just a buffer. I also eliminated the 10 ohm resistors, and the 10 uF capacitors at the outputs of the filters. I only included 3 filters for now, at 630 Hz, 1.6 kHz, and 4 kHz.

Here are the responses I get with rather high gains or cuts. The first image shows the response with all 3 pots set for 1000 ohms in the top part and 99000 ohms in the bottom part:

Graphic1.png

Here's the response with the 1.6 kHz pot set for the same amount of cut; top part of the pot at 99000 ohms, bottom part at 1000 ohms:

Graphic2.png

Here's the response with the 630 Hz pot set for the same boost as the previous 2 images, and the 1.6 kHz and 4 kHz pot set for flat response. I see some interaction between the 630 Hz response and the other two, which should be flat:

Graphic3.png

I could add two more filters fairly easily, but there's no way I'm going to do all 15 filters! :eek:
 

Thread Starter

Ronaldo95163

Joined Sep 2, 2018
52
Hello again,

That's great, but you have to fix that first stage yet. If you want a gain of +1 then run the input into the non inverting terminal and keep the feedback a short as you have now, but if you want a gain of -1 then you need to change that feedback short to a resistor of the same value as the other resistor (2.2k).
You should start to see some interesting results soon :)
Oh I forgot to do that sorry about that. I fixed it and this is what i'm getting now...still kinda weird
 

Attachments

Thread Starter

Ronaldo95163

Joined Sep 2, 2018
52
Here a couple more responses. The boost and cut amounts per band are the same as in the previous post.

View attachment 162679 View attachment 162680
I performed a nodal analysis on the whole circuit minus the input stage, which is just a buffer. I also eliminated the 10 ohm resistors, and the 10 uF capacitors at the outputs of the filters. I only included 3 filters for now, at 630 Hz, 1.6 kHz, and 4 kHz.

Here are the responses I get with rather high gains or cuts. The first image shows the response with all 3 pots set for 1000 ohms in the top part and 99000 ohms in the bottom part:

View attachment 162675

Here's the response with the 1.6 kHz pot set for the same amount of cut; top part of the pot at 99000 ohms, bottom part at 1000 ohms:

View attachment 162676

Here's the response with the 630 Hz pot set for the same boost as the previous 2 images, and the 1.6 kHz and 4 kHz pot set for flat response. I see some interaction between the 630 Hz response and the other two, which should be flat:

View attachment 162677

I could add two more filters fairly easily, but there's no way I'm going to do all 15 filters! :eek:
Mannnn how did you get these good looking responses?
Mines is crazy (Screenshot in my previous post)

Minus the fact that the response for 0% Boost/Cut on that band isn't perfectly flat, would you say that the circuit is working based on the gain you set for?

Also was it my LT spice file you used or was it your own?

I can't seem to get the responses you guys are getting at all :(
 
Mannnn how did you get these good looking responses?
Mines is crazy (Screenshot in my previous post)

Minus the fact that the response for 0% Boost/Cut on that band isn't perfectly flat, would you say that the circuit is working based on the gain you set for?

Also was it my LT spice file you used or was it your own?

I can't seem to get the responses you guys are getting at all :(
I'm doing a nodal analysis of the complete circuit, with the nodal equations in matrix format. Thank goodness for modern mathematical software. The amount of number crunching would not be possible without it. My laptop takes about 5 seconds to solve the matrix numerically, and a few seconds to plot the response. A symbolic solution is possible, but it takes about 15 minutes to do it!!!

I may add a couple more filters, but as it stands now I think the circuit is behaving as expected.

Is the response you show with alternate filters set for boost, cut, boost, cut, boost, cut, etc.? I don't know why you get the irregular response; mine seems perfectly regular if, for example all the bands are set for the same amount of boost or cut.

Here's how I set things up; I'm not showing the plotting code (the easy part):

Graphic6.png
 
Last edited:

MrAl

Joined Jun 17, 2014
13,704
Mannnn how did you get these good looking responses?
Mines is crazy (Screenshot in my previous post)

Minus the fact that the response for 0% Boost/Cut on that band isn't perfectly flat, would you say that the circuit is working based on the gain you set for?

Also was it my LT spice file you used or was it your own?

I can't seem to get the responses you guys are getting at all :(

Hello,

You have the 'settings' pots set too wild. Change most of them to 50k and 50k leaving just one band as boost, then go from there. You should see a better response.
Experiment with just one band first, then continue with just two bands until you get the hang of it, then go to three. The rest should be 50k and 50k (center position).
 
I can't seem to get the responses you guys are getting at all :(
I'm recalling a problem I had with this analysis which may be a clue to your difficulty. When I started the analysis of this circuit I only had a single filter, and everything was working ok.

When I added the second filter, Mathematica (which I'm using to do the number crunching) reported that my admittance matrix was singular. It took me a while to find the problem. I was using standard double precision floating point arithmetic. This means using about 17 digit floating point arithmetic. It turns out that the circuit is large enough that some of the internal calculations were over/under flowing the arithmetic. Mathematica allows for arithmetic other than floating point. The other method is rational arithmetic--all numeric quantities are represented as fractions with integer numerator and denominator. This is essentially "infinite" precision arithmetic; there's no roundoff error. When I switched to this method, the problem of singularity of the admittance matrix went away.

I was getting this problem with the addition of the second filter. Just imagine what would happen with 15 filters! I don't know if LTSpice can do rational arithmetic, but it's possible that it may be having problems with its floating problem arithmetic when solving such a large problem.
 
A friend of mine who is an LTSpice expert mentioned that when LTSpice is having arithmetic problems, there is an alternate solver which can be chosen in the LTSpice control panel. He may get on here to contribute.
 
The Electrician's friend here. Here is what I get from LTspice:EQplot.gif EQschematic.gif

For the schematic I used a hierarchical subcircuit for each slider section. I think you had a typo for one of the resistor values, so I changed it to achieve equal EQ for all sections. (You're welcome.) ;)
 

Attachments

Top