sknrf.utilities.rf module

RF Specific Utility Functions

sknrf.utilities.rf.n2t(n)

Converts numpy tensor to pytorch tensor

sknrf.utilities.rf.t2n(t)

Converts pytorch tensor to numpy tensor

sknrf.utilities.rf.real(re_im)

Returns real component of a pytorch tensor

sknrf.utilities.rf.imag(re_im)

Returns imaginary component of a pytorch tensor

sknrf.utilities.rf.rW2dBW(rW)

Converts value in base linear units, such as V, A, rW, to decibels (dB), such as dBV, dBA, dBW.

Parameters:
rWfloat

value in base linear units

Returns:
dBWfloat

value in decibels (dB)

\[dBW & = & 20 log10(abs(rW))\]
>>> rW2dBW(10)
    ..
10.0
>>> rW2dBW(0)
    ..
Traceback (most recent call last):
ValueError: math domain error
sknrf.utilities.rf.rW2dBm(rW)

Converts value in base linear units, such as V, A, rW, to milli-decibels (dBm), such as dBmV, dBmA, dBmrW

Parameters:
rWfloat

value in base linear units

Returns:
dBmfloat

value in milli-decibels (dBm)

\[dBm & = & rW2dBW(rW) + 30\]
sknrf.utilities.rf.dBW2rW(dBW)

Converts value in decibels (dB), such as dBV, dBA, dBW to base linear units, such as V, A, rW.

Parameters:
dBWfloat

value in decibels (dB)

Returns:
rWfloat

value in base linear units

\[rW & = & 10^{dBW/20}\]
sknrf.utilities.rf.dBm2rW(dBm)

Converts value in milli-decibels (dBm), such as dBmV, dBmA, dBmrW to base linear units, such as V, A, rW

Parameters:
dBWfloat

value in decibels (dB)

Returns:
rWfloat

value in base linear units

\[rW & = & dBW2rW(dBm - 30)\]
sknrf.utilities.rf.angle_deg(re_im)
sknrf.utilities.rf.angle(re_im)
sknrf.utilities.rf.poynting(tf)
sknrf.utilities.rf.a2v(a, z0=50.0)

Gonzalez 1.7.13 using the explanation in 1.7.18

Parameters:
aTensor

Port Incident power-wave.

z0Tensor

Reference Impedance.

Returns:
Tuple

(v, z0): v+ or the port voltage when conjugate matched, and reference impedance.

sknrf.utilities.rf.v2a(v, z0=50.0)

Gonzalez 1.7.13 using the explanation in 1.7.18

Parameters:
vTensor

Port Voltage.

z0Tensor

Reference Impedance.

Returns:
Tuple

(a, z0): the port incident power-wave, and reference impedance.

sknrf.utilities.rf.baz2viz(b, a, z0=50.0)

Gonzalez 1.7.9 and 1.7.10

Parameters:
bTensor

Port Reflected power-wave.

aTensor

Port Incident power-wave.

z0Tensor

Reference Impedance.

Returns:
Tuple

(v, i, z0): The port voltage, current, and reference impedance.

sknrf.utilities.rf.viz2baz(v, i, z0=50.0)

Gonzalez 1.7.1 and 1.7.2

egin{eqnarray} B_p & = & \frac{1}{2 \sqrt{ \Re Z_p }} \left( V - Z_p^*I \right) \\ A_p & = & \frac{1}{2 \sqrt{ \Re Z_p }} \left( V + Z_pI \right) \\ \Gamma_p & = & \frac{Z_p - Z_0}{Z_p + Z_0} \\ \end{eqnarray}
Parameters:
vTensor

Port Voltage.

iTensor

Port Current.

z0Tensor

Reference Impedance.

Returns:
Tuple

(v, i, z0): The port reflected power-wave, incident power-wave, and reference impedance.

sknrf.utilities.rf.g2vswr(g)

Gonzalez 1.3.44

Parameters:
gTensor

Reflection Coefficient.

Returns:
Tensor

The VSWR.

sknrf.utilities.rf.vswr2g(vswr)

Gonzalez 1.3.44

Parameters:
vswrTensor

Voltage Standing Wave Ratio (VSWR).

Returns:
Tensor

The Reflection coefficient.

sknrf.utilities.rf.z2g(z, z0=50.0)

Gonzalez 1.3.39

egin{eqnarray} \Gamma_p & = & \frac{Z_p - Z_0}{Z_p + Z_0} \\ \end{eqnarray}
Parameters:
zTensor

Port Impedance.

z0Tensor

Reference Impedance.

Returns:
Tuple

(g, z0): The reflection coefficient, and reference impedance.

sknrf.utilities.rf.g2z(g, z0=50.0)

Gonzalez 1.3.39

Parameters:
gTensor

Reflection Coefficient.

z0Tensor

Reference Impedance.

Returns:
Tuple

(z, z0): The port impedance, and reference impedance.

sknrf.utilities.rf.s2y(s, z0=50)
sknrf.utilities.rf.y2s(y, z0=50)
sknrf.utilities.rf.s2a(s, z0=50)
sknrf.utilities.rf.a2s(a, z0=50)
sknrf.utilities.rf.t2a(t, z0=50.0)
sknrf.utilities.rf.a2t(a, z0=50.0)
sknrf.utilities.rf.s2sp(s, z1=50.0, z2=50.0, z0=50.0)
sknrf.utilities.rf.sp2s(sp, z1, z2, z0=50.0)
sknrf.utilities.rf.t2tp(t, z1=50.0, z2=50.0, z0=50.0)
sknrf.utilities.rf.tp2t(tp, z1=50.0, z2=50.0, z0=50.0)
sknrf.utilities.rf.z2zp(z, a)
sknrf.utilities.rf.zp2z(zp, a)
sknrf.utilities.rf.gl2gin(gl, s)
sknrf.utilities.rf.gin2gl(gin, s)
sknrf.utilities.rf.s4t(s)
sknrf.utilities.rf.t4s(t)
sknrf.utilities.rf.det_minor(arr, i, j)
sknrf.utilities.rf.t4a(t, z0=50.0)
sknrf.utilities.rf.a4t(a, z0=50.0)
sknrf.utilities.rf.t4tp(t, z1=50.0, z2=50.0, z3=50.0, z4=50.0, z0=50.0)
sknrf.utilities.rf.tp4t(tp, z1=50.0, z2=50.0, z3=50.0, z4=50.0, z0=50.0)
sknrf.utilities.rf.rU2dBU(rW)

Converts value in base linear units, such as V, A, rW, to decibels (dB), such as dBV, dBA, dBW.

Parameters:
rWfloat

value in base linear units

Returns:
dBWfloat

value in decibels (dB)

\[dBW & = & 20 log10(abs(rW))\]
>>> rW2dBW(10)
    ..
10.0
>>> rW2dBW(0)
    ..
Traceback (most recent call last):
ValueError: math domain error
sknrf.utilities.rf.dBU2rU(dBW)

Converts value in decibels (dB), such as dBV, dBA, dBW to base linear units, such as V, A, rW.

Parameters:
dBWfloat

value in decibels (dB)

Returns:
rWfloat

value in base linear units

\[rW & = & 10^{dBW/20}\]