Qu

smith

Builtin index · Plotting

smith(Z, [z0=], [grid=], [color=], [lw=], [ms=])

Input: Z, z0, grid, color, lw, ms · Output: no output

What it is

Impedance on the reflection-coefficient plane: z = Z/z0, Γ = (z−1)/(z+1), drawn on the unit disc ruled by constant-resistance circles and constant-reactance arcs. Both families are exact — the Möbius map takes circles to circles. z0= defaults to 50 Ω; grid=false draws the locus alone. Sets equal aspect, because on unequal axes the circles become ellipses and every angle on the chart is wrong.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
smith(Z, [z0=], [grid=], [color=], [lw=], [ms=])
Z —Impedance on the reflection-coefficient plane: z = Z/z0, Γ = (z−1)/(z+1), drawn on the unit disc ruled by constant-resistance circles and constant-reactance arcs.
z0 optionalz0= defaults to 50 Ω.
grid optionalgrid=false draws the locus alone.
color optionalnot documented yet
lw optionalnot documented yet
ms optionalnot documented yet
no outputBoth families are exact — the Möbius map takes circles to circles. Sets equal aspect, because on unequal axes the circles become ellipses and every angle on the chart is wrong.

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

How it works

polarplot(theta, r) — plots (theta, r) polar-coordinate data by converting to Cartesian (x = r*cos(theta), y = r*sin(theta)) and drawing an ordinary line/scatter series on a square-aspect panel. Not a native polar-axis renderer — there are no circular gridlines, angular tick correctly-shaped polar curve today without a from-scratch renderer rewrite, at the cost of Cartesian-looking axes. smith(Z, [z0=], [rings=], [grid=]) -- impedance on the reflection-coefficient plane. z = Z / z0 (normalized impedance) G = (z - 1)/(z + 1) (reflection coefficient) The chart is the unit disc of G, ruled by two families of circles. Constant NORMALIZED RESISTANCE r maps to the circle centred at (r/(1+r), 0) with radius 1/(1+r); constant REACTANCE x maps to the circle centred at (1, 1/x) with radius 1/|x|, of which only the part inside the unit disc is physical. Both are exact, not approximations: the Moebius map that takes z to G takes circles to circles. Drawn as ordinary series, like the polar grid, so no second renderer is needed and every backend gets it for free.

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.