From H-parameters to S-parameters
In matrix form, the formula is
S=([k100−Z2k2]H+[−Z1k100k2])([k100Z2k2]H+[Z1k100k2])−1
While for each element, we obtain
S11S12S21S22=−H11+Z1+H11H22Z2−H12H21Z2+H22Z1Z2Z1−H11−H11H22Z2+H12H21Z2+H22Z1Z2=k2(H11+Z1+H11H22Z2−H12H21Z2+H22Z1Z2)2H12Z1k1=−k1(H11+Z1+H11H22Z2−H12H21Z2+H22Z1Z2)2H21Z2k2=H11+Z1+H11H22Z2−H12H21Z2+H22Z1Z2H11+Z1−H11H22Z2+H12H21Z2−H22Z1Z2
The formulas are obtained with the methods explained here.
The MATLAB implementation can be found in circuitconversions on Gitlab.
Definitions
[V1I2]=H[I1V2] | [B1B2]=S[A1A2] |
The incident and reflected waves are defined as
A1A2=k1(V1+I1Z1)B1=k2(V2+I2Z2)B2=k1(V1−I1Z1)=k2(V2−I2Z2)
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.