diyAudio

diyAudio (https://www.diyaudio.com/forums/index.php)
-   Analog Line Level (https://www.diyaudio.com/forums/analog-line-level/)
-   -   Help needed: Linkwitz-Riley frequency response curves (https://www.diyaudio.com/forums/analog-line-level/341544-help-linkwitz-riley-frequency-response-curves.html)

yannikab 16th August 2019 02:47 PM

Help needed: Linkwitz-Riley frequency response curves
 
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.

DF96 16th August 2019 04:14 PM

Acccording to Wikipedia a Linkwitz-Riley filter is just two Butterworth filters cascaded. For 24dB/octave you just need to do the curve for two 12dB/octave Butterworths (e.g. two pole). Any spreadsheet should be able to do it.

aboos 16th August 2019 08:47 PM

If you know how to calculate filters (Rs and Cs in a simple OPAM filter circuit), you can simply download (for free) the LTSpice analog circuit simulation SW tool and generate all frequency curves you are intersted in.

yannikab 16th August 2019 09:18 PM

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:

https://am3pap002files.storage.live....543&height=589

Now I need to get acquainted with LTspice, put the circuit together, and get my curves. I 'll keep you guys posted.

Gnobuddy 17th August 2019 02:14 AM

Quote:

Originally Posted by yannikab (https://www.diyaudio.com/forums/analog-line-level/341544-help-linkwitz-riley-frequency-response-curves-post5886356.html#post5886356)
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

yannikab 17th August 2019 05:24 PM

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:

https://a3f4yq.am.files.1drv.com/y4p...uit.png?psid=1

https://a3f4yq.am.files.1drv.com/y4p...nse.png?psid=1

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":

https://a3f4yq.am.files.1drv.com/y4p...amp.png?psid=1

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

https://a3f4yq.am.files.1drv.com/y4p...ror.png?psid=1

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.

Gnobuddy 18th August 2019 01:19 AM

1 Attachment(s)
Quote:

Originally Posted by yannikab (https://www.diyaudio.com/forums/showthread.php?p=5887210#post5887210)
Resounding success!I only had to read up to the first part of the tutorial.

Congratulations! :)
Quote:

Originally Posted by yannikab (https://www.diyaudio.com/forums/showthread.php?p=5887210#post5887210)
All I had to do is touch the probe to the output of my circuit:
https://a3f4yq.am.files.1drv.com/y4p...uit.png?psid=1

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.)
Quote:

Originally Posted by yannikab (https://www.diyaudio.com/forums/showthread.php?p=5887210#post5887210)
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.
Quote:

Originally Posted by yannikab (https://www.diyaudio.com/forums/showthread.php?p=5887210#post5887210)
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

Quote:

Originally Posted by yannikab (https://www.diyaudio.com/forums/showthread.php?p=5887210#post5887210)
...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! :)

Quote:

Originally Posted by yannikab (https://www.diyaudio.com/forums/showthread.php?p=5887210#post5887210)
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.

Quote:

Originally Posted by yannikab (https://www.diyaudio.com/forums/showthread.php?p=5887210#post5887210)
...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

PRR 18th August 2019 02:37 AM

Quote:

Originally Posted by yannikab (https://www.diyaudio.com/forums/showthread.php?p=5887210#post5887210)
>...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.)

DRONE7 18th August 2019 07:51 AM

"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

yannikab 18th August 2019 01:44 PM

6 Attachment(s)
Quote:

Originally Posted by PRR (https://www.diyaudio.com/forums/analog-line-level/341544-help-linkwitz-riley-frequency-response-curves-post5887644.html#post5887644)
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.

Quote:

Originally Posted by PRR (https://www.diyaudio.com/forums/analog-line-level/341544-help-linkwitz-riley-frequency-response-curves-post5887644.html#post5887644)
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.


All times are GMT. The time now is 07:28 AM.


Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 17.65%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Copyright ©1999-2020 diyAudio

Wiki