Keyboard Shortcuts
ctrl + shift + ? :
Показати всі комбінації клавіш
ctrl + g :
Не доступний для безкоштовних груп.
ctrl + shift + f :
Знайти
ctrl + / :
Сповіщення
esc to dismiss
Лайки
Пошук
S-parameters in LTspice
#S-parameters
Hello,
It's very interesting that I don't find anything about this. Can it really be that there is no way to have an S-parameter block in LTspice? (I know that we can get S-parameters from ac analysis but I would like to insert a model based on s parameters). Of course, I can convert the S parameters to Z or Y parameters and use a two-port model for just one frequency but this feels pretty clumsy. Thanks, Lukas PS: I am aware of the limitations of such a block like frequency range which would need to be extrapolated somehow. But I found s parameter blocks in other spice simulators. |
Lukas wrote, "Can it really be that there is no way to have an S-parameter block in LTspice?"
Yes and no. LTspice itself does not take s-parameter files, but a separate utility program (s2spice) converts s-parameter data to SPICE subcircuits that LTspice accepts. https://groups.io/g/LTspice/files/z_yahoo/Tut/S-Parameter/S-Parameter%20to%20SPICE -> s2spice.exe, s2spice101.exe Andy |
Hello Dan
The subcircuit made from S-parameters are only usable in AC simulation. TheJust to be clear: the interpolation is piece-wise linear, so every point will be discontinuous in frequency, and its behaviour is that of Laplace expressions. This can be seen in the expanded netlist, where the inormation about the window and the nfft is displayed. Therefore, unless you have enough data points and you're lucky to have fairly smooth requency response, .TRAN will be messy. -- Vlad ______________________ ltspicegoodies.ltwiki.org v2: quite universal analog/digital filter, power electronics, signal processing, easy to work with math functions, digital models, and rants. |
On 31/10/2020 05:15, lukashaase@... wrote:
Just to make sure: Does LTspice, extrapolate and interpolate the frequencies? (In my simulation it seems it does; if I have a single line then it seems to be valid for all frequencies).As far as I remember, LTspice does linear interpolation, but doesn't extrapolate beyond the top or bottom of the dataset. All table-based data is treated the same: beyond the extent of the table, the first or last entry is held constant. -- Regards, Tony |
Dan wrote, "The subcircuit made from S-parameters are only usable in AC simulation."
That is incorrect. It works in .TRAN simulations too. It's my understanding that it works fairly well in .TRAN. This is in contrast with the other (documented) version of the Laplace function (arbitrary function of the Laplace variable 's'), which sometimes works and sometimes doesn't in .TRAN analysis. For some reason, the version that's used with these S2SPICE models, seems to work a lot better, at least when the S-parameter data is sufficiently wide and dense. re: "(I have a hard time finding the documentation for the "E" block with the FREQ format)" Me neither. I believe that this version exists for compatibility with another SPICE program, perhaps PSpice. I haven't looked yet, but you might find it documented there. Andy |
On 31/10/2020 13:34, Andy I wrote:
Tony wrote, "... but doesn't extrapolate beyond the top or bottom of the dataset. All table-based data is treated the same: beyond the extent of the table, the first or last entry is held constant."Perhaps "clamped" or "held" would have been a better description? -- Regards, Tony |
I have used S-parameters for transmission lines for both AC and transient signal-integrity simulations successfully. I create the S-parameters with these rules in a gnuplot program. The rules might help you get better SPICE simulations with S-parameters if you can figure out how to apply them to your application.
Dennis # Constraints for S-parameters to get accurate impulse responses with IFFT that avoid windowing and zero padding. len_vector=2.**15. # must be a power of 2 length_freq=len_vector/2. # S-parameter-to-SPICE Converter (S2SPICE 1.01) has an 110,000 frequency limit time_step=2.**-8.*prop_delay(f2) # time step (s) for IFFT; delay (s) is maximum propagation delay of transmission line at highest frequency for dielectric model ff_step=1./len_vector/time_step # frequency resolution (Hz) of IFFT ff_max=length_freq/len_vector/time_step # maximum frequency (Hz) used for IFFT ff_ideal=1./rise1090 # minimum maximum frequency (Hz) for IFFT; rise1090 is 10-90% rise/fall time (s) of input signal; is ff_max > ff_ideal? # IFFT constants for SPICE3 window=1./ff_step # frequency resolution (Hz) is reciprocal of window; use window as parameter in SPICE3 simulation nfft=ff_max/ff_step # nfft divided by window is the highest frequency (Hz) considered; use nfft as parameter in SPICE3 simulation ifft_max_freq=nfft/window # maximum frequency (Hz) used for IFFT (same as ff_max) |
A .tran analysis will run with FREQ Laplace sources. However, it's unlikely that the results of any significant circuit could be trusted to be accurate. The most common problem is that circuits created from S-parameters seldom represent the correct behavior at DC making it hard to get the analysis started at T=0. As Vlad points out, the piecewise linear interpolation used by LTspice does not give the best results.
However, for AC simulations LTspice is extremely accurate when simulating S-parameters converted with a tool like s2spice.exe. |
By the way, the rules also give me causal results.
To further clarify, len_vector is the length of the time-domain vector and length_freq is the length of the frequency-domain vector, which is the number of frequency points in the S-parameter file. ff_step is frequency spacing, which should be linear rather than logarithmic. For the Debeye dielectric model, f1 = Nyquist / 1E6 and f2 = Nyquist * 1E2 for reference to give you an idea of the frequency range. How IFFT works in SPICE3 is not defined that well. It can give strange results if the S-parameters are not frequency related to the signals being simulated. In my case, the Nyquist frequency and the bandwidth required for rise/fall times. The simulations can take a while, but sometimes a free tool such as LTspice is all that's available. The results I get compare to those of HyperLynx and ADS for the same S-parameter files. Dennis |
On 12/06/2024 10:26, Mirza wrote:
I have a question regarding this. If we have s parameter of a component (op amp as example), if we can convert it to spice model , can it work as am op amp in spice simulation?The short answer is maybe. I don't think I have never seen S-parameters for an opamp, although that doesn't mean they don't exist. However, you should know that S-parameters are linear and apply at fixed operating conditions (when active devices are considered). Sometimes they can be used in non-linear analyses, i.e. .TRAN, but things like supply voltage effects, slew rate, clipping, distortion, etc. cannot be modelled in S-parameters. Therefore, any SPICE model derived from S-parameters cannot model those characteristics either. S-parameters are treated a "black box". You are free to add passive components around them, and those effects will be modelled correctly. -- Regards,
Tony |
Mirza asked, "can we add other parameters with this such as voltage source, resistors, capacitors etc?"
I think it is best to not add voltage sources, resistors, capacitors, etc. as parameters. I think it is best if they are added as actual separate components. For example, a resistor should be added as a resistor, not as a parameter of an s-parameter-based model. But I do not know your specific case that you are asking about. I guess it could be done as parameters of the s-parameter-based SPICE model file. But I think that some of these additions (e.g., adding a capacitor or voltage source) probably necessitates re-converting the s-parameter data file into a new SPICE model after every change. Then, it is definitely better and easier to add the capacitor as an actual capacitor in the SPICE circuit, not as a parameter of the model. Everything Tony said about the S-parameter based model is 100% correct. Andy |
Actually I got s parameter files for a transimpedance amplifier.
What I did so far is, I converted this s parameter file to .lib file by running that exe converter in command prompt. Later I generated .olb file and also gor the spice model. Usually we put feedback resistor and feedback capacitor with the op amp spice model to make it transimpedance amplifier. Here, the s parameter files are for transimpedance amplifier. Thus, how to use this as TIA? Thank you so much. |
Mirza wrote, "Later I generated .olb file and also gor the spice model."
That has nothing to do with LTspice. The .olb file is not the SPICE model, but it is definitely not for LTspice. Are you sure you asked this question in the right forum? When you ran the S-parameter-to-SPICE conversion program, what you got was the SPICE model. re: "Thus, how to use this as TIA?" Um, the normal way. What did you try, and did it work? Bear in mind, the SPICE model from S-parameters is only as good as the S-parameters themselves, and only works over the frequency range and operating conditions of the S-parameters. Since most (well, actually all) S-parameters are ineffective at DC, you would not expect to get any meaningful simulation results for the DC conditions. Your questions also seem to be related to some sort of op-amp, with feedback components around it. I think it is highly unlikely that you got S-parameter models for an open-loop op-amp. Andy |
Thank you very much for your help.
According to your comments, "When you ran the S-parameter-to-SPICE conversion program, what you got was the SPICE model.", Yes, when I run the S-parameter-to-SPICE conversion program, I get a .lib file. So, do you mean that .lib file as spice model? Should I do in this way that, as I got the s parameter file for TIA, convert it to .lib file and choose a universal op amp and then .incl that lib file? I am sorry for my poor knowledge. And about the .olb file, I would like to tell you that I saw Pspice tutorial video to get spice model from .lib file is, at first make a .olb file and then create the symbol. Yes, this forum is for LTspcie not Pspice, though I wanted to know the basic procedures for LTspice whether this is similar or not. Also, I did not try how to use this as TIA yet. |
Повідомлення
Меню
Додаткові параметри
Більше
to navigate to use esc to dismiss