Help needed: Linkwitz-Riley frequency response curves

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hello all,

I'm Yanni, new to this forum, and new to the audio electronics "disease". The bug stung very recently but it was one nasty sting. I didn't expect that. I thought registering in an appropriate internet forum would be a great idea. The name and looks of this one seemed the best, cause there's more than a few out there.

Now as to why I'm making my first post here: I need some frequency response curves for the Linkwitz-Riley crossover, 24dB/octave version. I need 5 graphs, for 60Hz, 70Hz, 80Hz, 90Hz, 100Hz crossover frequencies, or as many of them as I can get. It's important that I have a vertical window of 0 to -50dB.

Could someone measure their device with a program like HOLMimpulse and post the resulting (double) graphs? I do have the program but not an LR crossover sadly, at any of the aforementioned frequencies.

A related question, is there some kind of program that can produce this output virtually? Meaning not doing a frequency sweep of an actual device but virtually doing the same process on a virtual device? If you have in mind anything even remotely related to this, please let me know.

Thanks for any help/insights provided.
 
Thanks for the responses guys.

Because my knowledge of math (especially complex math) is a bit rusty, I 've just downloaded and installed LTspice and will go down that route.

Thankfully, Elliott Sound Products provides a utility that shows the filter circuit and also calculates resistance and capacitance for a given cutoff frequency. So I have everything I need handy:

An externally hosted image should be here but it was not working when we last tested it.


Now I need to get acquainted with LTspice, put the circuit together, and get my curves. I 'll keep you guys posted.
 
Now I need to get acquainted with LTspice
I think you will find that the time you spent learning to use LTSpice was well worth it. It's an amazing piece of software that opens up all sorts of otherwise-difficult design possibilities, filter design being one very good example.

I was in your shoes a few years ago, and I found Simon Bramble's LTSpice tutorials incredibly helpful: LTspice Tutorial | The Complete Course

Good luck!

-Gnobuddy
 
Thanks (Gno)buddy! I wholeheartedly thank you for the tutorial link, because last night I managed to build the LPF portion of the filter but hit a brick wall while trying to run an AC simulation. I hope the tutorial will solve my issues. If I get really stuck I may ask you guys/gals for assistance.

Resounding success!

I only had to read up to the first part of the tutorial. Upon starting the simulation, the frequency/phase response window appeared, but with no output. All I had to do is touch the probe to the output of my circuit:

lr%20lpf%20circuit.png


lr%20lpf%20frequency%20response.png


If I may ask a couple of quick clarifying questions:

The way I see this, it is a simple front end to build circuits that are simulated using a back end engine accepting directives.

Building the circuit, I could not find any of the common op amps used in LR designs I find around the web. Moreover, most op amps had 5 pins and not 3. So I thought simply and used a simple ideal component named just "opamp":

opamp.png


However, when I tried to run the simulation, I got the following error:

error.png


It only got resolved when I used the ".op" button to add ".lib opamp.sub" on my schematic. To be honest I find it strange that things like directives or the AC sweep settings are written on the schematic, as they can be perceived as comments.

I'm just curious what this opamp related directive does and why it is necessary. (I suspect "real" opamp models do not need anything like this).

Also, is there a way to have just the magnitude and not the gain on the Bode plot?

Thanks.
 
Resounding success!I only had to read up to the first part of the tutorial.
Congratulations! :)
All I had to do is touch the probe to the output of my circuit:
An externally hosted image should be here but it was not working when we last tested it.
I don't see an image there, only a broken link. If you hosted the images elsewhere, are permissions set for public viewing?

One way to avoid these sorts of headaches is to upload images directly to this forum itself. (Click the "Go Advanced" option, and you will see a "Manage Attachments" button that lets you upload images and some other types of files.)
The way I see this, it is a simple front end to build circuits that are simulated using a back end engine accepting directives.
Indeed! The original SPICE was written in the early 1970s by a graduate student (Laurence Nagel) at Berkeley University. It was written using public funds (university money), and the author very farsightedly licensed it in a way that made it public - not only open source, but completely free of restrictions on usage.

There have been (and still are) many proprietary versions of SPICE since then - corporations that take the free gift Laurence Nagel and Berkeley University gave the world, add a user interface, lock it up, and charge money for it.

Linear Technology Corp. took a different tack. They too took a free version of SPICE and developed it for internal use by their own engineers. But then they also made it freely downloadable; it's not Free or Open Source software because the source code is still secret and proprietary, but it is free in the sense that you don't have to pay money for it.
Building the circuit, I could not find any of the common op amps used in LR designs I find around the web. Moreover, most op amps had 5 pins and not 3.
Yes, Linear chose to provide mathematical models only for the chips they manufactured.

Fortunately, you can add external models, and Google will usually turn up the one you need. I tend to use only two types of op-amps in my own circuits, the NE5532 or the TL072. I found models for both online, and insert them into my LTSpice simulations as needed.

You can even find models for vacuum tubes, though many are of dubious accuracy. The attached image shows a simulation I did recently as part of a discussion on the proper way to choose the value of the cathode bypass capacitor in a typical tube guitar amplifier preamplifier stage.

(There is a wrong formula that is widely used, and this simulation shows what's wrong with that formula. If the formula was correct, both gain stages would have the same identical frequency response. The simulation shows that this isn't even remotely true. Ergo, the formula is wrong!)

For more information on how to use external models with LTSpice, look no further than part 4 of Simon Bramble's LTSpice tutorials: LTspice Tutorial: Part 4

...I find it strange that things like directives or the AC sweep settings are written on the schematic...
I find that strange, clunky, and inelegant, too. But LTSpice is the proverbial gift horse - so I don't look it in the mouth too closely! :)

I'm just curious what this opamp related directive does and why it is necessary.
As far as I know, this tells LTSpice where to find the mathematical model of the particular op-amp you are using. That model will include equations describing such things as the open loop voltage gain of the op-amp at DC, and the poles and zeros that define the open-loop frequency response.

...is there a way to have just the magnitude and not the gain on the Bode plot?
Yes! Here's how:

1) Hover the mouse over the vertical scale at the right end of your Bode plot (the one marked in degrees). The cursor will change to a vertical ruler.

2) Left-click. A small panel titled "Right Vertical Axis" will pop up.

3) Left-click on the "Don't Plot Phase" button. The phase curve will disappear from your plot, and only the magnitude curve will remain.


-Gnobuddy
 

Attachments

  • 12AX7_Cathode_Bypass_Cap_Sims.png
    12AX7_Cathode_Bypass_Cap_Sims.png
    55.4 KB · Views: 100

PRR

Member
Joined 2003
Paid Member
>...no output. All I had to do is touch the probe to the output of my circuit
> I could not find any of the common op amps ...used a simple ideal component named just "opamp":...used the ".op" button to add ".lib opamp.sub"
> I find it strange that things like directives or the AC sweep settings are written on the schematic, as they can be perceived as comments.
> a way to have just the magnitude and not the gain on the Bode plot?

How would you test a real filter? "Touch" your ACVM to the point you want to know about.

SPICE intrinsically knows R L C D BJT JFET MOSFET and some ideal parts. (This is more or less ALL we had at the time SPICE was written-- it was SPICE which made possible/easy to plan large-scale integrated circuits.) Anything more has to be explicitly "called". While some sims have a large list already included, this gets awkward and can be in-the-way. An RF or Logic designer has no use for hundreds of opamps she will never use. (And LT has chips they need to sell to stay in business.)

My (far older) sim does not scribble sweep settings on the sheet. But me/others may NEED to know those settings. For posting I often have to scribble them on by hand.
https://i.postimg.cc/0NXnpJ4N/Fetzer-sim-1.gif
Here I scribbled the "2V peak" next to the .tran signal source. This old sim sets that in a separate window which clutters my display. On others I have crayoned sweep parameters etc.

My sim does put "stuff" I don't want to see. Usually I can drag them out of sight.

Magnitude IS gain. Maybe you don't like phase? (It is often moot in audio.)
 
"crayoned scribbled sweep" ....love the imagery !!

I will rest happily tonight knowing the world is better for this imagined reality...
Terry Pratchett would approve your rationale....

Seriously...I am always enlightened by your posts and often entertained by their wit...! :)

Best regards,
Bob
 
Last edited:
How would you test a real filter? "Touch" your ACVM to the point you want to know about.

As I am new in LTspice, I thought just labelling my output would automagically include that label in the frequency response graph during simulation.

Magnitude IS gain. Maybe you don't like phase? (It is often moot in audio.)

Sleepy at the time of writing the post last night, I obviously meant phase. It cluttered my display. :)

===

Thanks @Gnobuddy, I thought the forum did not support picture hosting. Including the previously posted pictures for completeness. Also my final LTspice circuit should anyone want to play with it.
 

Attachments

  • error.png
    error.png
    20.7 KB · Views: 67
  • opamp.png
    opamp.png
    51.8 KB · Views: 76
  • lr lpf frequency response.png
    lr lpf frequency response.png
    19.1 KB · Views: 75
  • lr lpf circuit.png
    lr lpf circuit.png
    9.4 KB · Views: 73
  • esp-lr.png
    esp-lr.png
    53.6 KB · Views: 97
  • LR 24dB.asc
    3.7 KB · Views: 45

PRR

Member
Joined 2003
Paid Member
...I thought just labelling my output would automagically include that label...

It isn't smart enough to know what "output" means. In the sim image I posted, I had to place the circle-arrow thingie to easily get a plot of that point.

Yes, I could also type a "command line" into PROBE to get data about an arbitrary un-labeled un-pointered point.... the syntax does not come to my fingers that easy.

(All this plotting stuff is "outside" SPICE, traditionally in a module called "PROBE". Which originally printed ASCII characters on greenbar paper. The input to SPICE was originally punched-cards, and remnants of that technology can still be found in the internal workings. Also it comes from an era when not all terminals had lower-case characters. When FORTRAN was the only good way to work formulas. Yes, SPICE was soon re-written in C, but it had to preserve many FORTRAN conventions to keep compatibility.)
 

Attachments

  • PSPICEOP.jpg
    PSPICEOP.jpg
    44.2 KB · Views: 98
Last edited:
...originally printed ASCII characters on greenbar paper...
A version of Spice that printed ASCII characters to a text terminal (in lieu of graph paper) was still available on Linux a few years ago. I think it's still available today.

There are a few truly Free (no cost, open source) graphical frontends too. I haven't tried using any of them, though.

If LTSpice had been open-source, it would be looking and working much better by now. As it is, it feels like a view back to the aesthetics (using the word loosely) of Windows 95. Thick-bordered windows in a fetching shade of mouse-fur grey, jagged fonts, clunky icons, et cetera.

Looks may be only skin deep, but there is one LTSpice bug that, well, bugs me every time I use it: the utterly stupid algorithm for auto-scaling the graphical output. Much of the time it comes up with utterly unusable axis limits and intervals: from 43.7 dB to 47.1 dB in steps of 432 milli dB, for instance. :mad:

But the actual simulation engine works very well, however bad the GUI. I'm thankful for that, and for the people at Linear Technology who chose to make the program a free download (no doubt with the intention of encouraging engineers to design circuits using LT parts, but it ended up benefiting a much wider community of people.)


-Gnobuddy
 
Bugs me too. Every time I poke the running man I have to set proper axis parameters. But it's not that big a deal. My initial perception of its graphics capabilities was pretty horrendous and I was actually contemplating going down the complex math route to get my curves or use something like Matlab, Mathematica, etc.

It would be very interesting to find a strong open source version of this tool that included a rich library of components right after installation and that hopefully had a cleaner interface. I'm certain it's out there somewhere.
 
Every time I poke the running man I have to set proper axis parameters.
I have a tip that will make this slightly less tedious:

1) First, set the proper axis parameters by hand, as you've been doing.
2) Now left-click on the panel showing the graphical output. Some of the menu headings along the top left edge of the program will change - you will now see the item "Plot Settings".
3) Left-click on "Plot Settings", mouse down to "Save Plot Settings".
4) Give your settings file the name you want (ending in .plt), and click "Save".

Now, after you poke the running man again and LTSpice once again thoroughly screws up the axis scaling, you can repeat the process to recall your previously-saved plot settings (left-click graphical output, select "Plot Settings", and this time choose "Reload Plot Settings".)

This is still tedious, but not quite as tedious as having to reset all three y-axis parameters after every single run of the simulation engine.

It would be very interesting to find a strong open source version of this tool
A tonne of things with "spice" in the name pop up if I search my Linux distribution's package manager (see attached screenshot.) But I don't know if any of them is developed as far as LTSpice, or ideally, better.

Kicad - an open-source schematic-editor and PCB design program - now includes some circuit simulation capabilities too, I think. And they're probably based on the SPICE engine.

Kicad's origins go back to the 1990s, but researchers at CERN began using it and improving it about five or six years ago, and progress has been rapid since then.

If you find an open-source SPICE variant that is as good or better than LTSpice, please do let me know!

-Gnobuddy
 

Attachments

  • SPICE_choices.png
    SPICE_choices.png
    156.7 KB · Views: 92
Thanks for the plot settings tip.

From your screenshot, ngspice + ngspiceui may be a strong contender. ngspice is cross platform but apparently command line based, so the question mark is how good ngspiceui is.

I did a quick search earlier and found a tool called qucs that seems to be good, although it's not spice based (I think).

And a sweet quick link: gplEDA Homepage
 
I was actually contemplating going down the complex math route to get my curves or use something like Matlab, Mathematica, etc.
You could certainly do this with a relatively straightforward circuit such as your Linkwitz-Riley filters. But, depending on your electronics interests, sooner or later you will encounter a circuit too complex to break down into a complex-number polynomial fraction.

And when that happens, one starts to feel a deep gratitude towards Laurence Nagel and the Regents of UC Berkeley. :)

The attached screenshot shows one of my LTSpice simulations. A dozen carefully tuned damped sinewave generators generate a waveform approximating what you get when you pluck a guitar string; this waveform is scaled by a simulated op-amp, then fed to a simulated two-stage vacuum tube guitar preamp, and the resulting output waveform is computed. Finally, the output waveform is also turned into a WAV file that I can listen to.

What I found from this and similar experiments is that the DC bias levels in the triode stages fluctuate during the duration of a single guitar note; those fluctuations in bias translate to fluctuating amounts of distortion that add subtlety and richness to the guitar tone. The envelope of the note is altered too, rounding off the harsh initial attack.

You do not get these effects when you use an almost-perfect device like an op-amp to amplify the guitar signal. You also do not get them from the majority of guitar distortion pedals on the market, 99% of which use an op-amp and a couple of clipping diodes to generate unvarying, unsubtle, boring distortion.

I cannot imagine how much DIY code it would have taken to do something like this without SPICE - certainly I would never have taken on such a project!


-Gnobuddy
 

Attachments

  • valve_guitar_preamp_55.png
    valve_guitar_preamp_55.png
    81.1 KB · Views: 101

PRR

Member
Joined 2003
Paid Member
...A tonne of things with "spice" in the name pop up if I search my Linux distribution's package manager...

Many of them not "our" SPICE.

A lot seem to be "Simple Protocol for Independent Computing Environments", "allows users to view a computing "desktop" environment ... from anywhere on the Internet".

Easyspice and ngspice seem to be e-sims. NGspice is fairly well known. It harks back to planning your sim on paper and punching cards/lines (no schematic editor), although third party interfaces are available. Their Resources Page is worth a look.
 
I focused on ngspice last night, going through their resources pages. It seems to be a mature simulation engine and the good thing is that it is integrated in more complete software packages that provide luxuries like schematic editing. I started downloading eSim and KiCad last night but transfer was interrupted due to a battery outage. I 'll try to build the same circuit for the LR crossover in both of them, see how well they work (or not).

Speaking of the LR crossover, I decided to snatch a cheap implementation of it for further experimentation. Sadly, the good people in the far east that sell it seem to not know what they are selling:

lr.png

My specific query is about powering the unit. Their product description states:

"8. AC adapter power supply range Dual 14 to dual 19V"

Now, I can not understand if this means a regular center-tapped-secondary transformer (+-15V AC) or simply +-15V DC.

Can you guys tell by the looks of this board which case it is? Because honestly I do not expect a reliable answer from the seller. If the power input is +-15V AC there should be additional components for DC conversion to feed the opamps.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.