S-Parameter Viewer (.s2p, .s4p)
Open a Touchstone .s1p to .s16p file in the browser: magnitude, phase and group delay of every S-parameter, mixed-mode SDD21, SDD11 and SCD21 of a 4-port pair, a low-pass TDR impedance profile and interface loss budgets at the Nyquist frequency. The file is not uploaded.
Method, formulas and references
Reading the file
The reader follows the IBIS Touchstone specification, versions 1.0, 1.1, 2.0 and 2.1 [1, 2]. The option line sets the frequency unit (Hz, kHz, MHz, GHz; default GHz), the parameter (S, Y, Z; default S), the data format (RI, MA, DB; default MA) and the reference resistance R (default 50 Ω). Only the first option line counts. A version 1.1 option line may list one R per port. Comments start at “!”.
Version 1.x files do not state their port count, so it is taken from the .sNp file extension. A 1-port or 2-port frequency point is one line; for three or more ports the matrix is written row by row, each row starting on a new line and wrapping after four pairs. 2-port data uses the order N11, N21, N12, N22, the one exception to row order. In a 1.x 2-port file, noise data starts where the frequency stops increasing.
Version 2.x files start with [Version], followed by the option line and [Number of Ports]. [Two-Port Data Order] (21_12 or 12_21) is required for 2-ports, [Number of Frequencies] for all files, and [Reference] can give each port its own resistance, also across several lines. [Matrix Format] Lower or Upper stores only one triangle of a symmetric matrix, row by row, and the other triangle is mirrored. Data for one frequency may span any number of lines, but every frequency point must start on a new line; the reader uses this to catch a wrong port count. [Begin Information] blocks and [Noise Data] are skipped, and the file must end with [End]. Errors are reported with their line number.
Two departures from the specification found in exported files are read with a note rather than refused: a [Version] 1.0 or 1.1 line (the file is then read as version 1), and a 2.x 2-port file without [Two-Port Data Order], for which the version 1 order 21_12 is assumed. If such a file was written in 12_21 order, S21 and S12 are swapped.
Files with [Mixed-Mode Order] and H- or G-parameter files are not read: mixed-mode data has a per-file port order that this viewer does not map, and hybrid parameters are rarely used for interconnect.
Y- and Z-parameters
The specification defines the waves at port i with its reference resistance Ri as power waves [1]:
With V = ZI this gives, for D = diag(1/√Ri) and R = diag(Ri):
Version 1.x Y- and Z-data is normalised to R, so R = I in (2). Version 2.x Y- and Z-data is not normalised and carries no reference of its own; the S-parameters are then computed for the resistances listed in the file, or 50 Ω.
Magnitude, phase and the marker
|S| in dB is 20 log10|S|; insertion loss and return loss are −20 log10|S| of a transmission and a reflection term. Phase is arg S in degrees. Unwrapped phase adds whole turns wherever neighbouring points differ by more than 180°. At the marker, dB and phase are interpolated linearly between the two nearest data points; nothing is extrapolated beyond the file.
Mixed-mode S-parameters of a 4-port
One pair of single-ended ports p and n forms a differential and a common-mode port. With both ports referenced to the same resistance R, the differential mode is referenced to 2R and the common mode to R/2, and the mixed-mode waves are [1 Appendix A, 3]:
M has one row per mixed-mode port (D1, D2, C1, C2) with ±1/√2 at the two single-ended ports of the pair. Written out, SDD21 = ½(Sp2p1 − Sp2n1 − Sn2p1 + Sn2n1) and SCD21 = ½(Sp2p1 − Sp2n1 + Sn2p1 − Sn2n1). The port numbering selects p and n: “1-2 in, 3-4 out” uses pair 1 = (1, 2) and pair 2 = (3, 4), with lines 1→3 and 2→4; “1-3 in, 2-4 out” uses pair 1 = (1, 3) and pair 2 = (2, 4), with lines 1→2 and 3→4. The wrong choice shows almost no SDD21. Equal real references within each pair are assumed, as in the specification; the viewer warns when they differ. SDD21 is differential insertion loss, SDD11 differential return loss, SCD21 conversion of a differential input to a common-mode output, and SCC11 common-mode return loss.
Group delay
Group delay is the negative slope of the phase against angular frequency. It is computed as a finite difference of the unwrapped phase φ across an aperture of k points centred on each point [4]:
At the ends of the data the aperture is cut short. A wider aperture lowers the noise and hides fast changes [4]. The phase must change by less than 180° between neighbouring points; for a delay τ that needs a frequency step below 1/(2τ), otherwise the delay is wrong.
Time-domain impedance (low-pass step)
The impedance profile follows the low-pass step mode of a vector network analyser [5]:
- The data must lie on a harmonic grid fk = k·Δf from DC (or from Δf) to fmax; points may deviate by 1 % of Δf to allow for rounding in the file. Other grids show no profile.
- Without a DC point, ρ(0) is extrapolated. The real part of the response of a real network is even in frequency and the imaginary part odd, so Re S = a + b f² is fitted through the first two points and Im S(0) = 0.
- A Kaiser window with β = 0, 6 or 13 is applied about DC. With this implementation these give step rise times of 0.45, 0.99 and 1.47 / fmax, matching the minimum, normal and maximum windows of [5, Table 1-3].
- The spectrum is mirrored as S(−f) = S*(f) and inverse-transformed by FFT (zero-padded) to the impulse response; its running sum is the step response ρ(t), which settles at the windowed DC value.
- Z(t) = Z0(1 + ρ)/(1 − ρ), with Z0 the port reference, 2R for SDD and R/2 for SCC.
The time axis is the round trip. The response repeats every 1/Δf, so reflections later than half of that wrap round and are not shown. The profile is the step response of the file, band-limited to fmax: features shorter than the rise time are smeared, a large discontinuity hides those behind it (multiple reflections are not removed), and the result depends on the DC extrapolation.
Interface loss budgets
The budgets come from the interface data used by Interface Design Rules: one insertion-loss figure per interface at its Nyquist frequency, for the board's share of the channel. The viewer compares the differential insertion loss (SDD21 of a 4-port, S21 of a 2-port) with that figure at that one frequency. No frequency-dependent mask or return-loss limit is drawn, because the data does not contain one.
Plotting
Each trace is reduced to the first, lowest, highest and last point of every horizontal plot column before drawing, so narrow resonances survive in files with many thousands of points. Values below the bottom of the axis are drawn on it, and zero magnitude is shown as −∞ dB.
References
- IBIS Open Forum, Touchstone File Format Specification, version 2.1 (26 January 2024): option line, keywords, data layout, power waves, mixed-mode definitions and Appendix A.
- IBIS Open Forum, Touchstone File Format Specification, version 2.0; version 2.1 files are identical apart from the [Version] argument.
- D. E. Bockelman and W. R. Eisenstadt, “Combined differential and common-mode scattering parameters: theory and simulation”, IEEE Trans. Microwave Theory Tech., vol. 43, no. 7, pp. 1530–1539, July 1995.
- Keysight, network analyser help: Group Delay: aperture, −Δφ/Δf, the 180° limit between points.
- Keysight application note 5989-5723EN, Time Domain Analysis Using a Network Analyzer: §4.1 low-pass mode, §5 windowing, §8 range, §9 resolution.
Related guides
- Reading S4P Files: Differential Loss, Return Loss and Mode Conversion
- VSWR, Return Loss and Reflected Power: What the Numbers Mean
- S11 and S21 Explained: Reading Touchstone S-Parameter Files