Qu

reflection_coefficient

Builtin index · Signal processing

result = reflection_coefficient(z, [z0=50])

Input: z, z0 · Output: result

What it is

z: an impedance — real or complex, scalar or vector (ohms); z0 (optional number, default 50): the real reference impedance.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = reflection_coefficient(z, [z0=50])
z scalar or vectorz: an impedance — real or complex, scalar or vector (ohms).
z0 number, optional (default 50)z0 (optional number, default 50): the real reference impedance.
result —
Returns Γ = (z - z0)/(z + z0), complex. Errors at z = -z0, where Γ is genuinely undefined rather than merely large (impossible for a passive load).

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