Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

S-parameter curves in LTspice

4,261 views
Skip to first unread message

Jeroen Belleman

unread,
May 9, 2014, 11:25:00 AM5/9/14
to
Call me dense, but after many years of using LTspice,
during which many times I inserted return-loss bridges
into my circuits to measure S11, someone pointed out
to me that LTspice has a directive for that.

Just insert ".net V1 v(out)" somewhere into the schematic,
and an S11 trace will become available.

I'm still missing some of the finer points however: The
resulting S11 only makes sense with the directive above.
The docs seem to say that it should be ".net v(out) V1",
but then the resulting S11 makes no sense that I can see.
With the latter form, I also get the three missing S-
parameters, as well as H, Z and Y parameters. S21 makes
no sense either. I don't know yet about the others.
If I insert ".net I(R1) V1", with R1 the output load, S11
is OK again. I'm puzzled. Maybe someone can shed some
light on this?

For the curious, below is the circuit I've been playing
with. It's a constant impedance O(6) Bessel low-pass
filter. It's more an exercise in filter synthesis than
a practical design...

Jeroen Belleman

Version 4
SHEET 1 1468 680
WIRE -96 -80 -144 -80
WIRE 16 -80 -32 -80
WIRE 64 -80 16 -80
WIRE 176 -80 144 -80
WIRE 288 -80 256 -80
WIRE 400 -80 288 -80
WIRE 464 -80 400 -80
WIRE 608 -80 544 -80
WIRE 736 -80 688 -80
WIRE 848 -80 736 -80
WIRE 896 -80 848 -80
WIRE 1104 -80 976 -80
WIRE 16 -32 16 -80
WIRE 288 -32 288 -80
WIRE 400 -32 400 -80
WIRE 1104 -32 1104 -80
WIRE 736 -16 736 -80
WIRE 848 -16 848 -80
WIRE 16 96 16 48
WIRE 288 96 288 32
WIRE 400 96 400 48
WIRE 736 96 736 48
WIRE 848 96 848 64
WIRE 1104 96 1104 48
WIRE -144 176 -144 -80
WIRE -144 176 -496 176
WIRE -16 176 -144 176
WIRE 160 176 64 176
WIRE 256 176 160 176
WIRE 544 176 336 176
WIRE 592 176 544 176
WIRE 896 176 672 176
WIRE 1008 176 896 176
WIRE 1056 176 1008 176
WIRE 1056 192 1056 176
WIRE -496 208 -496 176
WIRE 160 208 160 176
WIRE 544 208 544 176
WIRE 896 208 896 176
WIRE 160 288 160 272
WIRE 544 288 544 272
WIRE 896 288 896 272
WIRE 1056 288 1056 272
WIRE -496 304 -496 288
FLAG 1056 288 0
FLAG 896 288 0
FLAG 544 288 0
FLAG 160 288 0
FLAG -496 304 0
FLAG 1008 176 out
FLAG 1104 96 0
FLAG 848 96 0
FLAG 736 96 0
FLAG 400 96 0
FLAG 288 96 0
FLAG 16 96 0
SYMBOL ind -32 192 R270
WINDOW 0 32 56 VTop 2
WINDOW 3 5 56 VBottom 2
SYMATTR InstName L1
SYMATTR Value 1.5124
SYMATTR SpiceLine Rser=0
SYMBOL ind 240 192 R270
WINDOW 0 32 56 VTop 2
WINDOW 3 5 56 VBottom 2
SYMATTR InstName L2
SYMATTR Value .8125
SYMATTR SpiceLine Rser=0
SYMBOL ind 576 192 R270
WINDOW 0 32 56 VTop 2
WINDOW 3 5 56 VBottom 2
SYMATTR InstName L3
SYMATTR Value .3785
SYMATTR SpiceLine Rser=0
SYMBOL cap 144 208 R0
SYMATTR InstName C1
SYMATTR Value 1.0329
SYMBOL cap 528 208 R0
SYMATTR InstName C2
SYMATTR Value .6072
SYMBOL cap 880 208 R0
SYMATTR InstName C3
SYMATTR Value .1287
SYMBOL res 1040 176 R0
SYMATTR InstName R1
SYMATTR Value 1
SYMBOL voltage -496 192 R0
WINDOW 3 -185 164 Left 2
WINDOW 123 24 124 Left 2
WINDOW 39 0 0 Left 2
SYMATTR Value PULSE(0 1 1 1m 1m 1m)
SYMATTR Value2 ac 1
SYMATTR InstName V1
SYMBOL cap -32 -96 R90
WINDOW 0 0 32 VBottom 2
WINDOW 3 32 32 VTop 2
SYMATTR InstName C4
SYMATTR Value {1/1.06998}
SYMBOL res 0 -48 R0
SYMATTR InstName R2
SYMATTR Value 1
SYMBOL ind 48 -64 R270
WINDOW 0 32 56 VTop 2
WINDOW 3 5 56 VBottom 2
SYMATTR InstName L4
SYMATTR Value 2.44663
SYMATTR SpiceLine Rser=0
SYMBOL res 272 -96 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R3
SYMATTR Value 1.61635
SYMBOL cap 272 -32 R0
SYMATTR InstName C5
SYMATTR Value .501225
SYMBOL res 384 -48 R0
SYMATTR InstName R4
SYMATTR Value {1/.23388}
SYMBOL res 704 -96 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R5
SYMATTR Value 1.0087
SYMBOL ind 448 -64 R270
WINDOW 0 32 56 VTop 2
WINDOW 3 5 56 VBottom 2
SYMATTR InstName L5
SYMATTR Value 1.67931
SYMATTR SpiceLine Rser=0
SYMBOL ind 880 -64 R270
WINDOW 0 32 56 VTop 2
WINDOW 3 5 56 VBottom 2
SYMATTR InstName L6
SYMATTR Value .944529
SYMATTR SpiceLine Rser=0
SYMBOL res 1120 64 R180
WINDOW 0 36 76 Left 2
WINDOW 3 36 40 Left 2
SYMATTR InstName R6
SYMATTR Value 3.55786
SYMBOL cap 720 -16 R0
SYMATTR InstName C6
SYMATTR Value .330091
SYMBOL res 832 -32 R0
SYMATTR InstName R7
SYMATTR Value {1/.397832}
TEXT 240 352 Left 2 !.ac dec 100 10m 10
TEXT 240 392 Left 2 !;tran 10
TEXT 248 304 Left 2 !.net v1 v(out)

Jim Thompson

unread,
May 9, 2014, 11:33:46 AM5/9/14
to
On Fri, 09 May 2014 17:25:00 +0200, Jeroen Belleman
<jer...@nospam.please> wrote:

>Call me dense, but after many years of using LTspice,
>during which many times I inserted return-loss bridges
>into my circuits to measure S11, someone pointed out
>to me that LTspice has a directive for that.
>
>Just insert ".net V1 v(out)" somewhere into the schematic,
>and an S11 trace will become available.
>
>I'm still missing some of the finer points however: The
>resulting S11 only makes sense with the directive above.
>The docs seem to say that it should be ".net v(out) V1",
>but then the resulting S11 makes no sense that I can see.
>With the latter form, I also get the three missing S-
>parameters, as well as H, Z and Y parameters. S21 makes
>no sense either. I don't know yet about the others.
>If I insert ".net I(R1) V1", with R1 the output load, S11
>is OK again. I'm puzzled. Maybe someone can shed some
>light on this?
>
>For the curious, below is the circuit I've been playing
>with. It's a constant impedance O(6) Bessel low-pass
>filter. It's more an exercise in filter synthesis than
>a practical design...
>
>Jeroen Belleman

I have no idea what that LTspice directive does, but maybe these
appnotes will shed some light...

<http://www.analog-innovations.com/CreateS-ParameterSubcircuitsForSpice.pdf>
...Jim Thompson
--
| James E.Thompson | mens |
| Analog Innovations | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| San Tan Valley, AZ 85142 Skype: Contacts Only | |
| Voice:(480)460-2350 Fax: Available upon request | Brass Rat |
| E-mail Icon at http://www.analog-innovations.com | 1962 |

I love to cook with wine. Sometimes I even put it in the food.

jeroen Belleman

unread,
May 9, 2014, 3:39:29 PM5/9/14
to
On 09/05/14 17:33, Jim Thompson wrote:
> On Fri, 09 May 2014 17:25:00 +0200, Jeroen Belleman
> <jer...@nospam.please> wrote:
>
>> Call me dense, but after many years of using LTspice,
>> during which many times I inserted return-loss bridges
>> into my circuits to measure S11, someone pointed out
>> to me that LTspice has a directive for that.
>>
>> Just insert ".net V1 v(out)" somewhere into the schematic,
>> and an S11 trace will become available.
>>
>> I'm still missing some of the finer points however: The
>> resulting S11 only makes sense with the directive above.
>> The docs seem to say that it should be ".net v(out) V1",
>> but then the resulting S11 makes no sense that I can see.
>> With the latter form, I also get the three missing S-
>> parameters, as well as H, Z and Y parameters. S21 makes
>> no sense either. I don't know yet about the others.
>> If I insert ".net I(R1) V1", with R1 the output load, S11
>> is OK again. I'm puzzled. Maybe someone can shed some
>> light on this?
>>[...]
>> Jeroen Belleman
>
> I have no idea what that LTspice directive does, but maybe these
> appnotes will shed some light...
>
> <http://www.analog-innovations.com/CreateS-ParameterSubcircuitsForSpice.pdf>

Ah, there's an even simpler return-loss bridge in there than what
I've been using. Thanks.

In the mean time, I've been perusing some LTspice courses and hints,
and they seem to prefer the ".net I(R1) V1" form, which indeed worked
for me too. Presumably they had the same problem. ;-) Frankly, I
don't even get why the *output* load should appear in there at all.
S11 is the reflection from the *input*.

Jeroen belleman


Kevin Aylward

unread,
May 10, 2014, 4:08:38 AM5/10/14
to
>"Jeroen Belleman" wrote in message news:lkis08$6i0$1...@speranza.aioe.org...

>Call me dense, but after many years of using LTspice,
>during which many times I inserted return-loss bridges
>into my circuits to measure S11, someone pointed out
>to me that LTspice has a directive for that.

>Just insert ".net V1 v(out)" somewhere into the schematic,
>and an S11 trace will become available.

>I'm still missing some of the finer points however: The
>resulting S11 only makes sense with the directive above.

The other option, is simply to use an alternative, but design equivalent,
method of specifying circuit conditions. I do that here:

http://www.kevinaylward.co.uk/ee/lna/lna.html

To wit, drive the amp with the source, say 50 ohm, and make a statement on
the the frequency range of say, 1db variance from -6db attenuation and, say
+/-10 degs from 0, or whatever.

The R.F. universe sits in a universe by itself. There is no technical reason
to use and think in terms of s-parameters at all. This is a historical
artefact. All design parameters can simply be reformulated in a way that ANY
Spice can handle directly. So long as all blocks are consistently specified,
it all cancels out in the wash.

Its a bit like you yanks living in the past with your 105 deg F in TX, when
the rest of the sensible world moved on to Centigrade in the last century.
No one here converts to Fahrenheit to understand why its hot where jimmy T
lives, we all know 45 degrees C has fried his brain a while back.

Kevin Aylward B.Sc.
www.kevinaylward.co.uk
www.anasoft.co.uk - SuperSpice.

Jim Thompson

unread,
May 10, 2014, 10:24:08 AM5/10/14
to
Now be nice. 45�C is not hot, it's "toasty" :-D

John S

unread,
May 10, 2014, 12:37:55 PM5/10/14
to
I agree with you, Kevin. S11 means a lot less to me than Zin which is
easy to plot in the simulation universe. However, Zin is not so easy to
measure in our universe at very high frequencies, thus the S11 approach.

John S

Kevin Aylward

unread,
May 10, 2014, 1:30:38 PM5/10/14
to
"John S" wrote in message news:lklklc$cgd$1...@dont-email.me...
>I agree with you, Kevin. S11 means a lot less to me than Zin which is easy
>to plot in the simulation universe. However, Zin is not so easy to measure
>in our universe at very high frequencies, thus the S11 approach.

I only live in the simulation universe now, the lower level staff can deal
with the real world and report back the results :-)

John S

unread,
May 10, 2014, 3:02:51 PM5/10/14
to
In that universe, you are correct. It might be nice to visit the other
universe occasionally to discover the difficulties encountered to report
the results you are using. Nevertheless, I accept and understand your
position on the matter.

Cheers,
John S

jeroen Belleman

unread,
May 10, 2014, 5:05:44 PM5/10/14
to
Bridges are still the most accurate way to compare impedances, and S11
is just the what comes out of a bridge. One gets used to it. I tend
to favour S11 for impedance close to the reference and Zin when it's
far away, but that's just me.

Using S11 at or close to DC tends to raise some eyebrows, but there
is nothing against it, really.

Jeroen Belleman

John S

unread,
May 11, 2014, 4:57:51 PM5/11/14
to
Oh yes, that's fine. I just never use the .NET directive in LTSpice
because of the problem you brought up. I simply plot Zin, which is the
same thing and easier to remember.

> Using S11 at or close to DC tends to raise some eyebrows, but there
> is nothing against it, really.

I know. Now try to tell somebody that you can measure the power factor
of a switching load on a battery. That will raise eyebrows, too.

John S

> Jeroen Belleman

John S

unread,
May 11, 2014, 5:25:35 PM5/11/14
to
Not the same thing, of course. I meant to say Zin is my goal so S11 is
an extra step for me.

Kevin Aylward

unread,
May 12, 2014, 12:35:23 PM5/12/14
to
"John S" wrote in message news:lkoo8h$unf$1...@dont-email.me...
I don't even plot Zin. Its redundant information. I just plot the voltage to
see if it attenuated too much or little. What matters are only the final
voltages, currents and frequency/transient response of the complete system.
S,H, Z, ABCD, parameters etc are only artefacts invented to determine volts
and amps 80 years ago with pencil and paper when they didn't have computers.
They are, essentially, not necessary. Its er...ahmmm... a paradigm shift....

e.g. Have a a signal feeding a model of the Rx antenna, taking the out from
the antenna model into the receiver etc, and have the PA amp drive a model
of the transmit antenna with an output sensing the radiation resistance part
of the model.

You can then do 10,000s of multiple parameter sweeps for all the tuned
components and pick the ones that get you the desired voltages and currents.
i.e. Its irrelevant what the actual VSWR is, what matters, e.g., is whether
the transmitter blows up with overvoltage when you disconnect its load and
so forth. As prior noted my 4 year old Dell comes in at 30 GFLOPS.

Simulators give you all this information directly, without having to piss
about with legacy concepts, e.g. smith charts.

Regards

jeroen Belleman

unread,
May 12, 2014, 2:52:41 PM5/12/14
to
On 12/05/14 18:35, Kevin Aylward wrote:
> "John S" wrote in message news:lkoo8h$unf$1...@dont-email.me...
>
> On 5/10/2014 4:05 PM, jeroen Belleman wrote:
>> On 10/05/14 18:37, John S wrote:
>>> On 5/10/2014 3:08 AM, Kevin Aylward wrote:
>>>>> "Jeroen Belleman" wrote in message
>>>>> news:lkis08$6i0$1...@speranza.aioe.org...
>>>>
>>>>> Call me dense, but after many years of using LTspice,
>>>>> during which many times I inserted return-loss bridges
>>>>> into my circuits to measure S11, someone pointed out
>>>>> to me that LTspice has a directive for that.
>>>>
>>>>> Just insert ".net V1 v(out)" somewhere into the schematic,
>>>>> and an S11 trace will become available.
>>>>
>>>>> I'm still missing some of the finer points however: The
>>>>> resulting S11 only makes sense with the directive above.
>>>>
>>>> [...]
>>>>
>>>> The R.F. universe sits in a universe by itself. There is no technical
>>>> reason to use and think in terms of s-parameters at all. This is a
>>>> historical artefact. All design parameters can simply be
>>>> reformulated in
>>>> a way that ANY Spice can handle directly. So long as all blocks are
>>>> consistently specified, it all cancels out in the wash.
>>>>
>>>> [...]
>>>> Kevin Aylward B.Sc.
>>>> www.kevinaylward.co.uk
>>>> www.anasoft.co.uk - SuperSpice.
>>>
>>> I agree with you, Kevin. S11 means a lot less to me than Zin which is
>>> easy to plot in the simulation universe. However, Zin is not so easy to
>>> measure in our universe at very high frequencies, thus the S11 approach.
>>>
>>> John S
>>
>>
>>> Bridges are still the most accurate way to compare impedances, and S11
>>> is just the what comes out of a bridge. One gets used to it. I tend
>>> to favour S11 for impedance close to the reference and Zin when it's
>>> far away, but that's just me.
>
>> Oh yes, that's fine. I just never use the .NET directive in LTSpice
>> because of the problem you brought up. I simply plot Zin, which is the
>> same thing and easier to remember.
>
> I don't even plot Zin. Its redundant information.

To each his own. In my case, I have capacitive transducers producing
signals at the far end of long coax cables. If I don't terminate them
correctly, I get reflections that mess up measurements two cable
delays later. S11, or more often 20*log|S11|, is an excellent indicator
of the quality of the match.

Jeroen Belleman

Kevin Aylward

unread,
May 13, 2014, 12:21:30 PM5/13/14
to
"jeroen Belleman" wrote in message news:lkr59l$s43$1...@speranza.aioe.org...
I think this still misses my point. The voltage and phase give the exact
same information. That was the point about the Fahrenheit and Celsius. If
everything is handled in the same mode of thought, it all cancels out, with
no conversion necessary.

Regarding the initial issue of this thread. Spice does not deal with
S-parameters, it deals with volts and amps. The solution is to think and do
everything in volts and amps.

Jeroen Belleman

unread,
May 14, 2014, 8:22:57 AM5/14/14
to
On 2014-05-13 18:21, Kevin Aylward wrote:
> "jeroen Belleman" wrote in message news:lkr59l$s43$1...@speranza.aioe.org...
>
> On 12/05/14 18:35, Kevin Aylward wrote:
>> On 5/10/2014 4:05 PM, jeroen Belleman wrote:
>>>
>> To each his own. [...] S11, or more often 20*log|S11|, is an
>> excellent indicator of the quality of the match.
>
> I think this still misses my point. The voltage and phase give the exact
> same information. [...]

Of course, and no, I didn't miss your point. But I still
prefer to think in terms of incident and reflected waves
in many cases. YMMV.

Jeroen Belleman

Kevin Aylward

unread,
May 15, 2014, 12:17:39 PM5/15/14
to
"Jeroen Belleman" wrote in message news:lkvn6u$v35$1...@speranza.aioe.org...
Oh... those imaginary ones...

Kevin Aylward B.Sc.
www.kevinaylward.co.uk
www.ansoft.co.uk

Simon S Aysdie

unread,
May 18, 2014, 12:32:17 PM5/18/14
to
On Friday, May 9, 2014 8:25:00 AM UTC-7, Jeroen Belleman wrote:
> Call me dense, but after many years of using LTspice,
> during which many times I inserted return-loss bridges
> into my circuits to measure S11, someone pointed out
> to me that LTspice has a directive for that.
>
> Just insert ".net V1 v(out)" somewhere into the schematic,
> and an S11 trace will become available.
>
> I'm still missing some of the finer points however: The
> resulting S11 only makes sense with the directive above.
> The docs seem to say that it should be ".net v(out) V1",
> but then the resulting S11 makes no sense that I can see.
> With the latter form, I also get the three missing S-
> parameters, as well as H, Z and Y parameters. S21 makes
> no sense either. I don't know yet about the others.
> If I insert ".net I(R1) V1", with R1 the output load, S11
> is OK again. I'm puzzled. Maybe someone can shed some
> light on this?

I suspect it may have to do with your lack of specifying "Rout," as the documentation puts it. You have R1=1, but perhaps it is in parallel with the 1 ohm the .net parameter puts in by default when it is unspecified. Basically, I think you are terming the right side with 0.5 ohm instead of 1.0 ohm when you don't specify. Make R1=1e12 or something like that, and see what happens.

I am not sure why ".net V1 v(out)" even works at all, as you've swapped I/O. There is a reason, I'm sure, but I wouldn't bother with unorthodox forms at this point. (I typically use the ".net I(R1) V1" form, and have never found a problem with it.)

> Frankly, I don't even get why the *output* load should
> appear in there at all. S11 is the reflection from the
> *input*.

Unless S12 is zero, the load most certainly matters.

Let us know what you discover.
Message has been deleted
Message has been deleted
0 new messages