A Wire to Nowhere
Wires—either as cabling or PCB traces—connecting components are fundamental to any electronic system. But wires that go to nowhere, called stub filters, can have a useful role as well. In this article, Robert helps you understand and build stub filters, but also explains the dangers of accidentally including a stub filter in your PCB design.
Welcome back to “The Darker Side.” As electronics designers, we all know what a wire is and how it works, right? If we connect a wire from A to B, a current can flow between these two points. If we then disconnect the wire from B, no current can flow. The wire becomes useless because one of its ends is open.
True? Well, not always. If you don’t know why, then keep reading because this will be my topic this month. More precisely, my goal is to explain what a stub filter is, and how to build one. I will also show you that you may inadvertently make such a filter, for example with an improper printed-circuit design. This may jeopardize the performance of your project, at least if you are using high frequencies or fast digital circuits.
Finally, and as usual, I will not use math to convey these principles, but rather words and small experiments. So, the good news is that this article should be easy to read. The downside is that my explanations will approximate. Anyway, I hope that you will catch the important points. I will provide some resources for further reading, if you want to dig more deeply into the subject.
SINE+SINE = 0
Let’s start with a very simple mental experiment (Figure 1). Assume that you have a sine-shaped signal propagating on a wire. Such a signal has a given wavelength, usually noted as l (the Greek letter, “lambda”). This wavelength is the propagation speed of the signal along the wire, divided by the frequency of the signal. On a wire, or more exactly on a so-called transmission line comprising the wire and the accompanying current return path, the propagation speed will be close to the speed of light in free space, c, which is 300,000,000m/s.
Now, imagine that we delay this signal by half the wavelength. We get the same sine signal, but with an opposite phase. What happens if we then sum the original signal and its copy delayed by l/2? Naturally, they will cancel out, and the result will be zero—a null signal.
I’m sure you’ve followed me up to this point, right? So, you will also easily understand that, rather than delaying by l/2, we would get the same result if we delayed the signal twice—each time by l/4. Now look at Figure 2 for an easy way to do it. The signal is coming from the left, and is virtually split into two parts. Half of it continues to the output on the right, whereas the other half goes into a wire that introduces a l/4 delay. Assume that there is a reflector at the end of this wire. The signal will then be reflected back on the same wire, will be shifted again by l/4 on its way back, and will be merged with the original signal. As in my example above, this adds the signal and a copy shifted by half a wavelength, and we should get zero.
You may wonder how to actually make such a signal reflector, but long-time readers will remember an article I wrote several years ago called “Time Domain Reflectometry” (Circuit Cellar 225, April 2009). When a signal propagates on a transmission line and encounters an impedance mismatch, part of it is reflected back to the source because it can’t go anywhere else. And, if the impedance mismatch is 100%, then the full signal is reflected back. There are two easy ways to make a perfect impedance mismatch: An open circuit (infinite impedance) or a short circuit (0Ω impedance). The difference is the phase of the reflected signal—an open circuit reflects without any phase change, whereas a short circuit inverts the phase.
Let’s summarize. Figure 2 seems to show that if we have a transmission line and add a wire connected to nowhere (open circuited), we may cancel the signal if its length is equivalent to a quarter of the wavelength. Is it for real? You bet it is! Such a short wire to nowhere—or more precisely, a transmission line with open end—even has a name. It is called a “stub.“
QUCS TO THE RESCUE
Why not start to check if it is working using simulation software? Here, I propose to use QUCS (Quite Universal Circuit Simulator), a very good, free and open-source circuit simulation software. Don’t hesitate to download it and reproduce the example shown in Figure 3. It will take you no more than half an hour. QUCS can do plenty of things, but in particular, it can model transmission lines and run so-called S-parameter simulations.
I selected a signal source, P1, from the toolbox, connected it to two 50Ω transmission lines in series, and plugged the other end to another source, P2 (Figure 3). This may seem awkward, but for an S-parameter simulation, all ports should be connected to signal sources. The system then simulates the propagation paths from one source to the other. For example, the propagation from P1 to P2 is noted S21, or S[2,1] in QUCS’ syntax. Finally, I added a 37.5mm, open-ended transmission line as illustrated, making a T-shaped circuit. I then gently asked QUCS to calculate S21 with a signal frequency ranging from 100MHz to 8GHz, and to plot it with a decibel scale, thanks to a short equation that converts volt ratios to dBs.
The resulting graph is depicted on the bottom of Figure 3. What do we see? For low frequencies, the transmission is 0dB, which means no loss. Not a surprise, since even a wire with an open stub does transmit electricity. However, what happens at a frequency of 2GHz? The transmission is close to 0 (-40dB, which means that only 10-40/10 = 1/10,000 of the power is transmitted). Why is this happening at 2GHz? Simply because the open stub is 37.5mm long, and that 37.5mm is a quarter of the wavelength for 2GHz! l= c/f = 300,000,000 m/s / 2,000,000,000Hz = 0.15m, divided by 4, or 37.5mm. A word of caution here: QUCS assumes by default that the propagation speed is c. On a real cable it will be a little lower, maybe 80% or 90% of c, but you get the idea.
So, such an open stub in fact makes a band-reject filter. It passes the signals, except close to 2GHz where the attenuation is very high. If you look again at Figure 3, you will see that there is something interesting when the frequency continues to increase. There are other frequencies where the attenuation is very high, precisely at 6GHz, 10GHz and every 4GHz thereafter (although not shown in the Figure 3 graph). I’m sure you will easily discover why.
Here’s the trick:
3 × 2 × l/4 = l + 2 × l/4 …
Up to now, I have used open-circuited stubs, which are reflecting the signal in phase. In contrast, what would be the effect of a short-circuited stub? Well, nearly the same, but with a twist. A short-circuited stub introduces a 180-degree phase shift to the reflected signal. A cancellation of the signal is still possible, but this time with a l/2 long stub rather than l/4 (Figure 4). Two times l/2 is l so the propagation back and forth is in phase, and the short-circuited reflector inverts the phase. Therefore, the sum is zero again.
I modified the QUCS simulation to show you what happens with a short-circuited stub. Figure 5 is exactly the same design as the one we previously discussed, but now with a short to ground at the end of the 37.5mm stub. The first null is no longer at 2GHz but at 4GHz, because half the wavelength is 37.5mm at this frequency, as expected. The signal is now canceled at 4GHz, 8GHz and so forth. The simulation also shows you an important point. With a short-circuited stub, there is also a zero transmission at a frequency of 0Hz, meaning for DC signals. That’s clear if you look again at the design. The stub is a short circuit, so no DC current can flow because it is short-circuited to ground.
TO THE LAB
Simulations are nice, but wouldn’t it be preferable to see an actual experiment? With that in mind, I went to my company’s labs and switched on our Keysight Technologies N5230A vector network analyzer. This nice test instrument is, in fact, doing exactly the same as the QUCS simulation described earlier. It injects a signal of varying frequency into a device under test, and plots its transmission and reflections on a graph. For a quick demonstration, I simply interconnected two of its ports with a short coaxial cable, and added a SMA T adapter, ended with a 3cm SMA/SMA adapter, to simulate a 37mm open transmission line (Figure 6). I pressed some buttons, and voilà! The result is shown in Figure 7. Very close to the simulation isn’t it? Cool, so that’s actually real! Here the first null was measured at a frequency of 2.0GHz, and the second at 6.16GHz. This is not exactly 6GHz as expected, probably due to some parasitics somewhere.
OK, I must admit that I am a bit lucky to have such expensive test equipment on hand. So, I wanted to find a way for you to reproduce the same experiment with equipment you will have on your bench, or that you could buy for reasonable prices on eBay. And this is indeed easy! The key is to get far down in frequency. Going to lower frequency means longer wavelengths, and therefore longer cables as stubs.
What would you need to do the experiment? First, you will need a long length of coaxial cable to make a long open-ended stub. The longer the better. I found a 10m long cable on my bench, so it should cut frequencies of wavelength close to 40m (l/4 = 10m), which means f = c/l =7.5MHz, or, more exactly, around 6MHz. That’s because the propagation speed in the cable is not the speed of light, but rather 80% of it. Next, you need a signal generator able to go up to 6MHz. If you don’t have one, building one is a nice exercise! Finally, you will need a way to measure the transmitted signal, and the easiest way is to use an oscilloscope. It could be a very cheap one, because 10MHz of bandwidth is enough. On my side, I used a Keysight 33521A generator and a Keysight DSO-X 3024A oscilloscope, but they are truly both overkill for this job.
Now, switch on the equipment, start with a frequency of 0Hz and slowly increase the frequency. Take a piece of paper and plot the transmitted power versus frequency, and you will find a null at 6MHz! The plot can be done manually or, if you are lucky, by switching the frequency generator to sweep mode as I did. This allows you to get the plot directly on the oscilloscope, if you trigger it carefully. Looking again at Figure 8, the scope shows the envelope of the transmitted signal from 0 to 20MHz. Two nulls are clearly visible, close to 6MHz and 3×6 = 18MHz, as expected.
PRINTED CIRCUIT BOARDS
I talked about the effects of open-circuited wires or coaxial cables, but the same phenomenon exists for any kind of transmission line. In particular, it will happen if you design a PCB and leave a short copper trace open-ended. This might or might not be an issue, as we will see in a minute, because it all depends on the signal frequency and trace length.
Another simulation may be welcome here. Rather than using QUCS again, I switched to another and a bit more complex tool: Sonnet. This software is neither open source nor free, but a free, limited Sonnet Lite version is available from Sonnet Software’s website. Unlike QUCS, Sonnet is not a circuit simulator, but rather an actual electromagnetic simulator. It uses a so-called planar or 2.5D model. The design to be simulated must be modeled as parallel dielectric layers, with metal structures between each layer. This is more limited than a full 3D simulator, but far faster in terms of calculations. This is good enough for PCB simulations.
The example I made with Sonnet Lite is shown in Figure 9. On the far left you can see the layer structure— a 1.6mm FR4 substrate and air on top of it, with a full ground plane on the bottom layer. I then drew two rectangular copper traces on the top side of the PCB—one from port 1 to port 2, and one open-ended stub. The traces are 3mm wide, which is a good width for a 50Ω transmission line on a 1.6mm thick FR4 PCB. (See my previous article on the subject: “Microstrip Techniques,“ Circuit Cellar 223, February 2009.) The length of the open-ended trace is 22mm.
I then ran the simulation, and a couple of minutes later, I got the nice plot shown in Figure 8. Very close to the theory again! Here the first null is at 1.825GHz. Since the open trace is 22mm long, we would expect a null for a wavelength of 88mm, so a frequency of 3.4GHz. However, the propagation speed on a FR4 substrate is far lower than the speed of light. The ratio is, in fact, the square root of the so-called effective dielectric constant of the trace. With such a trace on FR4, this ratio is close to 1.8, and this explains why a 22mm trace is equivalent to a quarter wave at 1.825GHz.
The Sonnet simulation also shows that the other nulls, higher in frequency, are lower and lower in terms of attenuation. This effect is clearly visible in the graph in Figure 9, and is due to the losses in the substrate, well simulated by the tool. Finally, such a simulator can represent the currents on the traces at any frequency, using a color grading scheme. What’s happening at the null frequency of 1.825GHz is shown in Figure 10. This figure is helpful for understanding that the incoming and reflected signals are canceling out at the junction point, with a quarter wavelength exactly equal to the trace length.
Once again, don’t hesitate to download Sonnet Lite, and try to reproduce this example for yourself. You will learn a lot, even though you will probably need to spend time learning the software through the available tutorials.
Stubs, intentionally designed using open- or short-circuited transmission lines, are actually used to build radio-frequency filters, and now you know how. Several stubs, well designed and with proper separation between them, can be used together to implement far more complex responses than the basic examples I’ve illustrated. This may bring us a little too far for this article.
That said, I would like to share with you that you may also build stub filters unintentionally. How? Imagine that you design a kind of 2.4GHz transmitter—maybe Bluetooth—using an IC and some passive components around it. You must design two variants of your product, using two different kind of antennas. Say one is ended with a SMA connector, and the other is a dipole ended with a differential flex cable. Maybe you would design a PCB like the one illustrated in Figure 11a. Warning—this is not an actual design, just an illustration for this article. Here the transmitter circuit is supposed to be on the lower left, and the antenna trace goes simultaneously to the SMA connector, J1, and to some components feeding the flex cable connector, J2. That’s clever, because, depending on the need, you will solder either J1 or J2 and its passive components, so you will have only one PCB and two versions. Right?
Wrong! This would be a very, very bad idea, and I’m sure you now know why. Imagine that you populate only the connector, J1, and leave J2 and the small accompanying passive unpopulated. OK, but the trace going from J1 to the pads planned for R7 and R9 will be an open-ended trace. It will therefore act as a stub, and will cancel out signals with frequencies for which its length is a quarter of the wavelength. And, do you know what will happen? Murphy’s Law states that everything that can go wrong will go wrong. So, for sure, the frequency that will be canceled will be exactly the frequency you want to use. And your design will simply not work—all because of a short open-circuited trace.
What would be a good solution? Simply avoiding any open-circuited stub on any high frequency line. Figure 11b shows a possible way. Here I added two 0Ω resistors, R10 and R11. These two components are positioned exactly at the Y junction between the two intended paths. Of course, only one of them will be populated. Therefore, there will be no open-circuit line at all, and no Murphy-related risk. For the lowest possible risk, it is indeed a good practice to share a single pad between the two components, R10 and R11, as illustrated, thus avoiding even a 1mm stub.
Here we are. As always, I have only covered the basics, and with simplified explanations. Stubs can be used to make any kind of filters or impedance-matching networks, especially at high frequencies. Stubs can also be the source of serious headaches for the incautious PCB designer. So, knowing what they are about is crucial. This is true not only for high-frequency designs, but also for high-speed electronics. A fast, digital signal with nanoseconds-long transitions should be treated with the same care as a radio-frequency signal in the gigahertz range. Put simply, a PC motherboard with its multi-Gbps PCI express links will never work with uncontrolled stubs or bad PCB routing! And even if you are not designing PC motherboards, I’m sure that you encounter fast digital transmissions often. For example, USB is replacing RS-232 links in many systems—and the frequency range is not exactly the same.
To close, I can’t resist the pleasure of showing you an old test instrument that is actually based on a stub-like structure (Figure 12). It is a Hewlett Packard HP 532A frequency meter from the 1960s, borrowed from my colleague Yannick Avelino. (Hewlett Packard later became Agilent and then Keysight). How does such a frequency meter work? At the bottom of the device, there is a transmission line. Here it is made with a waveguide, but this is the same as a wire transmission. The transmission line is ended by a diode detector, clearly visible on the right side.
On top of this transmission line, there is a vertical tube, which is an adjustable cavity. This cavity is the waveguide equivalent of a short-circuited stub. Its length can be adjusted, thanks to a precision helix associated with a calibrated dial. The use is then straightforward. The user injects a signal of unknown frequency and turns the knob, while looking at the power measured by the diode detector. At a given position, the signal on the detector will be drastically attenuated. At that precise point, the cavity length corresponds to half a wavelength, and the dial directly indicates the corresponding frequency—up to 26GHz! Who said that microwaves have to be complicated?
I hope that you liked this small introduction to stubs. I encourage you to read the articles in RESOURCES below. More importantly, I urge you to play with stubs, using either simulators or actual experiments. Don’t be afraid. It will be fun, and you will learn a lot!
How does a stub filter work?
Coaxial stub notch filter designer
RF Tutorial Lesson 9. Impedance matching using stubs
Content is available under Creative Commons Attribution Non-Commercial Share Alike
QUCS circuit simulator
SONNET LITE planar EM simulator
Keysight N5230A PNA-L network analyzer
Keysight 33521A 30MHz arbitrary signal generator
Keysight DSO-X 3024A oscilloscope stub filter
“Time Domain Reflectometry” (Circuit Cellar 225, April 2009)
“Microstrip Techniques”, Circuit Cellar 223, February 2009.)
Keysight Technologies | www.keysight.com
Sonnet Software | www.sonnetsoftware.com
PUBLISHED IN CIRCUIT CELLAR MAGAZINE • OCTOBER 2020 #363 – Get a PDF of the issueSponsor this Article
Robert Lacoste lives in France, between Paris and Versailles. He has more than 30 years of experience in RF systems, analog designs and high-speed electronics. Robert has won prizes in more than 15 international design contests. In 2003 he started a consulting company, ALCIOM, to share his passion for innovative mixed-signal designs. Robert is now an R&D consultant, mentor and trainer. Robert’s bimonthly Darker Side column has been published in Circuit Cellar since 2007. You can reach him at email@example.com.