A gyrator calculator in LTSpice for graphic EQ design

While investigating mods for one of the preamps mentioned in my onboard bass preamp thread, I googled "gyrator calculator" and all the ones I found give you the centre frequency and Q for given component values, which is fine if you want to analyze an existing circuit, but the opposite of what you need if you want to modify one or design your own, so I put together a little LTSpice simulation that calculates the components for you and lets you visualize how much you will deviate from the ideal response when you use standard values.

Background: one of the most commonly used circuit topologies for implementing a graphic EQ is shown e.g. in the 1980 National Semiconductor Audio & Radio Handbook (free download from TI), see "2.17 Octave Equalizers" on page 2-59 (page 68 of the PDF). Each pot wiper is grounded via an LCR series resonant circuit where, instead of using an expensive and bulky inductor, the inductance is "synthesized" with an active element (opamp or transistor), a capacitor and a couple of resistors, i.e. a gyrator. The reference above explains its operation in detail and provides the formulas to calculate the components for a given maximum boost/cut gain, centre frequency and Q value.

It also mentions that linear pots have very little effect around the centre position and a lot of effect very close to the extremes, so S-taper pots (aka W-taper) are recommended. I'll address this in a later post, showing how a reasonable response can be achieved with linear pots (plus some caveats).

The simulation has two similar circuits, one with the calculated components and one where you enter manually the closest standard values, that way you can plot both and see how well they match:

Gyrator calculator V1.png


I've parametrized the pot position to show the maximum, centre and minimum positions as well as half-way between centre and extremes. I've assumed 20k W-taper pots, which happen to be the type used for the tone control of the often cloned Tubescreamer pedal, so they aren't as hard to find as other values. A couple of good sources I've used in the past and have had no complaints about are Tayda and Musikding. Based on the curve shown in Alpha's datasheet, those half-way positions would correspond roughly to 1k and 19k for a 20k pot, as shown.

So, to use the calculator, you simply edit the parameters at the top left, run the simulation, then enter the closest standard values to the calculated ones in the circuit on the right, run the simulation again, plot "calc" and "actual" to compare them, tweak as/if required. Some notes:
  • The formulas have some approximations and the response you see for a single filter will change significantly as you add new ones. In particular, the max/min gain will decrease, so aim for a few dBs more than you need. In the 10-band example of the NS handbook they calculate for ~17 dB to get an actual maximum boost/cut of ~12 dB.
  • R1 should be large, at least 68k or so to keep the approximations in the formulas acceptable.
  • R3 will be the worst case load presented to the input buffer and eq opamps (the latter in parallel with the input impedance of the circuit you connect the EQ to). They use 3k, there are many decent opamps that will happily drive ~2k without too much THD. YMMV.
  • To get the value of C2 closer to a standard one, you can tweak Q, which is generally not critical. Increase Q to decrease C2 and vice versa. This will also affect C1, but once you have C2 where you want it, you can tweak R1, which will affect C1 but not C2. Increase R1 to decrease C1 and vice versa.
The sim file is attached. As always, comments welcome!

Edit 7-Nov-2024: Sim file for version V2 (see post #10) attached.
 

Attachments

Last edited:
Many thanks Mooly, glad you find it interesting. I don't know if most people already know this, but for those who don't, I'll explain the trick I used to get the value of the calculated parameters displayed in the simulation (which btw I stole from the Linkwitz-Riley Transform example provided with LTSpice):
  • Add a voltage source
  • Ground the negative
  • Add a short wire to the positive (this is required)
  • Set the DC voltage to {parameter} (you can also set it to a mathematical expression if you like, such as {(param1+param2)/2})
  • Run the simulation once (also required)
  • Right-click on the schematic background and select Draft -> .op Data Label (this option doesn't appear if you haven't run the simulation)
  • Place the data label at the end of the wire (for some reason you can't place it directly at the output pin, hence the required wire)
  • Run the simulation again and the value of the parameter is displayed as a voltage
 
Ok, about those pots... First of all, let's have a look at what the response looks like if I just replace the pot with a linear one, i.e. the step values of Ra are 1, 5k, 10k, 15k, 19.999k (in case you're wondering, the reason for [1 ... 19.999k] instead of [0 ... 20k] is that LTSpice complains if you set a resistor to 0 via a parameter), the rest is as the one shown in the first post:

Lin pot pre-tweak.png


The half-way points are at just +/-1.8 dB, so most of the action is going to be bunched up towards the extremes, not very useful. Now, if you think about it intuitively, the reason this happens is that the effect of the resonant filter doesn't become significant until the portion of the pot between the wiper and each end becomes of the order of the R3 resistors, so the solution is to increase R3 and/or decrease the pot value. For example, with R3=6.8k and 10k linear pots, we get this:

Lin pot tweaked.png


That's around +/-4.5 dB at the half-way points, not as good as the W-taper pots but much better and definitely workable.

The problem with this is that, once you put a few sections together, there's a lot more interaction between them, in particular the gain of each section drops much more and the Q gets significantly narrower compared to what you get for each isolated section in the calculator.

I'm in the process of designing a 5-band EQ with both types of pots aiming at a similar response, just to get a better idea of how much you have to tweak the gain and Q values in the calculator to get what you want in the actual EQ. Watch this space.
 
Great. After a first "wtf" yesterday about it I got it then. 🙂

But:
I tried your asc-file. Here the simulation runs except after the simulation is ready there are no .op Data values shown.
It is also impossible to place other .op data labels. (-> right click in circuit window -> view -> place .op Data label is grayed/disabled)
In my other own asc-files this doesn't happen.
How can I fix this?

ScreenShot.jpg
 
Last edited:
All I can think of is a backwards compatibility issue, since it looks like you're using LTSpice IV and I'm on version 24. Try this: delete the data labels, save / close the file, open again, run, add the data labels, run. Does it work now?
 
In the meantime, I've been tinkering around a bit with LTSpiceIV and this circuit. The result is that if I simply add a diode/transistor/opamp to the circuit, with no connection other than one leg to ground, the .op data label is displayed correctly. Weird!
Then it's also possible to add .op data labels.
I'm attaching my asc file below.
I've changed some values to match and check an existing equalizer circuit I have.
And I've changed the R2/C1/C2 data display to make it a bit convenient.

ScreenShot.jpg
 

Attachments

5-band EQ with 20k W-taper pots

The centre frequencies are 40, 160, 630, 2.5k, 10k and the aim is to get a range of +/-12 dB for each band. After some trial and error, in the calculator I've set Gain_dB to 15.1 (you can tweak this slightly to get R2 close to a standard value, in this case 470) and Q to 0.85, because in the NS Handbook they recommend to use 1.7 for the calculations for a 10-band EQ, so this is half the Q -> twice the bandwidth per band. In the attached simulation I've separated the middle band pot, Ra-Rb, from all the others, Rc-Rd, so we can try different EQ settings.

First, we set Rc=Rd=10k to see the response of the middle band with all the others set to 0:

5-band Graphic EQ W.png


So we get the desired +/-12 dB and a reasonable-looking Q. The half-way points are slightly reduced to ~ +/-5.5 dB.

Now to see the ripple with all bands at maximum / minimum, we set Rc=Ra and Rd=Rb:

5-band Graphic EQ W ripple.png


In the NS Handbook they aim at keeping the ripple within +/-2 dB, here it's within +/-1.5 dB.

Those are the plots shown in the NS Handbook, but just for fun, let's set Rc=Rb and Rd=Ra to see what happens if we reverse the middle band, i.e. we boost it while cutting all others and vice versa:

5-band Graphic EQ W reversed.png


As expected the maximum boost/cut is reduced, in this case to about +/-9 dB, but still a useful range.

Sim file attached. Next: let's see what we can do using linear pots.
 

Attachments

5-band EQ with 10k linear pots

Same requirements as above, with R3=6.8k and 10k linear pots. Again after trial and error, in the calculator I ended up setting Gain_dB to 17.6 (which gives R2=1k) and Q to 0.77 to compensate for the significant narrowing in the full circuit. Same plots as above, sim file attached:

5-band Graphic EQ Lin.png


5-band Graphic EQ Lin ripple.png


5-band Graphic EQ Lin reversed.png


In the end it's pretty similar to the other one, the main difference being that the final gain range of the half-way points is about +/-3 dB, which might be ok, up to you to decide if being able to use cheaper and easier to find pots makes up for it.

I've tried increasing R3 even more but the improvement is marginal and the interaction between bands more significant, I think this could be a good compromise. Anyway, the calculator is there for you to play with, have fun!
 

Attachments

I've just made a version V2 of the calculator, sim file attached to post #1. Here the actual gain, centre frequency and Q are also calculated for the components used in the circuit on the right. This way you can see how much your gain, Fc and Q deviate from the calculated ones when using standard values. Instead of entering the chosen values into each component, you edit the parameter list at the top right, which I find more convenient. Of course you can also use it simply to analyze an existing circuit, like most gyrator calculators you find online.

Gyrator calculator V2.png
 
I have added you to the LTspice thread 🙂 Post 1.


Screenshot 2024-11-07 102457.png
 
  • Thank You
Reactions: cabirio
In the 1980s I built a stereo 10-band equalizer with rotary potentiometers based on a board kit from Conrad. This uses exactly the circuit shown in this thread.
The op-amps were µA747 (dual µa741). Some of the ICs were now defective and I wanted to replace them with others. However, µA747 has an unusual pinout. I initially considered making adapter boards to use ICs with a common pinout such as NE5532 etc. on the existing board. But in the end I designed a completely new board for the equalizer that fits into my existing case and front panel layout and allows the use of dual op-amps with standard pinouts.
I am making the Gerber files available to the DIY people here. Take it as a Christmas present.😉

EQ-circ-r05.jpg
EQ-sc-r05.jpg
 

Attachments

  • Like
Reactions: cabirio