From B-parameters to A-parameters
In matrix form, the formula is
A=B−1
While for each element, we obtain
A11A12A21A22=B11B22−B12B21B22=−B11B22−B12B21B12=−B11B22−B12B21B21=B11B22−B12B21B11
The formulas are obtained with the methods explained here.
The MATLAB implementation can be found in circuitconversions on Gitlab.
Definitions
[V2−I2]=B[V1I1] | [V1I1]=A[V2−I2] |