Skip to content

z_to_s_matrix

z_to_s_matrix(z_matrix, impedances=50.0)

Convert a Z-matrix (impedance matrix) to an S-matrix (scattering matrix).

Uses the travelling-wave S-parameter convention:

S=F−1(Z−Zr)(Z+Zr)−1FS = F^{-1} (Z - Z_r) (Z + Z_r)^{-1} F

where F=diag(Re(Zr,i))F = \text{diag}(\sqrt{\text{Re}(Z_{r,i})}) and ZrZ_r is the (possibly complex) diagonal reference-impedance matrix.

When all reference impedances are real, this reduces to the standard formula S=Z0−1/2(Z−Z0)(Z+Z0)−1Z01/2S = Z_0^{-1/2} (Z - Z_0)(Z + Z_0)^{-1} Z_0^{1/2}.

Note

The |v_0|/v_0 phase correction factor from the full travelling-wave definition is omitted. This is exact for lossless reference media and an excellent approximation for low-loss ports.

Args

  • z_matrix (ZMatrix): The impedance matrix to convert.
  • impedances (complex | float | dict[str, complex | float]): Reference impedance(s). If a single number, all terminals use the same impedance. If a dict, maps terminal names to their reference impedances. Defaults to 50.0.

Returns

SMatrix: The converted scattering matrix.