C10 · Lesson 24 · Matching lab
Designing L-networks, stub tuners and transformers in Python
On a Smith chart, matching is a matter of sliding along circles until you reach the center. In code it's a few formulas, and code checks itself: you can design a match, then compute the input impedance of the result and confirm it really is 50 Ω. In this lab you'll write an L-network designer, the single-stub tuner (both solutions), a binomial transformer, and a check of a quarter-wave transformer's bandwidth against its formula.
- The curve is the reflection seen through a quarter-wave transformer from 50 Ω to a load R, computed exactly by transforming the load through the λ/4 section at each frequency.
- The dashed line is a target reflection; the readout is the fractional band the formula predicts below it.
- The curve crosses the target exactly at the predicted band edges. In the lab you'll compute the same check in code.
Predict
A single shunt stub can match any load with a nonzero resistance. How many distinct positions along the line (within half a wavelength) work?
Two. The admittance seen moving along the line traces a circle on the Smith chart, and it crosses the circle of unit conductance twice per half wavelength. At each crossing, a stub of the right length cancels the susceptance. The two solutions differ in stub length and bandwidth; the shorter combination is usually the broader one.
Name it
L-network
To match to : , a series reactance next to the low resistance, and a shunt reactance across the high one, of opposite types.
Single shunt stub
For a load on a line of , the distances d where the line's admittance has conductance come from :
(or when ), with , plus ½ if negative. The susceptance there is
and a shorted stub must supply −B: its length is , modulo ½.
Binomial transformer
for n = 0 to N − 1, starting from .
Checking
Every design here can be checked the same way: transform the load through each element with the input-impedance formula and confirm the result is at the design frequency.
Worked example
Find both shorted-stub solutions for = 60 − j80 Ω on a 50 Ω line.
Show the solution
- The square root in the formula for t.
- The two values of t. which is 0.832 or −16.8.
- Stub positions. Those give d = 0.110λ or 0.259λ.
- Stub lengths. The susceptances there need stubs of 0.095λ and 0.405λ.
- Check. These are the textbook answers (Pozar's Example 5.2), and putting either pair back through the formulas gives exactly 1/50 S at the junction.
Answer a 0.095λ stub at d = 0.110λ, or a 0.405λ stub at d = 0.259λ.
Worked example
Design a three-section binomial transformer from 50 Ω to 100 Ω.
Show the solution
- Weights. , and the binomial weights for N = 3 are 1, 3, 3, 1 over 8.
- First section.
- Second section.
- Third section. and the last eighth reaches 100 Ω.
- Check the symmetry. The middle section is exactly , as symmetry demands.
Answer sections of 54.5 Ω, 70.7 Ω and 91.7 Ω.
Check
An L-network matches 12.5 Ω to 50 Ω at 50 MHz with a series inductor next to the load. What inductance?
Write units the way you normally would: 1.5 nH, 1500 pH and 0.0015 µH are the same answer.
Check
Write l_network(Rlow, Rhigh): return (Q, Xs, Xp), the Q, the series reactance next to Rlow and the shunt reactance across Rhigh (as positive magnitudes).
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Write single_stub(ZL, Z0): both shunt shorted-stub solutions, as a sorted list of (d, l) in wavelengths, each between 0 and ½.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Write binomial(Z0, ZL, N): the N section impedances of a binomial transformer, starting next to Z0.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Write qw_bandwidth(Z0, ZL, gm): the fractional band (as a fraction, not a percentage) of a quarter-wave transformer for |Γ| < gm, by the formula. Then write qw_gamma(Z0, ZL, x): the exact |Γ| at x times the design frequency, by transforming ZL through the section.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Explain why
Why do the two single-stub solutions usually have different bandwidths?
Both solutions give a perfect match at the design frequency, but they get there through different lengths of line and stub. Away from that frequency, every piece of line changes its electrical length in proportion to frequency, and longer pieces change more, so the admittances drift further from their design values. The solution with the shorter total length, line plus stub, usually stays closer to matched over a wider band. That's why designers compute both and pick the shorter one unless the layout forces the other.
Practice
Keep practicing
One kind of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.