Adam Cooman

Conversions between Electrical Network Representations

In this blog post I describe a matrix-based method to convert between the different network representations of electrical circuits, like Y, Z and S parameters. Using the approach detailed below, it is easy to auto-generate code to perform these transforms.

I used the methods described here to implement all the transforms in MATLAB. You can find that code in circuitconversions on gitlab.com.

I also generated a page for every possible conversion. You can click in the table below to find the formula you need.

YZSHGABT
YY→ZY→SY→HY→GY→AY→BY→T
ZZ→YZ→SZ→HZ→GZ→AZ→BZ→T
SS→YS→ZS→HS→GS→AS→BS→T
HH→YH→ZH→SH→GH→AH→BH→T
GG→YG→ZG→SG→HG→AG→BG→T
AA→YA→ZA→SA→HA→GA→BA→T
BB→YB→ZB→SB→HB→GB→AB→T
TT→YT→ZT→ST→HT→GT→AT→B

On the rest of this page, I explain the methodology how to obtain all the different formula’s. The page is structured as follows:

Transforming between circuit representations

In general, the circuit parameters are in a certain representation R\mathbf{R} which links the input signal vector U\mathbf{U} to the output signal vector O\mathbf{O}:

O=RU\mathbf{O}=\mathbf{R}\mathbf{U}

They have to be transformed into another representation R\mathbf{R}^{\prime} with input signal vector U\mathbf{U}^{\prime} and output signal vector O\mathbf{O}^{\prime}

O=RU\mathbf{O}^{\prime} =\mathbf{R}^{\prime}\mathbf{U}^{\prime}

the transformation from one representation to another can be described by looking at the transformation on the stacked input-output vectors:

[OU]=[P11P12P21P22]P[OU]\begin{bmatrix} \mathbf{O}^{\prime} \cr \mathbf{U}^{\prime} \end{bmatrix} = \underbrace{ \begin{bmatrix} \mathbf{P} _ {11} & \mathbf{P} _ {12} \cr \mathbf{P} _ {21} & \mathbf{P} _ {22} \end{bmatrix}}_{\mathbf{P}} \begin{bmatrix} \mathbf{O}\cr \mathbf{U} \end{bmatrix}

The goal of the transformation is to write R\mathbf{R}^{\prime} as a function of the original representation R\mathbf{R} and the transformation matrix P\mathbf{P}. Solving the previous equation for O\mathbf{O}^{\prime} gives

O=(P11R+P12)(P21R+P22)1U\mathbf{O}^{\prime}=\left(\mathbf{P}_{11}\mathbf{R}+\mathbf{P}_{12}\right)\left(\mathbf{P}_{21}\mathbf{R}+\mathbf{P}_{22}\right)^{-1}\mathbf{U}^{\prime}

This gives us the expression for R\mathbf{R}^{\prime} as a function of R\mathbf{R}:

R=(P11R+P12)(P21R+P22)1\mathbf{R}^{\prime}=\left(\mathbf{P}_{11}\mathbf{R}+\mathbf{P}_{12}\right)\left(\mathbf{P}_{21}\mathbf{R}+\mathbf{P}_{22}\right)^{-1}

This expression allows us to transform any representation into another when we know the transformation matrix P\mathbf{P}. By clicking on the table above, you can get the expressions for all the transforms which are obtained with this method. This approach is based on the excellent paper on mixed-mode S-parameters where a similar transform is constructed to transform from single-ended to mixed-mode1.

Example: Transforming from Z to G

As an example, we show how we obtained the transformation matrix to go from Z-parameters to G-parameters. The Z- and G-parameters have the following definitions:

[V1V2]=Z[I1I2][I1V2]=G[V1I2]\begin{bmatrix} V_{1}\\ V_{2} \end{bmatrix}=\mathbf{Z}\begin{bmatrix} I_{1}\\ I_{2} \end{bmatrix} \qquad \begin{bmatrix} I_{1}\\ V_{2} \end{bmatrix}=\mathbf{G}\begin{bmatrix} V_{1}\\ I_{2} \end{bmatrix}

For this specific transformation, the following two stacked input-output vectors are obtained

[OU]=[V1V2I1I2][OU]=[I1V2V1I2]\begin{bmatrix} \mathbf{O}\\ \mathbf{U} \end{bmatrix}= \begin{bmatrix} V _ {1}\\ V _ {2}\\ I _ {1}\\ I _ {2} \end{bmatrix} \qquad \begin{bmatrix} \mathbf{O}^{\prime}\\ \mathbf{U}^{\prime} \end{bmatrix}= \begin{bmatrix} I _ {1}\\ V _ {2}\\ V _ {1}\\ I _ {2} \end{bmatrix}

The transformation matrix P\mathbf{P} can now be found by finding the permutation matrix that links the two vectors:

[I1V2V1I2]=[01010011001100001001][V1V2I1I2]\begin{bmatrix} I_{1}\\ V_{2}\\ V_{1}\\ I_{2} \end{bmatrix}=\begin{bmatrix} 0 _ {\vphantom{1}} & 0 & 1 & 0\\ 0 _ {\vphantom{1}} & 1 & 0 & 0\\ 1 _ {\vphantom{1}} & 0 & 0 & 0\\ 0 _ {\vphantom{1}} & 0 & 0 & 1 \end{bmatrix}\begin{bmatrix} V_{1}\\ V_{2}\\ I_{1}\\ I_{2} \end{bmatrix}

Which results in the following conversion formula

G=([0001]Z+[1000])([1000]Z+[0001])1\mathbf{G}=\left(\begin{bmatrix} 0 & 0\\ 0 & 1 \end{bmatrix}\mathbf{Z}+\begin{bmatrix} 1 & 0\\ 0 & 0 \end{bmatrix}\right)\left(\begin{bmatrix} 1 & 0\\ 0 & 0 \end{bmatrix}\mathbf{Z}+\begin{bmatrix} 0 & 0\\ 0 & 1 \end{bmatrix}\right)^{-1}

Transforming into and from wave-based representations

Instead of working with voltages and currents, the most interesting circuit representations use incident and reflected waves are used as inputs and outputs. The S-parameters, for example, are defined as follows:

[B1B2]=S[A1A2]\begin{bmatrix} B_{1}\\ B_{2} \end{bmatrix}= \mathbf{S} \begin{bmatrix} A_{1}\\ A_{2} \end{bmatrix}

The incident and reflected waves at a port are related to the voltages and currents measured at the same port in the following way:

Ai=ki(Vi+Z0,iIi)Bi=ki(ViZ0,iIi)A_{i} =k_i \left(V_{i}+Z_{0,i} I_{i}\right)\quad\quad B_{i}=k_i\left(V_{i}-Z_{0,i} I_{i}\right)

where Z0Z_{0} is the reference impedance. The parameter kik_i depends on the preferred definition of the waves. Two different options are available in literature2 3:

ki=12(Z0,i)ki=α(Z0,i)2Z0,ik_i=\frac{1}{2\sqrt{\Re\left( Z_{0,i}\right) }}\qquad k_i=\alpha\frac{\sqrt{\Re\left( Z_{0,i} \right) }}{2\left|Z_{0,i}\right|}

where (Z0,i)\Re\left( Z_{0,i} \right) indicates the real part of Z0,iZ_{0,i} and α\alpha is a free parameter of modulus 1. Note that both definitions of kik_i are equal when Z0,iZ_{0,i} is real and we choose α=1\alpha=1.

The transformation matrix P\mathbf{P} is not just a simple permutation matrix when transforming from representations that use voltages and currents to wave-based circuit representations and vice-versa. In such transformations, voltages and currents are mixed to create the waves, or incident and reflected waves are combined to obtain voltages and currents. The formula to get the incident and reflected waves from voltages and currents has been given before. Solving this equation for ViV_{i} and IiI_{i} gives the relations between the voltage and current:

{Ai=ki(Vi+Z0,iIi)Bi=ki(ViZ0,iIi){Vi=(2ki)1(Ai+Bi)Ii=(2kiZ0,i)1(AiBi)\begin{cases} A_{i} &= k_i\left(V_{i}+Z_{0,i} I_{i}\right)\\ B_{i} &= k_i\left(V_{i}-Z_{0,i} I_{i}\right) \end{cases}\Leftrightarrow\begin{cases} V_{i} &= \left( 2k_i \right)^{-1} \left(A_{i}+B_{i}\right)\\ I_{i} &= \left( 2k_i Z_{0,i} \right)^{-1} \left( A_{i}-B_{i}\right) \end{cases}

These formulas can now be used to obtain the transformation matrix.

Example: Transforming from S to Y

Consider the transformation from S-parameters to Y-parameters. We have the following stacked input-output vectors in this case

[OU]=[B1B2A1A2][OU]=[I1I2V1V2]\begin{bmatrix} \mathbf{O}\\ \mathbf{U} \end{bmatrix}=\begin{bmatrix} B_{1}\\ B_{2}\\ A_{1}\\ A_{2} \end{bmatrix}\qquad\begin{bmatrix} \mathbf{O}^{\prime}\\ \mathbf{U}^{\prime} \end{bmatrix}=\begin{bmatrix} I_{1}\\ I_{2}\\ V_{1}\\ V_{2} \end{bmatrix}

so the transformation matrix P\mathbf{P} in this case is given by:

[I1I2V1V2]=12[k11Z0,110k11Z0,1100k21Z0,210k21Z0,21k110k1100k210k21][B1B2A1A2]\begin{bmatrix} I_{1}\\ I_{2}\\ V_{1}\\ V_{2} \end{bmatrix}= \frac{1}{2} \begin{bmatrix} k_1^{-1} Z_{0,1}^{-1} & 0 & k_1^{-1} Z_{0,1}^{-1} & 0\\ 0 & k_2^{-1} Z_{0,2}^{-1} & 0 & k_2^{-1} Z_{0,2}^{-1} \\ k_1^{-1} & 0 & k_1^{-1} & 0\\ 0 & k_2^{-1} & 0 & k_2^{-1} \end{bmatrix} \begin{bmatrix} B_{1}\\ B_{2}\\ A_{1}\\ A_{2} \end{bmatrix}

which results in the following conversion formula:

Y=([k11Z0,1100k21Z0,21]S+[k11Z0,1100k21Z0,21])([k1100k21]S+[k1100k21])1\begin{align*} \mathbf{Y} = & \left( \begin{bmatrix} k_1^{-1} Z_{0,1}^{-1} & 0\\ 0 & k_2^{-1} Z_{0,2}^{-1} \end{bmatrix} \mathbf{S}+ \begin{bmatrix} k_1^{-1} Z_{0,1}^{-1} & 0\\ 0 & k_2^{-1} Z_{0,2}^{-1} \end{bmatrix} \right) \\ & \qquad\qquad \cdot \left( \begin{bmatrix} k_1^{-1} & 0\\ 0 & k_2^{-1} \end{bmatrix} \mathbf{S}+ \begin{bmatrix} k_1^{-1} & 0\\ 0 & k_2^{-1} \end{bmatrix} \right)^{-1} \end{align*}

Computing the derivative

Suppose we know the deviation of the representation with respect to a real parameter pp:

dR=[R11pR1NpRN1pRNNp]d\mathbf{R} = \begin{bmatrix} \frac{\partial R _ {11}}{\partial p} & \cdots & \frac{\partial R _ {1N}}{\partial p} \\ \vdots & \ddots & \vdots \\ \frac{\partial R _ {N1}}{\partial p} & \cdots & \frac{\partial R _ {NN}}{\partial p} \\ \end{bmatrix}

then it would be useful to know the derivative of the transformed representation dRd\mathbf{R}^\prime. We compute the derivative as follows:

dR=P11dR(P21R+P22)1+(P11R+P12)d((P21R+P22)1)\begin{align*} d\mathbf{R}^\prime =& \mathbf{P} _ {11} d\mathbf{R} (\mathbf{P} _ {21}\mathbf{R} + \mathbf{P} _ {22})^{-1} \\ & + (\mathbf{P} _ {11}\mathbf{R} + \mathbf{P} _ {12} ) d\left( (\mathbf{P} _ {21}\mathbf{R} + \mathbf{P} _ {22})^{-1} \right) \end{align*}

when using the expression for the derivative of the matrix inverse:

dX1=X1dXX1d\mathbf{X}^{-1} = -\mathbf{X}^{-1}d\mathbf{X} \, \mathbf{X}^{-1}

we obtain

dR=(P11RP21)dR(P21R+P22)1d\mathbf{R}^\prime = (\mathbf{P} _ {11} - \mathbf{R}^\prime \mathbf{P} _ {21}) d\mathbf{R} (\mathbf{P} _ {21}\mathbf{R} + \mathbf{P} _ {22})^{-1}

Derivation of formula’s for N-ports

Because Y, Z and S-parameters can be done with more than two ports, we compute the matrix expressions here in more detail. We start with the transform from Y to Z-parameters, which is trivial, but it shows nicely how things work. The P\mathbf{P}-matrix in this case is the following:

[VI]=[0NININ0N][IV]\begin{bmatrix} \mathbf{V} \\ \mathbf{I} \end{bmatrix} = \begin{bmatrix} 0 _ N & I _ N \\ I _ N & 0 _ N \end{bmatrix} \begin{bmatrix} \mathbf{I} \\ \mathbf{V} \end{bmatrix}

where 0N0_N and INI_N are the zero-matrix and the identity matrix respectively. Both are of size N×NN\times N. Plugging the 4 matrices into the general expression for the transform, we can simplify it to obtain that the Z-parameters are just the inverse of the Y-parameters:

Z=(0NY+IN)(INY+0N)1=Y1\mathbf{Z} = (0_N\mathbf{Y} + I_N)(I_N\mathbf{Y} + 0_N)^{-1} = \mathbf{Y}^{-1}

We can check the expression for the derivative here too by plugging our transform matrices into the expression:

dZ=(0NZIN)dY(INY+0N)1=ZdYZd\mathbf{Z} = (0_N - \mathbf{Z} I_N) d\mathbf{Y} (I_N\mathbf{Y} + 0_N)^{-1} = -\mathbf{Z} d\mathbf{Y} \mathbf{Z}

Going from Y and Z parameters to S parameters is more interesting. We first define the following helper matrices

K=[k1kN]Z0=[Z0,1Z0,N]K = \begin{bmatrix} k_1 \\ & \ddots \\ & & k_N \end{bmatrix} \qquad Z_0 = \begin{bmatrix} Z_{0,1} \\ & \ddots \\ & & Z_{0,N} \end{bmatrix}

and we can then write the transformation matrix to go from Y-parameters to S-parameters as

[BA]=[KZ0KKZ0K][IV]\begin{bmatrix} \mathbf{B} \\ \mathbf{A} \end{bmatrix} = \begin{bmatrix} -KZ _ 0 & K \\ KZ _ 0 & K \end{bmatrix} \begin{bmatrix} \mathbf{I} \\ \mathbf{V} \end{bmatrix}

We plug the matrices into the expression for the conversion and simplify:

S=(KZ0Y+K)(KZ0Y+K)1=K(INZ0Y)(IN+Z0Y)1K1\begin{align*} \mathbf{S} & = \left( -KZ_0\mathbf{Y} + K \right) \left( KZ_0\mathbf{Y} + K \right)^{-1} \\ & = K \left( I_N -Z_0\mathbf{Y} \right) \left( I_N + Z_0\mathbf{Y} \right)^{-1}K^{-1} \end{align*}

To go from Z-parameters to S-parameters, we obtain the following P-matrix and expression:

ZS:[BA]=[KKZ0KKZ0][VI]\mathbf{Z} \rightarrow \mathbf{S} : \begin{bmatrix} \mathbf{B} \\ \mathbf{A} \end{bmatrix} = \begin{bmatrix} K & -KZ_0 \\ K & KZ_0 \end{bmatrix} \begin{bmatrix} \mathbf{V} \\ \mathbf{I} \end{bmatrix} S=(KZKZ0)(KZ+KZ0)1=K(ZZ0)(Z+Z0)1K1\begin{align*} \mathbf{S} & = \left( K\mathbf{Z} -K Z_0 \right)\left(K\mathbf{Z} + KZ_0 \right)^{-1} \\ & = K \left( \mathbf{Z} - Z_0 \right)\left(\mathbf{Z} + Z_0\right)^{-1} K^{-1} \end{align*}

When transforming from S-parameters back to Y and Z parameters, we get the following:

[IV]=12[K1Z01K1Z01K1K1][BA]\begin{bmatrix} \mathbf{I} \\ \mathbf{V} \end{bmatrix} = \frac{1}{2} \begin{bmatrix} -K^{-1}Z_0^{-1} & K^{-1}Z_0^{-1} \\ K^{-1} & K^{-1} \end{bmatrix} \begin{bmatrix} \mathbf{B} \\ \mathbf{A} \end{bmatrix} Y=(K1Z01S+K1Z01)(K1S+K1)1=Z01K1(INS)(IN+S)1K\begin{align*} \mathbf{Y} & = \left(-K^{-1}Z_0^{-1}\mathbf{S}+K^{-1}Z_0^{-1}\right)\left(K^{-1}\mathbf{S}+K^{-1}\right)^{-1}\\ & = Z_0^{-1} K^{-1}\left(I_N-\mathbf{S}\right)\left(I_N+\mathbf{S}\right)^{-1} K \end{align*} [VI]=12[K1K1K1Z01K1Z01][BA]\begin{bmatrix} \mathbf{V} \\ \mathbf{I} \end{bmatrix} = \frac{1}{2} \begin{bmatrix} K^{-1} & K^{-1} \\ -K^{-1}Z_0^{-1} & K^{-1}Z_0^{-1} \end{bmatrix} \begin{bmatrix} \mathbf{B} \\ \mathbf{A} \end{bmatrix} Z=(K1S+K1)(K1Z01S+K1Z01)1=K1(IN+S)(INS)1KZ0\begin{align*} \mathbf{Z} & =\left( K^{-1}\mathbf{S}+ K^{-1}\right)\left(- K^{-1}Z_0^{-1}\mathbf{S}+ K^{-1}Z_0^{-1}\right)^{-1}\\ & = K^{-1} \left(I_N + \mathbf{S}\right)\left(I_N - \mathbf{S}\right)^{-1} K Z_0 \end{align*}

Transforming reference impedance

For S-parameters, we have the special case where we can change the reference impedance of the ports. We have two reference impedances Z0,iZ_{0,i} and Z0,oZ_{0,o} with respective kik_i and kok_o. We can write the following equations for the waves:

Ai=ki(V+Z0,iI)Bi=ki(VZo,iI)Ao=ko(V+Z0,oI)Bo=ko(VZ0,oI)\begin{align*} A_i & = k_i (V + Z_{0,i}I) \qquad B_i & = k_i (V - Z_{o,i}I) \\ A_o & = k_o (V + Z_{0,o}I) \qquad B_o & = k_o (V - Z_{0,o}I) \end{align*}

Writing the expression for AoA_o and BoB_o as a function of the AiA_i and BiB_i, we obtain:

Ao=ko2ki(1+Z0,oZ0,i)Ai+ko2ki(1Z0,oZ0,i)BiBo=ko2ki(1Z0,oZ0,i)Ai+ko2ki(1+Z0,oZ0,i)Bi\begin{align*} A_o & = \frac{k_o}{2k_i}\left(1+\frac{Z_{0,o}}{Z_{0,i}}\right) A_i + \frac{k_o}{2k_i}\left(1-\frac{Z_{0,o}}{Z_{0,i}}\right) B_i \\ B_o & = \frac{k_o}{2k_i}\left(1-\frac{Z_{0,o}}{Z_{0,i}}\right) A_i + \frac{k_o}{2k_i}\left(1+\frac{Z_{0,o}}{Z_{0,i}}\right) B_i \\ \end{align*}

We therefore obtain the following conversion matrix:

[BoAo]=12[κ1(IN+ζ)κ1(INζ)κ1(INζ)κ1(IN+ζ)][BiAi]withκ=KoKi1andζ=ZoZi1\begin{gather*} \begin{bmatrix} \mathbf{B}_o \\ \mathbf{A}_o \end{bmatrix} = \frac{1}{2} \begin{bmatrix} \kappa^{-1}(I_N+\zeta) & \kappa^{-1}(I_N-\zeta) \\ \kappa^{-1}(I_N-\zeta) & \kappa^{-1}(I_N+\zeta) \\ \end{bmatrix} \begin{bmatrix} \mathbf{B}_i \\ \mathbf{A}_i \end{bmatrix} \\ \mathrm{with}\,\kappa = K_o K_i^{-1}\,\mathrm{and}\,\zeta = Z_oZ_i^{-1} \end{gather*}

plugging this into the expression and simplifying, we obtain:

So=KoKi1[(IN+ZoZi1)Si+(INZoZi1)][(INZoZi1)Si+(IN+ZoZi1)]1KiKo1\begin{align*} \mathbf{S}_o &= K_oK_i^{-1}\left[(I_N+Z_oZ_i^{-1})\mathbf{S}_i+(I_N-Z_oZ_i^{-1})\right] \\ & \qquad\cdot \left[(I_N-Z_oZ_i^{-1})\mathbf{S}_i+(I_N+Z_oZ_i^{-1})\right]^{-1} K_iK_o^{-1} \end{align*}

Footnotes

  1. A. Ferrero and M. Pirola, “Generalized mixed-mode s-parameters,” IEEE Tran. on Microwave Theory and Techniques, vol. 54, no. 1, pp. 458—463, Jan 2006.

  2. K. Kurokawa, “Power waves and the scattering matrix,” IEEE Transactions on Microwave Theory and Techniques, vol. 13, no. 2, pp. 194—202, Mar 1965.

  3. R.B. Marks and D.F. Williams, “A general waveguide circuit theory,” Journal of Research-National Institute of Standards and Technology, vol.97, pp. 533—533, 1992.