C10 · Lesson 13 · Transmission line lab
Reflections, input impedance and bounce diagrams in Python
Lessons 7 to 11 worked reflections, standing waves and input impedance by hand, one case at a time. Engineers don't: they write a few lines of code once and run every case through it. In this lab you'll write that code with complex numbers: the reflection coefficient and VSWR of any load, a line's input impedance, the load voltage after each bounce, the impedance a TDR trace implies, and the length of a stub for any reactance.
- A step from a source of resistance drives a 50 Ω line ending in R. The staircase is the load voltage as reflections arrive, one round trip apart (time in units of the one-way delay).
- With either end matched, it settles on the first arrival. With both mismatched, it rings toward the DC divider value .
- Make both reflections the same sign (both resistances above 50 Ω, or both below): the steps approach from one side. Make them opposite: the voltage overshoots and rings.
Predict
A TDR launches 0.5 V into a 50 Ω cable and sees a reflection of +0.1 V from a discontinuity. What impedance does the discontinuity present?
75 Ω. Γ = 0.1/0.5 = 0.2, and Ω: perhaps a section of TV cable spliced in. A negative reflection would mean a lower impedance, such as a connector with too much capacitance.
Name it
The formulas in code
- , with an open load () giving exactly 1. Python's complex numbers handle reactive loads directly:
25 - 50j. - , infinite for .
- , and for an open load .
- Bounces: the launched step is ; each arrival adds the current wave times , and the next wave is the current one times .
- TDR: a reflected step on an incident step means and .
- Stubs: a shorted stub of length l looks like , so a reactance X needs , taken modulo ½ to keep it positive.
Worked example
A 1 V step from a 25 Ω source drives a 50 Ω line into 100 Ω. List the load voltage after each of the first three arrivals.
Show the solution
- Launched step and reflection coefficients.
- First arrival.
- Second arrival. The next wave is V, and at the load it adds 4/3 of that:
- Third arrival. The third adds +0.011 V:
- Final value. It closes on the DC divider value:
Answer the load reads 0.889 V, 0.790 V and 0.801 V, closing on 0.8 V.
Worked example
How long a shorted 50 Ω stub looks like −j50 Ω?
Show the solution
- Solve for the electrical length. A shorted stub looks like , so set : which gives .
- Make it a real length. Adding a half wavelength gives
- Why so long. A shorted stub needs to be between a quarter and a half wavelength to look capacitive.
- A shorter option. An open stub 0.125λ long would do the same job in less space.
Answer the shorted stub must be 0.375λ long.
Check
A TDR launches 0.5 V into 50 Ω and sees a −0.1 V reflection. What impedance is there?
Write units the way you normally would: 1.5 Ω, 1500 mΩ and 0.0015 kΩ are the same answer.
Check
Write gamma(ZL, Z0) (a complex number; math.inf means an open circuit and gives exactly 1) and vswr(ZL, Z0) (math.inf when |Γ| is 1).
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Write zin(ZL, Z0, bl): the input impedance of a line of electrical length bl radians ending in ZL (which may be math.inf).
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Write bounce(Vs, Rs, Z0, RL, n): the load voltage after each of the first n arrivals when a step of Vs from a source of resistance Rs drives a line of Z0 into a resistive load RL.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Write stub_length(Z0, X): the length, in wavelengths between 0 and ½, of a shorted stub that looks like jX.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Explain why
Why does a line's input impedance repeat every half wavelength, rather than every full wavelength?
The input impedance depends on the ratio of the reflected wave to the incident wave at the input. The reflected wave makes a round trip, out to the load and back, so moving the input by a distance l shifts its phase relative to the incident wave by 2βl. Moving by half a wavelength shifts it by , a full cycle, which brings the ratio, and so the impedance, back to where it started. That's also why a Smith chart goes round once per half wavelength of line, and why stubs never need to be longer than λ/2.
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.