See @ThePhoton's answer too, with this addition that you would find hiding in the spec. Your question asks about 2-port networks, but in case someone looking up this answer is trying to find details on >2-port representation, note that >2-port networks differ:
The values are real/complex values in column-major order if ports <=2 and row-major (matrix) order for ports >2. (See page 5 and 6 for column- vs row-ordered data : https://ibis.org/connector/touchstone_spec11.pdf)
Independent of row/column-major ordering, where $a
and $b
are the first and second of each numeric pair, the data formats can be converted to a complex value ($complex
) as follows:
- For RI:
$complex = $a + $b j
- For MA:
$complex = cos($b*pi()/180) + $a*sin($b*pi()/180) j
- For DB: let
$mag = 10**($a/20)
, such that:
$complex = $mag*cos($b*pi()/180) + $mag*sin($b*pi()/180) j
Update
I've been working on an RF module in Perl that helps with S2P parsing and related calculations (ESR, L, C, transforms, etc.). Here they are, probably in order of usefulness: