From S-parameters to Y-parameters
In matrix form, the formula is
Y=Z0−1K−1(IN−S)(IN+S)−1K
When dealing with 2 ports, we obtain
Y11Y12Y21Y22=Z1(S11+S22+S11S22−S12S21+1)S22−S11−S11S22+S12S21+1=−Z1k1(S11+S22+S11S22−S12S21+1)2S12k2=−Z2k2(S11+S22+S11S22−S12S21+1)2S21k1=Z2(S11+S22+S11S22−S12S21+1)S11−S22−S11S22+S12S21+1
The formulas are obtained with the methods explained here.
The MATLAB implementation can be found in circuitconversions on Gitlab.
Definitions
BB1⋮BN=SAA1⋮AN | II1⋮IN=YVV1⋮VN |
The incident and reflected waves are defined as
A=K(V+Z0I)B=K(V−Z0I)
where K and Z0 are defined as
K=k1⋱kNZ0=Z0,1⋱Z0,N
with Z0,i the reference impedance for port i and ki defined as
ki=2ℜ(Z0,i)1ki=α2∣Z0,i∣ℜ(Z0,i)
depending on whether you are using power- or pseudowaves.