S-parameters for the novice
S-parameters describe how a circuit responds to waves arriving at its ports. At RF frequencies, they answer two useful questions: how much of an incident wave returns to its source, and how much emerges from another port? Each S-parameter is a complex ratio, so it carries both magnitude and phase. It has no units and generally changes with frequency.
What the four numbers mean
For a two-port circuit, let
| Parameter | Meaning | Measurement condition |
|---|---|---|
| Reflection seen at port 1 | ||
| Transmission from port 1 to port 2 | ||
| Transmission from port 2 to port 1 | ||
| Reflection seen at port 2 |
Setting
Hand calculation: a 5 nH inductor at 2 GHz
nP.L() models an ideal series inductor between two ports:
50 Ω reference L = 5 nH 50 Ω reference
port 1 ─────────────[ inductor ]───────────── port 2First calculate its impedance at
To see where the S-parameter formulas come from, send a voltage wave
Solving for the two wave ratios gives the same formulas used by L.js:
The circuit is symmetric and reciprocal, so
Thus, at 2 GHz:
| Parameter | Complex value | Magnitude | Magnitude in dB |
|---|---|---|---|
The dB values are
How nP.L() builds the nPort
The public nP.L() constructor uses src/np-nport/src/rlc/L.js. It reads the selected analysis frequencies and reference impedance, creates a two-port nPort, and repeats the calculation for every frequency. The essential steps are:
var lPort = new nPort;
var settings = componentSettings(global, options);
var frequencyList = analysisFrequencies(settings);
var Zo = complex(global.Ro, 0);
var two = complex(2, 0);
var sparsArray = [];
for (var i = 0; i < frequencyList.length; i++) {
var Z = complex(0, 2 * Math.PI * L * frequencyList[i]);
var s11 = Z.div(Z.add(Zo.add(Zo)));
var s21 = two.mul(Zo).div(Z.add(Zo.add(Zo)));
var s12 = s21;
var s22 = s11;
sparsArray[i] = [frequencyList[i], s11, s12, s21, s22];
}
lPort.setspars(sparsArray);
lPort.setglobal(settings);
return lPort;complex(0, ...) represents the inductor's .spars row contains the frequency followed by four complex S-parameters in the order [frequency, s11, s12, s21, s22]. setglobal(settings) records the analysis settings on the returned nPort. With one frequency in fList, the nPort has one row; with a sweep, it has one row per frequency.
Try the 2 GHz case in nPort:
var g = nP.global;
g.Ro = 50;
g.fList = [2e9];
var l1 = nP.L(5e-9);
var sParameters = l1.out('s11Re', 's11Im', 's21Re', 's21Im', 's11dB', 's21dB');
nP.log(sParameters);sParameters is a numeric table headed by Freq and the requested selectors. Its single data row agrees with the values above. The nPort itself retains the complex values in l1.spars[0]; .out(...) extracts numbers suitable for a chart or table. See the nPort object guide for more output selectors.
Continue with nPort overview to see how component nPorts become a circuit model.