Sunday, April 14, 2013

Smith chart tuner

I couldn't find any good Smith chart plotters for Python, so I coded one up using matplotlib. The new matplotlib widgets are great!

Here's a screenshot of a coax-waveguide match tuner.

Here's the code for the Smith chart plot:

It's a lot of fun watching things move around on a Smith chart as you twiddle parameters.

I've been wondering why the curves always curve clockwise (as frequencies range from low to high). For purely reactive load, it makes sense in terms of Foster's theorem. But what happens with loads that have a resistive component?

A sketch of a proof/reason:
$z(f)$, with passive resistances, lives on the right half plane of $r + jx$. The y-axis, $r=0$, ends up as the $\Gamma=1$ circle. The vertical line $r=1$ gets mapped to the resistance circle. Everything to the right of the line $r=1$ ends up on the inside of the resistance circle.

The map $\Gamma(z(f)) = (z-1)/(z+1)$ is a Mobius transformation of the form $\Big(\frac{az+b}{cz+d}\Big)$ with determinant $ad-bc > 0$, so it should preserve handedness. Foster's theorem implies that the curve $z(f)$ always moves upwards monotonically, therefore the curve $\Gamma(f)$ always circulates clockwise.

p.s. $\textrm{LaTeX}$-t in here is thanks to this tip about MathJax, and code snippets thanks to Gist.