Qu

vswr

Builtin index · Signal processing

result = vswr(g)

Input: g · Output: result

What it is

g: a reflection coefficient.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = vswr(g)
g numbernot documented yet
result number
Returns (1 + |Γ|)/(1 - |Γ|). A perfect match is exactly 1; total reflection is inf, which is the true value rather than a large stand-in. |Γ| >= 1 (an active or mismeasured load) returns inf rather than the negative number the unguarded formula produces.

Examples

From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.

g = reflection_coefficient(100)         # 100 ohm on a 50 ohm line

print("gamma = {g}")                     # 0.333333

print("VSWR  = {vswr(g)}")                # 2

print("RL    = {return_loss(g)} dB")      # 9.542425


swept = reflection_coefficient([50, 100, 0, 25])
print("VSWR swept = {vswr(swept)}")       # [1, 2, inf, 2]  -- the short is inf


smith([50, 100, 25], z0=50)               # same arithmetic, drawn

output
gamma = 0.333333
VSWR  = 2
RL    = 9.542425 dB
VSWR swept = [1, 2, inf, 2]
-80 -60 -40 -20 0 0 150 300 450 Magnitude Response Frequency (Hz) Magnitude (dB) -150 -100 -50 0 50 100 150 0 150 300 450 Phase Response Frequency (Hz) Phase (deg) -250 -200 -150 -100 -50 0 0 150 300 450 Group Delay Frequency (Hz) Delay (samples) x=-0.135, y=0.991 x=-0.135, y=-0.991 x=0.57, y=0.821 x=0.57, y=-0.821 two tones in noise frequency (Hz) magnitude (dB)

from signal-processing