Data File Formats
Anatomy of an S-Parameter File
The Touchstone format, originally defined by EEsof and later revised as Touchstone 2.0 (ratified by the IBIS Open Forum in 2009, with a 2.1 clarification in 2024), is the lingua franca of RF data interchange. A file is plain ASCII with three logical parts: optional comment lines that begin with an exclamation mark, a single option line that begins with a hash sign, and the network-data block. The option line declares four things in a fixed order: the frequency unit (Hz, kHz, MHz, or GHz), the parameter type (S, Y, Z, H, or G), the data notation (MA, DB, or RI), and the reference impedance preceded by the letter R. A header reading # GHz S MA R 50 therefore means S-parameters in linear magnitude and degrees, swept in gigahertz, referenced to 50 Ω.
Each subsequent row begins with a frequency point followed by the S-parameter values for that point. The number of complex pairs equals the square of the port count, so a two-port file lists S11, S21, S12, S22 in that specific column order, while a four-port file lists sixteen pairs. This ordering is a frequent source of error: Touchstone 1.x lists S21 before S12 for two-port files but uses row-major order (S11, S12, S13 then S21, S22 and so on) for files of three or more ports, a historical inconsistency that Touchstone 2.0 resolved with explicit keywords and a mandatory port-order block.
When a single Touchstone file is not enough, engineers reach for CITIfile or MDIF. CITIfile (Common Instrumentation Transfer and Interchange File) stores multiple independent data arrays, each with its own independent variable, so a single file can hold an S-parameter sweep alongside the noise figure and source-pull contours it was measured with. MDIF wraps many parameter-indexed sub-files into one library, which is how foundries deliver bias-dependent or geometry-swept transistor models to a simulator.
The Option Line and Data Notation
# [freq-unit] [param] [notation] R [Zref] → e.g. # GHz S RI R 50
Complex pairs per frequency point:
Npairs = Nports2 (2-port → 4, 4-port → 16)
DB notation to linear magnitude / angle:
|Sij| = 10(dB / 20), θ = angle in degrees
Magnitude-angle to real / imaginary:
Re = |S| × cosθ, Im = |S| × sinθ (θ in radians)
Reverse: |S| = √(Re2 + Im2), θ = arctan(Im / Re). If R is omitted, Zref defaults to 50 Ω.
Format Comparison
| Format | Extension | Encoding | Multiple sweeps | Complex Zref | Typical use |
|---|---|---|---|---|---|
| Touchstone 1.x | .s1p to .s99p | ASCII | No | No | VNA export, passive components |
| Touchstone 2.0 | .ts | ASCII | No | Yes (per-port) | Multi-port, mixed-mode data |
| CITIfile | .cti / .citi | ASCII | Yes | Yes | Noise, load-pull, multi-array |
| MDIF | .mdf | ASCII | Yes (indexed) | Yes | Swept transistor model libraries |
| P2D / S2D | .p2d / .s2d | ASCII | Yes (power-swept) | Yes | Large-signal amplifier models (ADS) |
Frequently Asked Questions
What does the N in a Touchstone .sNp file extension mean?
N is the port count, which sets the number of S-parameter columns: a .s1p holds one S11 value per frequency, a .s2p holds four (S11, S21, S12, S22), and a .s4p holds sixteen. Each frequency point carries N2 complex pairs. Touchstone 1.x wraps files of three or more ports across multiple lines; Touchstone 2.0 fixed that with explicit [Number of Ports] and [Network Data] keywords.
How do I convert a Touchstone file between magnitude-angle and real-imaginary format?
The notation token on the option line selects MA (linear magnitude, degrees), DB (decibels, degrees), or RI (real, imaginary). From DB, recover linear magnitude as 10(dB/20), then Re = |S| × cosθ and Im = |S| × sinθ. Reverse with |S| = √(Re2 + Im2) and θ = arctan(Im / Re). Tools such as scikit-rf read all three and convert internally, so the choice is mainly about readability.
Why does my S-parameter file have the wrong reference impedance?
Zref is set by the trailing R value, as in # GHz S MA R 50. If R is missing the default is 50 Ω, which corrupts data that was actually 75 Ω or complex. Because S-parameters are defined relative to a specific reference impedance, re-normalizing requires the full impedance-renormalization transform, not simple scaling. CITIfile and MDIF carry explicit per-port impedance metadata, which is why they suit transistor and on-wafer data.