As I was investigating tweaks to an onboard bass preamp with a 3-band tone control here, I found LTSpice (of which otherwise I'm a big fan) rather frustrating: there's a lot of interaction between all bands and components, every time you have to enter a component value, rerun the simulation and see what it does, even if you step it you more or less have to guess which values will make sense, and often you have to adjust two or more components at the same time to get what you want.
So, I decided to make an Excel spreadsheet where you can adjust all components quickly with spinners and see immediately the effect on the frequency response. It started small but, well, you know how it goes: one thing led to another... Anyway, I thought some of you might find it useful, so here it is (see attached):
Some random comments:
Cheers,
Cabirio
Edit 9-Dec-24: Version 1.1attached. Just a small correction (no effect on calculations and plots): the "2B", "3B C" and "3B S" style labels just below the "Swap" buttons didn't correspond to the actual style, now corrected.
Edit 13-Dec-24: Version 2.0 attached. A couple of features added, see post #5 below for details.
So, I decided to make an Excel spreadsheet where you can adjust all components quickly with spinners and see immediately the effect on the frequency response. It started small but, well, you know how it goes: one thing led to another... Anyway, I thought some of you might find it useful, so here it is (see attached):
Some random comments:
- All calculations (based mainly on Wye-Delta and Delta-Wye transforms) are done in Visual Basic and I've included plenty of comments, but unless you can read code, it may be difficult to figure out how it's all calculated. If someone is interested, I'll be happy to explain.
- At the top left you have a drop-down list with three options: 2-Band, 3-Band "Classic" and 3-Band D. Self. The schematic shows the two 3-band topologies, the 2-band is the same as the "Classic" without the mids control. What I mean by "D. Self" is the one that @DouglasSelf shows in "Small Signal Audio Design" 2nd. edition, Fig. 15.31. I don't know if it's his design but I haven't seen it anywhere else, so I assume it is. The "Classic" is one of several other topologies you will find, I chose it because it's the one used in the bass preamp I mentioned and it's the closest to the Self one, as shown in the schematic it's trivial to change between them.
- As I was playing with it, often I found myself arriving at something reasonable, then screwing it up trying to improve it and not remembering what was the last good set of component values, so I added a couple of places where you can store what you have so you don't lose it as you keep tweaking. Then you can swap either of them with the current design. For illustration purposes, I include one each of the three topologies modelled.
- The "Min. Input Z" shown corresponds to the bass control at 0 and treble at max for the 2-band and bass at max, mids at 0 and treble at max for both 3-band options. I've found that this is the worst case. It's also the worst case feedback impedance with the controls at min instead of max, but in a real circuit you will also have whatever load impedance the opamp sees, so once you're happy with your design, you would take it to LTSpice, include the rest of the circuit and see what the real load impedances are.
- I think the rest is pretty much self-explanatory, but that may well be because I made it... Play with it, see if it makes sense and I'll be happy to explain anything that isn't clear.
Cheers,
Cabirio
Edit 9-Dec-24: Version 1.1
Edit 13-Dec-24: Version 2.0 attached. A couple of features added, see post #5 below for details.
Attachments
Last edited:
Hi Cabirio,
It looks great!
I've tried to run it under LibreOffice Calc but it complains about syntax errors. Are there some particular settings that need to be changed to allow it run under LibreOffice Calc?
Thanks, Ralph
It looks great!
I've tried to run it under LibreOffice Calc but it complains about syntax errors. Are there some particular settings that need to be changed to allow it run under LibreOffice Calc?
Thanks, Ralph
Hi Ralph, I'm not familiar with LibreOffice, but perusing their help page, you may want to try this:
https://help.libreoffice.org/latest/en-US/text/sbasic/shared/vbasupport.html
Note the mention to a "limited support for VBA statements, functions and objects", so I'm not sure it will work, the VBA code is rather long and complicated...
https://help.libreoffice.org/latest/en-US/text/sbasic/shared/vbasupport.html
Note the mention to a "limited support for VBA statements, functions and objects", so I'm not sure it will work, the VBA code is rather long and complicated...
@ralphs99, did you manage to make it work? If not, I have a spare computer where I'd be happy to install LibreOffice and give it a try.
Version 2.0 is out (attached above). I've added a couple of things:
Version 2.0 is out (attached above). I've added a couple of things:
- Among the various topologies you will find out there, probably the most common variation of the 2-Band and 3-Band Classic ones is to have two resistors at either side of the treble pot instead of a single one in series with the treble cap. These are available now in the drop down list as 2-Band Alt. and 3-Band "Classic" Alt. (I realized it was straightforward to get these with just a few extra lines of code, so why not). They do have a slight advantage in that, for similar responses, the input and feedback impedances are higher, which may be useful depending on the pot values and opamp you want to use. When you select either of these, the schematic changes accordingly.
- There's a "Fix" checkbox now next to the variable pots. What this does is freeze whatever variable response you have and change its colour to grey instead of orange. To release it, uncheck the box or adjust any of the pots. I've found this very useful if you have a design you like but want to tweak something, e.g. increase the Q of the mids control. You set the pots to 0 / +10 / 0, fix it and then tweak the components while comparing the responses visually in the plot, rather than looking at the calculated values. I find it quicker and more intuitive this way:
Hi Cabrio,
No, unfortunately, I can't get version to work under LibreOffice Calc, it throws syntax errors in the VBA Module
Cheers, Ralph
No, unfortunately, I can't get version to work under LibreOffice Calc, it throws syntax errors in the VBA Module
Cheers, Ralph
Well, the syntax error part was easy (LO Basic doesn't like functions with return type Double() but changing them to Variant fixes it) but it's so painfully slow as to be pretty much useless, in Excel the plot updates instantly when you change something and in Calc it takes a few seconds... I'll investigate further, maybe I'll try compiling the main calculation function in C to a DLL. Are you in Windows?
Before anything else, I tried reducing the number of data points a lot (from 169 to 11) and it doesn't help at all, so it isn't the calculations, it's probably something about the conversion of VBA to LO Basic, especially the procedures that read from and write to the worksheet, I suspect. As I don't know LO Basic, first of all I'll try reducing the number of worksheet access procedures as much as possible (I didn't bother optimizing this in Excel too much because it works so well as it is) and see if there's some improvement...
Ralph, could you take a look at the attached spreadsheet and see if a) it works in your system and b) you find it usable as it is? To make it work I had to remove some things like selecting different frequency ranges, fixing the variable plot and showing a different schematic for the Alt. topologies, but other than that, it works just like the Excel version. I've optimized the calculation loop as much as possible but, at least in my system (Ryzen 5 4600G), it's still rather slow, I suspect there's still some VBA -> LO conversion going on behind the scenes that's slowing it down. On the other hand, maybe I find it too slow in comparison to the Excel one but it's actually fine as it is... Anyway, let me know what you think.
One other thing I had to do was to resize all spinners and buttons to align them with the corresponding cells, this is what it should look like now:
One other thing I had to do was to resize all spinners and buttons to align them with the corresponding cells, this is what it should look like now:
Attachments
Hi Cabirio,
Great work, it runs and updates reasonably quickly (<2s) when changing component values, and that's fast enough for me.
The schematic doesn't change when selecting a different tone control type, is it meant to?
As you mentioned, the 'Fix' checkbox is gone, but not having seen it in operation, I don't miss it
I do miss the ability to change frequencies and have the program calculate component values, I assume that functionality is available in the Excel version?
Cheers, Ralph
Great work, it runs and updates reasonably quickly (<2s) when changing component values, and that's fast enough for me.
The schematic doesn't change when selecting a different tone control type, is it meant to?
As you mentioned, the 'Fix' checkbox is gone, but not having seen it in operation, I don't miss it
I do miss the ability to change frequencies and have the program calculate component values, I assume that functionality is available in the Excel version?
Cheers, Ralph
- Home
- Source & Line
- Analog Line Level
- 2 and 3 band Tone Control Modeller in Excel