importing transfer functions into LTSPICE? - Page 1
Forum section: electronics / projects

author: CopperCone
author_rank: Super Contributor
timestamp: July 09, 2018, 02:46:30 am
content: If I were to figure out how to get decent accurate plots out of my VNA for various parameters on components I want to use for things like filters, can I put them into LT spice some how? To get more realistic results at higher frequencies (I am interested in up to say 100MHz).When I start messing with the parasitics I get kind of strange results which make me want to do alot of lab work (just changing Q or whatever in a simulation that supports it causes results that are baffling to me). I wonder if I can reduce that some or at least use simulations as a more advanced learning tool. This would mainly be for categorizing home made magnetic and some 'close' value capacitors. Then I could be more confident what will happen if I buy similar parts.Also would motivate me more towards making fixtures for parts testing for my VNA if I could get more use out of it or possibly help in justifying a impedance analyzer (which is cool but has seriously limited uses IMO, I can't do anything with that graph), I have my suspicions that the VNA is not the best tool for the job in terms of component categorization.I was hoping that if I tame all the usual parasitics like ESR etc, I can focus on seeing the effects of components interacting with each other through fields in space or chassis, ground plane effects too, when I actually build a prototype. Right now its rather confusing and a bit heavy on the wallet for higher order filters, where design complexity increases alot. Is ease of learning a realistic expectation or am I going on a wild goose chase?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 09, 2018, 07:30:57 am
content: Yes. You need a rational polynomial best-fit to the curve. This directly translates into RLC values for whatever network is used to express it (usually a ladder network).Tim

author: Nitrousoxide
author_rank: Regular Contributor
timestamp: July 09, 2018, 12:23:46 pm
content: If you have access to Matlab and the system identification toolbox, that will allow you to generate a transfer function given measured data. It's great for approximating mathematical models of control and other higher order systems. If you don't then you will simply have to curve fit, which will only give you a result with zeros.Once you have a transfer function, from the pole-zero factorisation you can form cascaded filter segments.You can easily mathematically convert between scattering and impedance parameters. (VNA as impedance analyser).Simulations are only as accurate as the model. You would have to account for extra parasitics yourself (i.e. component lead resistance).If you're more interested in component level simulation and design, you should consider other numerical simulators such as finite element analysis instead of SPICE.

author: Cerebus
author_rank: Super Contributor
timestamp: July 09, 2018, 02:18:19 pm
content: Take a look athttp://ltwiki.org/index.php?title=B_sources_(complete_reference). Then search for further examples of the kind of functions that you want to use (e.g. laplace). To say that it is all ratherthinly documented is a bit of an understatement...

author: CopperCone
author_rank: Super Contributor
timestamp: July 09, 2018, 06:43:14 pm
content: Quote from: Nitrousoxide on July 09, 2018, 12:23:46 pmIf you read the agilent documents about impedance analyzers vs network analyzers you will see that they are not necessarily the best tool for the job and the errors get large when you deviate from 50 ohms. I had trouble measuring some inductors I made but I think I had it hooked up wrong in my rats nest of cables I will give that another go.I was hoping I could upload a frequency/vs parameter CSV file into LT spice or something, doing all that stuff with matlab infuriates me. I was hoping there was direct functionality or a script that can take something like a CSV file and make it into a component.It kind of sounds like this will almost work with a CSV file"* The transfer function of the Freq circuit element is specified by an ordered list of points of freq(Hz), mag(dB) and phase(deg) as follows: <(f1,m1,p1)[(f2,m2,p2)...]> where f1<f2<f3, etc. The following units specifiers may optionally precede the Freq keyword: “rad”=radians, “mag”=non dB, (“dB” and “deg” return the defaults), “r_i”=real and imaginary in place of magnitude and phase. If a delay value is called out, the phases of the table values are modified to reflect the delay (delay is automatically adjusted to maintain causality in any case). "What would be a good way to autofill my CSV into the string that they want for the file? I think my VNA does 4kpoint.Also, how does that simulator handle missing frequencies? Like I can't even give it real data past some frequencies.. does it just not do calculations on those? So long I put bounds on the simulation I mean, it wont ask for that data in some kind of check/loader routine?

author: Nitrousoxide
author_rank: Regular Contributor
timestamp: July 10, 2018, 05:30:31 am
content: Quote from: CopperCone on July 09, 2018, 06:43:14 pmIf you want to model it as a network of conventional passives, you have to get the transfer function. There may be a program/script out there that goes straight from complex data to a passive network, but I am unaware of such.I would still adamantly recommend using some form of system identification tool to get the transfer function in the Laplace domain as it opens up greater avenues for mathematical analysis.It looks like the B source only accepts functions as parameters, not discrete data sets. If that is the case, then a curve fit/approximation will still have to be performed. Either way, I'm sure this can easily be achieved in python or your personal flavour of language.So, from a bit of reading. It seems that LTspice performs convolution to get the result from the arbitrary process, it does this by performing it in the frequency domain (FFT).QuoteMy guess is that there is no interpolation and you are bound by the fft spacing. There is mention of LTspice having analytical solutions to certain responses, but I don't know if that's for arbitrary data or functions.

author: bson
author_rank: Unknown
timestamp: July 10, 2018, 07:06:03 pm
content: You can also use ngspice with XSPICE support; it has a block for S-domain transfer functions where you enter the nominator and denominator polynomials in table form.

author: CopperCone
author_rank: Super Contributor
timestamp: July 10, 2018, 07:31:23 pm
content: bobbins it is I am NOT dealing with this shit on private timepythons belong in the jungle, but I don't really like snakes, so I figure they belong in the scope of a hunter. Horrid animals. The poisonous ones at least have SOME dignity as the poison is fast acting. Why do you name a programming language after a horrible animal that kills horribly? Then again I guess unless there is threat of detection or injury animals are dickheads in generalI do wonder however if its human interaction that makes big cats not always focus on killing their prey first, perhaps there is too little threat of outside packs to encourage the 'humane' behavior to maintain strealthyness now that we packed them all into reservations. Maybe would explain how the 'noble lion' idea is now considered a myth due to human expansion.anywaymy flavor of language is cursing at shoddy lab equipment