Skip to content

Network parameters ​

Convert a network's scattering parameters to and from its impedance, admittance, chain (ABCD) and transfer parameters, at the reference impedances of your choice. A conversion takes one matrix, or an array of matrices with the frequency along the dimensions after the first two; an in-place form, ending in !, writes into an array of the same shape.

See the API overview for other topics, closed-form networks for networks to convert, and connections to join them.

Convert and renormalize ​

A line of 40 Ω, 1 cm long, between 50 Ω ports, the measurement system. Its chain matrix gives its scattering parameters at 50 Ω, and its impedance matrix carries them to 40 Ω ports, where the line is matched. At 50 Ω the reflection is that of a line section between two equal media, Γ(1 - exp(-2iθ))/(1 - Γ² exp(-2iθ)) with Γ = (40 - 50)/(40 + 50) and θ its electrical length; at 6 GHz the line is half a wavelength long and reflects nothing.

julia
using JosephsonCircuits
w = 2pi .* [4e9, 5e9, 6e9]
len, vp = 0.01, 1.2e8
θ = w .* len ./ vp
# one chain matrix per frequency, 2×2×3
abcd = JosephsonCircuits.ABCD_tline(40.0, θ)
S = JosephsonCircuits.ABCDtoS(abcd; portimpedances = 50.0)
Z = JosephsonCircuits.StoZ(S; portimpedances = 50.0)
S40 = JosephsonCircuits.ZtoS(Z; portimpedances = 40.0)
Γ = (40 - 50)/(40 + 50)
closed = Γ .* (1 .- exp.(-2im .* θ)) ./ (1 .- Γ^2 .* exp.(-2im .* θ))
@assert isapprox(S[1, 1, :], closed; atol = 1e-12)
@assert maximum(abs, S40[1, 1, :]) < 1e-12
(S11 = S[1, 1, :], closed = closed, S11at40 = S40[1, 1, :])
(S11 = ComplexF64[-0.16664157760048176 + 0.09386396066909475im, -0.056935658077457256 + 0.09621019761221972im, -3.45882099876391e-33 + 2.7554552980815448e-17im], closed = ComplexF64[-0.16664157760048165 + 0.09386396066909468im, -0.05693565807745726 + 0.09621019761221974im, -8.43614877747295e-35 + 2.7554552980815445e-17im], S11at40 = ComplexF64[3.81140974547136e-16 - 1.0902954179146984e-16im, -3.290813860454552e-16 - 3.181927392442096e-16im, 3.276858658674052e-16 + 9.487917790209044e-17im])

A complex reference impedance defines pseudo-waves; see ZtoS.

JosephsonCircuits.ABCDtoS Function
julia
ABCDtoS(ABCD;portimpedances=50.0)

Convert the 2 port chain (ABCD) matrix ABCD to the scattering parameter matrix S and return the result. Assumes a port impedance of 50 Ohms unless specified with the portimpedances keyword argument: a number for both ports, a vector of one or two impedances, the first for the input port and the last for the output port, or a matrix of such columns, one per frequency. The waves are the pseudo-waves of ZtoS, with the square root of each port impedance.

References

Russer, Peter. Electromagnetics, Microwave Circuit, And Antenna Design for Communications Engineering, Second Edition. Artech House, 2006.

source
JosephsonCircuits.ABCDtoS! Method
julia
ABCDtoS!(ABCD::AbstractMatrix, portimpedances)

See ABCDtoS for description.

source
JosephsonCircuits.AtoB Function
julia
AtoB(A)

Convert the chain (ABCD) matrix A to the inverse chain matrix B and return the result. Note that despite the name, the inverse of the chain matrix is not equal to the inverse chain matrix, inv(A) ≠ B.

Examples

julia
julia> A = Complex{Float64}[1.0 0.0;1/50 1.0];JosephsonCircuits.AtoB(A)
2×2 Matrix{ComplexF64}:
  1.0+0.0im  0.0+0.0im
 0.02+0.0im  1.0+0.0im

References

Russer, Peter. Electromagnetics, Microwave Circuit, And Antenna Design for Communications Engineering, Second Edition. Artech House, 2006.

source
JosephsonCircuits.AtoB! Method
julia
AtoB!(B::AbstractMatrix,A::AbstractMatrix,tmp::AbstractMatrix)

See AtoB for description.

source
JosephsonCircuits.AtoS Function
julia
AtoS(A; portimpedances = 50.0)

Convert the chain (ABCD) matrix A to the scattering parameter matrix S and return the result. The first half of the ports are the inputs of the chain matrix and the second half its outputs, each with its own port impedances: portimpedances is a scalar, a vector with one value per port, or a matrix with one row per port and one column per frequency, 50 Ohms unless specified. A is the chain matrix of StoA, [V1; I1] = A*[V2; -I2] with the currents into the ports.

References

Russer, Peter. Electromagnetics, Microwave Circuit, And Antenna Design for Communications Engineering, Second Edition. Artech House, 2006.

source
JosephsonCircuits.AtoS! Method
julia
AtoS!(S::AbstractMatrix, A::AbstractMatrix, tmp::AbstractMatrix,
    sqrtportimpedances1, sqrtportimpedances2)

See AtoS for description.

source
JosephsonCircuits.AtoY Function
julia
AtoY(A)

Convert the chain (ABCD) matrix A to the admittance matrix Y and return the result.

Examples

julia
julia> A = Complex{Float64}[-1 -50.0;0 -1];JosephsonCircuits.AtoY(A)
2×2 Matrix{ComplexF64}:
 0.02+0.0im  0.02+0.0im
 0.02+0.0im  0.02+0.0im

References

Russer, Peter. Electromagnetics, Microwave Circuit, And Antenna Design for Communications Engineering, Second Edition. Artech House, 2006.

source
JosephsonCircuits.AtoY! Method
julia
AtoY!(Y::AbstractMatrix,A::AbstractMatrix,tmp::AbstractMatrix)

See AtoY for description.

source
JosephsonCircuits.AtoZ Function
julia
AtoZ(A)

Convert the ABCD matrix A to the impedance matrix Z and return the result.

Examples

julia
julia> A = Complex{Float64}[1.0 0.0;1/50 1.0];JosephsonCircuits.AtoZ(A)
2×2 Matrix{ComplexF64}:
 50.0+0.0im  50.0+0.0im
 50.0+0.0im  50.0+0.0im

References

Russer, Peter. Electromagnetics, Microwave Circuit, And Antenna Design for Communications Engineering, Second Edition. Artech House, 2006.

source
JosephsonCircuits.AtoZ! Method
julia
AtoZ!(Z::AbstractMatrix,A::AbstractMatrix,tmp::AbstractMatrix)

See AtoZ for description.

source
JosephsonCircuits.BtoA Function
julia
BtoA(B)

Convert the inverse chain matrix B to the chain (ABCD) matrix A and return the result. Note that despite the name, the inverse of the chain matrix is not equal to the inverse chain matrix, inv(A) ≠ B.

Examples

julia
julia> B = Complex{Float64}[1.0 0.0;1/50 1.0];JosephsonCircuits.BtoA(B)
2×2 Matrix{ComplexF64}:
  1.0+0.0im  0.0+0.0im
 0.02+0.0im  1.0+0.0im

References

Russer, Peter. Electromagnetics, Microwave Circuit, And Antenna Design for Communications Engineering, Second Edition. Artech House, 2006.

source
JosephsonCircuits.BtoA! Method
julia
BtoA!(A::AbstractMatrix,B::AbstractMatrix,tmp::AbstractMatrix)

See BtoA for description.

source
JosephsonCircuits.BtoS Function
julia
BtoS(B; portimpedances = 50.0)

Convert the inverse chain (ABCD) matrix B to the scattering parameter matrix S and return the result. The first half of the ports are the inputs of the chain matrix and the second half its outputs, each with its own port impedances: portimpedances is a scalar, a vector with one value per port, or a matrix with one row per port and one column per frequency, 50 Ohms unless specified.

References

Russer, Peter. Electromagnetics, Microwave Circuit, And Antenna Design for Communications Engineering, Second Edition. Artech House, 2006 with change of overall sign (suspected typo).

source
JosephsonCircuits.BtoS! Method
julia
BtoS!(S::AbstractMatrix, B::AbstractMatrix, tmp::AbstractMatrix,
    sqrtportimpedances1, sqrtportimpedances2)

See BtoS for description.

source
JosephsonCircuits.BtoY Function
julia
BtoY(B)

Convert the inverse chain matrix B to the admittance matrix Y and return the result.

Examples

julia
julia> B = Complex{Float64}[-1 -50.0;0 -1];JosephsonCircuits.BtoY(B)
2×2 Matrix{ComplexF64}:
 0.02+0.0im  0.02+0.0im
 0.02+0.0im  0.02+0.0im

References

Russer, Peter. Electromagnetics, Microwave Circuit, And Antenna Design for Communications Engineering, Second Edition. Artech House, 2006.

source
JosephsonCircuits.BtoY! Method
julia
BtoY!(Y::AbstractMatrix,B::AbstractMatrix,tmp::AbstractMatrix)

See BtoY for description.

source
JosephsonCircuits.BtoZ Function
julia
BtoZ(B)

Convert the inverse chain matrix B to the impedance matrix Z and return the result.

Examples

julia
julia> B = Complex{Float64}[1.0 0.0;1/50 1];JosephsonCircuits.BtoZ(B)
2×2 Matrix{ComplexF64}:
 50.0+0.0im  50.0+0.0im
 50.0+0.0im  50.0+0.0im

References

Russer, Peter. Electromagnetics, Microwave Circuit, And Antenna Design for Communications Engineering, Second Edition. Artech House, 2006 with change of sign on B21 and B22 terms (suspected typo).

source
JosephsonCircuits.BtoZ! Method
julia
BtoZ!(Z::AbstractMatrix,B::AbstractMatrix,tmp::AbstractMatrix)

See BtoZ for description.

source
JosephsonCircuits.StoA Function
julia
StoA(S; portimpedances = 50.0)

Convert the scattering parameter matrix S to the chain (ABCD) matrix A and return the result. The first half of the ports are the inputs of the chain matrix and the second half its outputs, each with its own port impedances: portimpedances is a scalar, a vector with one value per port, or a matrix with one row per port and one column per frequency, 50 Ohms unless specified. With the voltages V and the currents I into the ports, [V1; I1] = A*[V2; -I2]: the output currents are taken flowing out of the output ports, so that the chain matrix of networks in cascade is the product of theirs.

References

Russer, Peter. Electromagnetics, Microwave Circuit, And Antenna Design for Communications Engineering, Second Edition. Artech House, 2006.

source
JosephsonCircuits.StoA! Method
julia
StoA!(A::AbstractMatrix, S::AbstractMatrix, tmp::AbstractMatrix,
    sqrtportimpedances1, sqrtportimpedances2)

See StoA for description.

source
JosephsonCircuits.StoABCD Function
julia
StoABCD(S;portimpedances=50.0)

Convert the scattering parameter matrix S to the 2 port chain (ABCD) matrix and return the result. Assumes a port impedance of 50 Ohms unless specified with the portimpedances keyword argument, one impedance for both ports or one for each, as for ABCDtoS. A two port which transmits nothing, S[2,1] == 0, has no chain matrix, and a SingularException is thrown.

References

Russer, Peter. Electromagnetics, Microwave Circuit, And Antenna Design for Communications Engineering, Second Edition. Artech House, 2006.

source
JosephsonCircuits.StoABCD! Method
julia
StoABCD!(S::AbstractMatrix, portimpedances)

See StoABCD for description.

source
JosephsonCircuits.StoB Function
julia
StoB(S; portimpedances = 50.0)

Convert the scattering parameter matrix S to the inverse chain (ABCD) matrix B and return the result. Note that despite the name, the inverse of the chain matrix is not equal to the inverse chain matrix, inv(A) ≠ B: with the currents into the ports, [V2; I2] = B*[V1; -I1], the chain matrix of the network seen from its outputs. The first half of the ports are the inputs of the chain matrix and the second half its outputs, each with its own port impedances: portimpedances is a scalar, a vector with one value per port, or a matrix with one row per port and one column per frequency, 50 Ohms unless specified.

References

Russer, Peter. Electromagnetics, Microwave Circuit, And Antenna Design for Communications Engineering, Second Edition. Artech House, 2006.

source
JosephsonCircuits.StoB! Method
julia
StoB!(B::AbstractMatrix, S::AbstractMatrix, tmp::AbstractMatrix,
    sqrtportimpedances1, sqrtportimpedances2)

See StoB for description.

source
JosephsonCircuits.StoT Function
julia
StoT(S)

Convert the scattering parameter matrix S to a transmission matrix T and return the result. The first half of the ports are the inputs and the second half the outputs, and T relates the waves at the inputs to those at the outputs, [b1; a1] = T*[a2; b2], so that the transmission matrix of networks in cascade, the outputs of each joined to the inputs of the next, is the product of theirs, T1*T2.

Examples

julia
julia> S = Complex{Float64}[0.0 1.0;1.0 0.0];JosephsonCircuits.StoT(S)
2×2 Matrix{ComplexF64}:
 1.0+0.0im  -0.0+0.0im
 0.0-0.0im   1.0+0.0im

References

Russer, Peter. Electromagnetics, Microwave Circuit, And Antenna Design for Communications Engineering, Second Edition. Artech House, 2006.

source
JosephsonCircuits.StoT! Method
julia
StoT!(T::AbstractMatrix,S::AbstractMatrix,tmp::AbstractMatrix)

See StoT for description.

source
JosephsonCircuits.StoY Function
julia
StoY(S;portimpedances=50.0)

Convert the scattering parameter matrix S to an admittance parameter matrix Y and return the result. Assumes a port impedance of 50 Ohms unless specified with the portimpedances keyword argument, a scalar, vector, or matrix of port impedances. A complex port impedance defines pseudo-waves, as described in ZtoS.

Examples

julia
julia> S = Complex{Float64}[0.0 0.999;0.999 0.0];JosephsonCircuits.StoY(S)
2×2 Matrix{ComplexF64}:
  19.99+0.0im  -19.99+0.0im
 -19.99+0.0im   19.99+0.0im

References

Russer, Peter. Electromagnetics, Microwave Circuit, And Antenna Design for Communications Engineering, Second Edition. Artech House, 2006.

source
JosephsonCircuits.StoY! Method
julia
StoY!(Y::AbstractMatrix,S::AbstractMatrix,tmp::AbstractMatrix,oneoversqrtportimpedances)

In place version of StoY, writing into Y with tmp as scratch and oneoversqrtportimpedances the reciprocal square roots of the port impedances.

source
JosephsonCircuits.StoZ Function
julia
StoZ(S;portimpedances=50.0)

Convert the scattering parameter matrix S to an impedance parameter matrix Z and return the result. Assumes a port impedance of 50 Ohms unless specified with the portimpedances keyword argument, a scalar, vector, or matrix of port impedances. A complex port impedance defines pseudo-waves, as described in ZtoS.

Examples

julia
julia> S = Complex{Float64}[0.0 0.0;0.0 0.0];JosephsonCircuits.StoZ(S)
2×2 Matrix{ComplexF64}:
 50.0+0.0im   0.0+0.0im
  0.0+0.0im  50.0+0.0im

julia> S = Complex{Float64}[0.0 0.999;0.999 0.0];JosephsonCircuits.StoZ(S)
2×2 Matrix{ComplexF64}:
 49975.0+0.0im  49975.0+0.0im
 49975.0+0.0im  49975.0+0.0im

References

Russer, Peter. Electromagnetics, Microwave Circuit, And Antenna Design for Communications Engineering, Second Edition. Artech House, 2006.

source
JosephsonCircuits.StoZ! Method
julia
StoZ!(Z::AbstractMatrix,S::AbstractMatrix,tmp::AbstractMatrix,sqrtportimpedances)

See StoZ for description.

source
JosephsonCircuits.TtoS Function
julia
TtoS(T)

Convert the transmission matrix T to a scattering parameter matrix S and return the result; the inverse of StoT, which gives the convention.

Examples

julia
julia> T = Complex{Float64}[1.0 0.0;0.0 1.0];JosephsonCircuits.TtoS(T)
2×2 Matrix{ComplexF64}:
 0.0-0.0im  1.0+0.0im
 1.0+0.0im  0.0-0.0im

References

Russer, Peter. Electromagnetics, Microwave Circuit, And Antenna Design for Communications Engineering, Second Edition. Artech House, 2006 with change of sign on T11 and T21 terms (suspected typo).

source
JosephsonCircuits.TtoS! Method
julia
TtoS!(S::AbstractMatrix,T::AbstractMatrix,tmp::AbstractMatrix)

See TtoS for description.

source
JosephsonCircuits.YtoA Function
julia
YtoA(Y)

Convert the admittance matrix Y to the chain (ABCD) matrix A and return the result.

Examples

julia
julia> Y = Complex{Float64}[1/50 1/50;1/50 1/50];JosephsonCircuits.YtoA(Y)
2×2 Matrix{ComplexF64}:
 -1.0+0.0im  -50.0+0.0im
  0.0+0.0im   -1.0+0.0im

References

Russer, Peter. Electromagnetics, Microwave Circuit, And Antenna Design for Communications Engineering, Second Edition. Artech House, 2006, with the overall sign changed (a suspected typo there).

source
JosephsonCircuits.YtoA! Method
julia
YtoA!(A::AbstractMatrix,Y::AbstractMatrix,tmp::AbstractMatrix)

See YtoA for description.

source
JosephsonCircuits.YtoB Function
julia
YtoB(Y)

Convert the admittance matrix Y to the inverse chain matrix B and return the result.

Examples

julia
julia> Y = Complex{Float64}[1/50 1/50;1/50 1/50];JosephsonCircuits.YtoB(Y)
2×2 Matrix{ComplexF64}:
 -1.0+0.0im  -50.0+0.0im
  0.0+0.0im   -1.0+0.0im

References

Russer, Peter. Electromagnetics, Microwave Circuit, And Antenna Design for Communications Engineering, Second Edition. Artech House, 2006.

source
JosephsonCircuits.YtoB! Method
julia
YtoB!(B::AbstractMatrix,Y::AbstractMatrix,tmp::AbstractMatrix)

See YtoB for description.

source
JosephsonCircuits.YtoS Function
julia
YtoS(Y;portimpedances=50.0)

Convert the admittance parameter matrix Y to a scattering parameter matrix S and return the result. portimpedances is a scalar, vector, or matrix of port impedances. Assumes a port impedance of 50 Ohms unless specified with the portimpedances keyword argument.

Examples

julia
julia> Y = Complex{Float64}[1/50.0 0.0;0.0 1/50.0];JosephsonCircuits.YtoS(Y)
2×2 Matrix{ComplexF64}:
 0.0+0.0im  0.0-0.0im
 0.0-0.0im  0.0+0.0im

References

Russer, Peter. Electromagnetics, Microwave Circuit, And Antenna Design for Communications Engineering, Second Edition. Artech House, 2006.

source
JosephsonCircuits.YtoS! Method
julia
YtoS!(S::AbstractMatrix,Y::AbstractMatrix,tmp::AbstractMatrix,sqrtportimpedances)

See YtoS for description.

source
JosephsonCircuits.YtoZ Function
julia
YtoZ(Y)

Convert the admittance matrix Y to the impedance matrix Z, its inverse, and return the result.

source
JosephsonCircuits.YtoZ! Method
julia
YtoZ!(Z, Y, tmp)

See YtoZ for description.

source
JosephsonCircuits.ZtoA Function
julia
ZtoA(Z)

Convert the impedance matrix Z to the ABCD matrix A and return the result.

Examples

julia
julia> Z = Complex{Float64}[50.0 50.0;50.0 50.0];JosephsonCircuits.ZtoA(Z)
2×2 Matrix{ComplexF64}:
  1.0+0.0im  0.0-0.0im
 0.02+0.0im  1.0+0.0im

References

Russer, Peter. Electromagnetics, Microwave Circuit, And Antenna Design for Communications Engineering, Second Edition. Artech House, 2006.

source
JosephsonCircuits.ZtoA! Method
julia
ZtoA!(A::AbstractMatrix,Z::AbstractMatrix,tmp::AbstractMatrix)

See ZtoA for description.

source
JosephsonCircuits.ZtoB Function
julia
ZtoB(Z)

Convert the impedance matrix Z to the inverse chain matrix B and return the result.

Examples

julia
julia> Z = Complex{Float64}[50.0 50;50 50];JosephsonCircuits.ZtoB(Z)
2×2 Matrix{ComplexF64}:
  1.0+0.0im  0.0-0.0im
 0.02+0.0im  1.0+0.0im

References

Russer, Peter. Electromagnetics, Microwave Circuit, And Antenna Design for Communications Engineering, Second Edition. Artech House, 2006.

source
JosephsonCircuits.ZtoB! Method
julia
ZtoB!(B::AbstractMatrix,Z::AbstractMatrix,tmp::AbstractMatrix)

See ZtoB for description.

source
JosephsonCircuits.ZtoS Function
julia
ZtoS(Z;portimpedances=50.0)

Convert the impedance parameter matrix Z to a scattering parameter matrix S and return the result. portimpedances is a scalar, vector, or matrix of port impedances. Assumes a port impedance of 50 Ohms unless specified with the portimpedances keyword argument. A complex port impedance Z_k defines the pseudo-waves a_k = (V_k + Z_k I_k)/(2 sqrt(Z_k)) and b_k = (V_k - Z_k I_k)/(2 sqrt(Z_k)), which a load of impedance Z_k matches, rather than power waves.

Examples

julia
julia> Z = Complex{Float64}[0.0 0.0;0.0 0.0];JosephsonCircuits.ZtoS(Z)
2×2 Matrix{ComplexF64}:
 -1.0+0.0im   0.0+0.0im
  0.0+0.0im  -1.0+0.0im

References

Russer, Peter. Electromagnetics, Microwave Circuit, And Antenna Design for Communications Engineering, Second Edition. Artech House, 2006.

source
JosephsonCircuits.ZtoS! Method
julia
ZtoS!(S::AbstractMatrix,Z::AbstractMatrix,tmp::AbstractMatrix,oneoversqrtportimpedances)

In place version of ZtoS, writing into S with tmp as scratch and oneoversqrtportimpedances the reciprocal square roots of the port impedances.

source
JosephsonCircuits.ZtoY Function
julia
ZtoY(Z)

Convert the impedance matrix Z to the admittance matrix Y, its inverse, and return the result.

source
JosephsonCircuits.ZtoY! Method
julia
ZtoY!(Y, Z, tmp)

See ZtoY for description.

source