Part 5 of 6 · Design a 2.45 GHz hairpin band-pass filter
Published Nov 29, 2026 · Last updated Nov 29, 2026 · 13 min · IndieRF
Hairpin Filter Space Mapping: 4 EM Passes to 15.9 dB RL
Planar EM's result goes back into the schematic, the circuit is fitted to it, and the corrected circuit picks the next layout. Four passes take the 2.45 GHz hairpin from 2.4286 to 2.4351 GHz and from 11.3 to 15.9 dB worst return loss. The final layout passes 65.9% of boards against the revised requirements, and openEMS agrees on the centre and the loss but reads 5.7% more bandwidth.
Four passes of swap, fit and re-optimize move the hairpin filter's EM centre from 2.4286 to 2.4351 GHz and its worst return loss across 2.400 to 2.4835 GHz from 11.3 to 15.9 dB. From pass 2 on the centre moves 0.13 MHz or less, and the loop ends on the 50 µm grid with the tap stepping between 2.60 and 2.65 mm. One arm step shorter (16.35 and 16.45 mm arms, 1.10 mm gaps, 2.65 mm taps) centres the band on 2.4417 GHz and is the final layout, because it passes 65.9% of simulated boards against the revised requirements where the loop's own last pass passes 49.8%.
Part 1 picked the order, bandwidth and board, Part 2 measured the coupling in Planar EM, Part 3 optimized the circuit and Part 4 solved the layout. Part 5 puts that EM result back into the schematic until the layout stops moving, and Part 6 builds it.
The schematic's microstrip line model was corrected on 2026-12-03 (gap 28, engine 0.1.52): tl.mlin now runs 1.3% faster on this 1.6 mm line, so in the linked sheets a single hairpin resonates about 15 MHz higher and the filter's centre sits about 6 MHz higher than the numbers recorded here, which are the dry run's as it ran. The coupled-line model was corrected on 2026-12-04 (gap 51, engine 0.1.53): the tl.mclin pairs between hairpins now run about 1.3% faster, so the linked filters' centres sit a further 10 to 11 MHz higher; a single hairpin, whose own arms the model leaves uncoupled, does not move.
"Stopped moving" is decided before pass 1
Between two passes the EM centre has to move 2 MHz or less and the worst in-band return loss 0.5 dB or less. 2 MHz is a third of what one 50 µm arm step moves a resonator (131 MHz per mm, Part 2); 0.5 dB is a third of the 1.4 dB of return-loss margin the 0.1 dB ripple leaves over 15 dB (Part 1). Every dimension stays on the 50 µm grid, so the loop can also stop on the grid: when the next pick is a layout already solved, another pass would only repeat a run. Each pass costs one Planar EM solve, 12 to 18 minutes on one worker; every step around it takes seconds.
Swap in EM result: two models on one plot
Open the pass 1 layout in Planar EM and press Send to Schematic. The hairpin parts become a circuit with the layout's dimensions as variables, ports at the walls where EM has them. After the run, Properties, Swap in EM result puts the run's Touchstone file beside the circuit on the same nets, with two test states, Circuit and Planar EM, so one plot shows where the circuit and the fields disagree before anything changes. It replaces a copy and paste, four pin labels and two hand-built states.
To skip the 14-minute solve, the pass 1 A/B sheet opens with the swap done. It carries the dry run's goals, optimizer and layout ranges, so the clicks below give the numbers below.
Fit to data: how far off the circuit is
A circuit that reproduces EM can be trusted to pick the next layout. In the Goals tab, Fit to data reads the EM file as targets and fits a1, a2, s and t to it. Type two settings from the dry run:
- Bands. S21 in dB over 2.15 to 2.75 GHz, and S11 as a ratio over 2.30 to 2.60 GHz, where the reflection zeros are. A ratio keeps one deep zero from swamping the fit.
- Weights. After Write the fit, set the S21 goal's weight to 1 and the S11 goal's to 200 in Goals.
The loss knob stays ticked: it fits the substrate's tanδ as well, so the circuit matches EM's higher loss with loss and the four dimensions fit only the shape. Press Optimize, Apply, then End fit, which puts tanδ back to the board's 0.0037.
The fit lands at 16.587, 16.472, 1.440 and 3.006 mm, with tanδ 0.0054. Those four numbers say exactly how wrong the pairwise circuit is at this layout: to look like EM it needs a gap 0.33 mm wider than the 1.10 mm drawn and a tap 0.5 mm higher than the 2.50 mm drawn.
With the dialog's own bands and weights the fit's tap reads 3.023 mm instead of 3.006, and the pass below picks 16.40, 16.50, 1.10, 2.65 mm, which is pass 4's layout: the loop's last pass one step early. One grid step of tap is 0.03 mm of fitted tap, so the pick is that sensitive. I type the dry run's settings so the table below is the one you reproduce.
Update model, Round to grid, Apply to layout
Update model, under Fit to data, writes each circuit dimension from a layout variable through the fit:
and the same for a2, s (slope 1.3082) and t (slope 0.62511). Each slope is EM's response slope over the circuit's, from Part 3's tables: ln k against gap, −1.072 against −0.820 per mm; Qe against tap, −11.44 against −18.30 per mm. That is space mapping: a circuit that is right at this layout and still knows how the response moves, so it picks the next layout in seconds.
Optimize then moves the layout variables against Part 3's goals: 118 runs, to 16.398, 16.477, 1.109 and 2.662 mm. That meets every goal with nothing to spare, so rounding costs margin. Round to grid runs all 16 corners of the grid cell around it and keeps the best: 16.40, 16.50, 1.10, 2.70 mm at −0.88 dB of margin, where the nearest grid point (tap 2.65 mm) has −1.38 dB. The margins are negative because the corrected circuit reads return loss 1.2 to 2.5 dB worse than EM; they measure the model.
Apply to layout writes the new values into the hairpin parts, moves the neighbours, feeds and box with them, and gives a link that opens the next layout in Planar EM. It warns when a gap or tap moves more than 0.3 mm, about where the slopes held. Solve it, swap it in, and the next Update model starts pass 2.
Four passes
| Pass | Layout a1, a2, s, t (mm) | EM centre | Predicted | EM worst RL in band | Predicted | EM at 2.20 GHz | EM worst loss in band |
|---|---|---|---|---|---|---|---|
| 1 | 16.50, 16.50, 1.10, 2.50 | 2.4286 GHz | 2.4372 | 11.3 dB | 15.1 | 28.6 dB | 3.83 dB |
| 2 | 16.40, 16.50, 1.10, 2.70 | 2.4351 | 2.4355 | 16.6 | 14.1 | 28.7 | 3.26 |
| 3 | 16.40, 16.50, 1.10, 2.60 | 2.4350 | 2.4356 | 15.3 | 14.1 | 28.9 | 3.29 |
| 4 | 16.40, 16.50, 1.10, 2.65 | 2.4351 | 2.4355 | 15.9 | 14.5 | 28.8 | 3.27 |
Each prediction is the previous pass's corrected circuit; from pass 2 on it is within 0.6 MHz of EM's centre.
| Between passes | Centre moved | Worst RL moved | Rule (2 MHz, 0.5 dB) |
|---|---|---|---|
| 1 to 2 | 6.52 MHz | 5.29 dB | missed |
| 2 to 3 | 0.13 MHz | 1.24 dB | missed |
| 3 to 4 | 0.06 MHz | 0.61 dB | missed by 0.11 dB |
The centre stopped at pass 2, and the arms and gaps stayed put. The tap keeps stepping: the corrected circuit wants 2.59 to 2.61 mm, between grid points EM gives 15.3 and 15.9 dB. Pass 4's pick is pass 3's layout, the card says so, and the loop ends on the grid. Pass 4 keeps 2.65 mm for its 0.6 dB more return loss. A 25 µm grid would need four times 281,880 box cells, over the solver's 1,048,576 cap.
What the loop bought, one level up: 11.3 dB of return loss is 0.33 dB of mismatch loss at the worst point, 15.9 dB is 0.11 dB. 10 dB of return loss is 0.46 dB, so 2:1 VSWR is about half a dB; in a cascade two mismatched ports add or cancel around that number, so the next stage sees a ripple, not the number.

The final layout is one arm step shorter
Pass 4's 3 dB centre sits 6.3 MHz under 2.4414 GHz, yet its 15 dB return-loss band, 2.3844 to 2.4991 GHz, is centred on 2.4411 GHz: the tap's zero at 2.835 GHz steepens the upper skirt, so the 3 dB centre reads low. The goals hold return loss over Part 1's design edges, 2.3841 to 2.5001 GHz, and one grid step up loses the bottom edge.
One EM solve of 16.35 and 16.45 mm arms (643 s) moves everything up 6.6 MHz: centre 2.4417 GHz, worst in-band return loss 16.1 dB, 29.3 dB at 2.20 GHz (0.5 dB better) and 3.07 dB worst loss in band, 0.20 dB better. Over the design edges its return loss falls to 11.8 dB, so the loop's goals reject it. I pick it anyway, on yield: against the revised requirements it passes 65.9% of boards where pass 4 passes 49.8%. The requirements that bind are 2.20 GHz and loss at the top edge, so the board is better centred.
| Dimension | Part 3's mapped start | Pass 4 | Final |
|---|---|---|---|
| a1, end arms | 16.50 mm | 16.40 mm | 16.35 mm |
| a2, middle arm | 16.50 mm | 16.50 mm | 16.45 mm |
| s, gaps | 1.10 mm | 1.10 mm | 1.10 mm |
| t, taps | 2.50 mm | 2.65 mm | 2.65 mm |
| EM centre, worst RL in band | 2.4286 GHz, 11.3 dB | 2.4351 GHz, 15.9 dB | 2.4417 GHz, 16.1 dB |
The final layout opens in Planar EM, and its A/B sheet in the schematic. The smallest feature is still the 1.10 mm gap, 11 times the 0.10 mm JLCPCB prints on a 2-layer board.
Yield: 16.9% against version 0, 65.9% against version 1
Monte Carlo runs the final layout's corrected circuit over 1000 boards with Part 3's tolerances (εr ± 0.05, core ± 0.0508 mm, width ± 0.02 mm). Each board's return loss and rejection get EM's nominal offset from the circuit (+1.39 dB return loss, −0.74 dB at 2.20 GHz); loss stays the circuit's.
| Requirements | Uniform draws | Normal, limit at 3σ |
|---|---|---|
| Version 0: 30 dB at 2.20 GHz and at 3.30 GHz | 16.9% | 8.6% |
| Version 1: 28 dB at 2.20 GHz, 30 dB from 3.30 to 3.80 GHz | 65.9% | 94.6% |
| Version 1, read through openEMS | 21.6% | 25.7% |

2.20 GHz decides it: the nominal board sits at 29.3 dB in EM before any tolerance moves it. Version 0's whole 3.30 to 4.0 GHz band passes no board, since the spurious passband leaves 27.7 dB at 4.0 GHz; NR n78 ends at 3.80 GHz, where the layout has 34.0 dB.
I recommend version 1: keep 15 dB return loss and 3.0 dB loss, take 28 dB at 2.20 GHz, and end the high side at 3.80 GHz. Holding 30 dB at 2.20 GHz on this order and board passes one board in six; it needs a fourth resonator, about 1 dB more loss, or a transmission zero placed below the band.
The yield sheet opens set to 1000 boards. Run yield there counts 147 of 1000 against version 0 on the corrected circuit alone; the EM anchor is a step the dry run added per board in a script.
openEMS: a second solver, one miss
openEMS 0.37.0, a finite-difference time-domain solver, ran the final layout in the same box at two meshes, 0.744 and 1.876 million cells (25 and 49 minutes on four threads). The tolerances were set before the run: 0.6% on the centre, 5% on the 3 dB bandwidth, 2 dB at 2.20 GHz.
| Number | Planar EM | openEMS, 0.10 mm edge | openEMS, 0.07 mm edge | Verdict |
|---|---|---|---|---|
| Centre | 2.4417 GHz | 2.4417 | 2.4438 | pass, 0.003% and 0.09% |
| 3 dB bandwidth | 150.2 MHz | 161.8 | 158.8 | miss, 7.7% and 5.7% wider |
| At 2.20 GHz | 29.3 dB | 27.6 | 28.1 | pass, 1.7 and 1.2 dB |
| Worst loss in band | 3.07 dB | 2.55 | 2.56 | reported; the circuit says 2.52 dB |
| Tap's zero | 2.844 GHz | 2.930 | 2.933 | the circuit says 2.933 GHz |
It agrees on the centre within 2.1 MHz and on 2.20 GHz. On loss it sides with the circuit, 2.56 dB against Planar EM's 3.07 dB, so Planar EM's conductor loss reads high, as Part 4 warned, and version 1 keeps 3.0 dB.
The bandwidth misses at both meshes, and the 5% stays. The finer mesh moves it 3.1 MHz toward Planar EM, to a limit of 151.6 MHz (0.9% off) if the error is first order in the cell, or 155.8 MHz (3.7%) if second. A third mesh, about three hours, would say which, so the miss stays open. It brackets the yield: through openEMS, version 1 passes 21.6% of boards against Planar EM's 65.9%. openEMS is GPL software; only its numbers and our plots of them appear here.


Moving the spurious passband costs Part 2 again
A hairpin made of two line sections of equal electrical length puts its first spurious at f_s/f0 = π / (2 arctan √K), where K is the impedance of the open-ended sections over the centre's (Makimoto and Yamashita). K = 1 is this filter, 2.00 in theory and 1.83 in EM. K = 0.5 gives 2.55, near 6.2 GHz, and K = 0.4 gives 2.79. Lower-impedance ends mean wider arms at the coupled edges, so Part 2's couplings and taps are measured again, then another pass of this loop. For n78 the cheaper fix is version 1's 3.80 GHz edge.
The two solvers put this layout's yield between 22% and 66%, and only a built board can say which. Part 6 orders it and measures it.
References
- J. W. Bandler, R. M. Biernacki, S. H. Chen, P. A. Grobelny and R. H. Hemmers, "Space mapping technique for electromagnetic optimization," IEEE Transactions on Microwave Theory and Techniques, vol. 42, no. 12, pp. 2536–2544, 1994.
- M. Makimoto and S. Yamashita, "Bandpass filters using parallel coupled stripline stepped impedance resonators," IEEE Transactions on Microwave Theory and Techniques, vol. 28, no. 12, pp. 1413–1417, 1980.
- J.-S. Hong and M. J. Lancaster, Microstrip Filters for RF/Microwave Applications, Wiley, 2001: hairpin filters and the spurious passband of half-wave resonators.
- T. Liebig, openEMS, an open-source FDTD solver, GPL-3.0, openems.de.
- 3GPP TS 38.101-1, NR user equipment radio transmission and reception, Part 1: band n78, 3300 to 3800 MHz.
Questions? Contact
Discussion
No comments yet. Start the thread with a measurement, a correction, or a worked example.