LibreVNA is an open-source vector network analyzer that covers a frequency range of 100 kHz to 6 GHz. Its hardware is completely open: the schematic, the PCB routing, the bill of materials (BOM) and the layer stack-up are all public. That makes it one of the few RF projects in the hardware industry where anyone can look inside and learn how a real product is designed. We'll cover several sections of this amazing project in a series of articles, and this first one looks at how the stimulus signal is filtered right after the main source that generates it.

By the end of this article, you'll understand:

  • Why the output of the MAX2871 needs filtering
  • Which type of filter fits, and why LibreVNA uses three of them
  • Why selecting them takes an RF switch, and why a normal switch won't do

About This Series

LibreVNA was created by Jan Käberich, and the project dates back to 2021, when version 1.0 was released and Hackaday featured it as a quality open-hardware vector network analyzer. The hardware was originally designed in EAGLE, one of the EDA tools used to create schematics and PCB layouts, which was acquired by Autodesk. In 2024, thanks to contributions from the community, it was migrated to KiCad EDA. In this first part of the series, let's focus our attention on the selection of the filters.

The Source in One Picture

A VNA needs a stimulus: a clean sine wave at a precisely known frequency, sent into the device under test. In LibreVNA, the stimulus above 25 MHz comes from the MAX2871 PLL synthesizer. Below 25 MHz, a separate Si5351 clock generator takes over through its own low-pass filter. Here is what happens between the MAX2871 and the rest of the signal chain:

The MAX2871 feeds a DC-blocking capacitor, then SP4T switch IC11, which routes the signal through LP1, LP3, LP2 or a straight path into SP4T switch IC12
The high-band source, redrawn from the LibreVNA schematic in the style of the project's own RF block diagram.
  • The MAX2871 has open-collector differential outputs, so each output pin needs a pull-up to the supply. LibreVNA uses 49.9 Ω resistors (R12 and R13). The positive output feeds the filter bank. The unused negative output is terminated into another 49.9 Ω resistor (R14) through a capacitor, which is what the datasheet asks for when only one side is used.
  • C65 blocks the DC from the pull-up and passes the RF to IC11, an RFSW6042 SP4T (single-pole, four-throw) RF switch.
  • IC11 routes the signal into one of four paths: LP1, LP3, LP2 or a straight-through line.
  • IC12, a second RFSW6042, collects the selected path and sends it on to the band-select switch, the step attenuator and the amplifier.

Why Filter the Output of the MAX2871?

How the MAX2871 Covers 23.5 MHz to 6 GHz

Inside the MAX2871, the VCOs only cover 3 GHz to 6 GHz. Everything below that comes from an output divider that divides the VCO by 1, 2, 4 and so on, up to 128:

Output frequency Divider What comes out
3000–6000 MHz ÷1 The VCO itself
1500–3000 MHz ÷2 A divided signal
750–1500 MHz ÷4 A divided signal
… … …
23.5–46.875 MHz ÷128 A divided signal

Where the Harmonics Come From

A frequency divider is a digital circuit. What comes out of it looks much more like a square wave than a sine wave, and a square wave is full of harmonics. The MAX2871 datasheet quantifies it:

MAX2871 output 2nd harmonic 3rd harmonic
Fundamental VCO output (÷1) −40 dBc −34 dBc
VCO output divided by 2 −25 dBc −20 dBc

The datasheet only specifies the ÷2 case, but the trend is clear: once the divider is in the path, the harmonics come up by 15 dB or more. For reference, an ideal square wave's 3rd harmonic has one third of the fundamental's amplitude, only 9.5 dB below it.

Why a VNA Cares About Harmonics

A VNA measures how a device responds at one frequency at a time. If the stimulus also carries energy at 2× and 3× that frequency, the measurement is no longer ideal, because part of the energy sits at frequencies where it shouldn't be:

  • Harmonic mixing in the receiver. The receiver mixes the incoming signal with a local oscillator (LO) down to an intermediate frequency (IF). Mixers also respond to harmonics of the LO, so the 3rd harmonic of the stimulus can mix with the 3rd harmonic of the LO and land on exactly the same IF as the wanted signal.
  • Frequency-selective devices make it worse. Picture a high-pass filter measured deep in its stopband. The fundamental is attenuated by 60 dB, but its 3rd harmonic sits in the passband and goes straight through. The VNA can end up reporting the harmonic leakage instead of the real rejection, and the measured dynamic range collapses.
  • Generator and spectrum modes. LibreVNA can also work as a signal generator, where a clean output spectrum is the whole point.

Bottom line: the MAX2871 output is a good frequency source, but not a clean enough stimulus on its own. The harmonics must come down before the signal reaches the ports.

Which Type of Filter?

Harmonics always sit above the fundamental. That makes the choice simple: a low-pass filter passes the wanted signal and attenuates everything above its cutoff. A band-pass filter would also work, but you would need many more of them to cover the range, and a high-pass section would add nothing here. Our guess is that Jan's goal in this particular case was to keep the BOM and the board space small, which makes low-pass filters the right choice for cost optimization.

LibreVNA uses KYOCERA AVX LP0603 thin-film low-pass filters. Each one is a complete 50 Ω filter in a 1.6 mm × 0.8 mm LGA package, so there are no inductors to tune and no layout-dependent filter to design. And they really are tiny: having assembled a LibreVNA unit myself, I can tell you that placing these little ones by hand makes for a fun, geeky weekend.

According to the datasheet, these filters have 0.3–0.5 dB of insertion loss. In the worst case of 0.5 dB, about 89% of the input power reaches the output.

Why LP1, LP2 and LP3?

A single low-pass filter can't serve the whole range. If its cutoff is above 6 GHz, it removes nothing useful at 1 GHz. If its cutoff is at 1 GHz, it blocks everything above 1 GHz. The answer is a bank of filters, each covering a slice of the range, with its cutoff just above the top of that slice.

The Band Plan

Stimulus frequency Path Filter (datasheet band) Typical attenuation
25–900 MHz LP1 LP0603A0947 (935–960 MHz) 25 dB at 2×F0, 17 dB at 3×F0
0.9–1.8 GHz LP3 LP0603A1880 (1840–1920 MHz) 25 dB at 2×F0, 17 dB at 3×F0
1.8–3.5 GHz LP2 3.5 GHz LP0603 (3400–3600 MHz) 30 dB at 2×F0, 20 dB at 3×F0
3.5–6 GHz Straight through None Not needed (see below)

A few details are worth pointing out:

  • Each band ends at or below its filter's specified band. LP1 is used up to 900 MHz and is specified for 935–960 MHz. LP3 is used up to 1.8 GHz and is specified for 1840–1920 MHz. LP2 is used up to 3.5 GHz and is specified for 3400–3600 MHz. The wanted signal always stays in the low-loss part of the filter's response.
  • The bands are about an octave wide. At the bottom of each band, the 3rd harmonic lands at three times the frequency, well into the stopband. At 900 MHz, for example, the 3rd harmonic is at 2.7 GHz, far above LP3's 1.92 GHz band edge.
  • Above 3.5 GHz no filter is needed. The MAX2871 runs its VCO directly (÷1), with the best harmonic figures in the datasheet. Its 2nd harmonic also falls at 7 GHz or more, above the instrument's 6 GHz range.

How the Firmware Picks a Path

The filter is chosen automatically for every point of a sweep. This is the selection logic from the LibreVNA firmware (FPGA.cpp), which tells the FPGA which switch setting to use:

jankae/LibreVNA/Software/VNA_embedded/Application/Drivers/FPGA/FPGA.cpp Lines 244 to 253 in c477819
// Select source LP filter
if (frequency >= 3500000000) {
send[1] |= (int) LowpassFilter::None << 8;
} else if (frequency >= 1800000000) {
send[1] |= (int) LowpassFilter::M3500 << 8;
} else if (frequency >= 900000000) {
send[1] |= (int) LowpassFilter::M1880 << 8;
} else {
send[1] |= (int) LowpassFilter::M947 << 8;
}

The FPGA then drives the two control pins (C1 and C2) of both RF switches. A full 25 MHz to 6 GHz sweep crosses three filter boundaries, so the switches change state several times per sweep, sweep after sweep.

Why an RF Switch?

The filters exist, but only one of them may be in the signal path at a time, and it must change in the middle of a sweep under firmware control. That calls for an electronically controlled switch with four positions.

Why Not a Normal Switch?

Here are the alternatives, and why they don't fit:

Option What goes wrong at 6 GHz
CMOS analog switch or multiplexer Built for DC to tens or hundreds of MHz. Its on-resistance and pin capacitance aren't a 50 Ω match, so at GHz frequencies it reflects and attenuates the signal, and its isolation between channels collapses.
Mechanical relay RF relays can perform very well, but they are large, take milliseconds to switch, and wear out mechanically. A VNA that changes filters several times per sweep, all day long, would burn through them.
RF switch IC (RFSW6042) Designed for a 50 Ω RF path, with a rated range of 5 MHz to 6 GHz and two logic control pins.

One more property matters here: linearity. A switch that distorts the signal would regenerate the harmonics the filters just removed. RF switch ICs are specified for very high intercept points (IIP3 is listed at 71 dBm for the RFSW6042), so they pass the clean signal without adding new spurs.

The price is insertion loss: the signal passes through two switches and a filter. LibreVNA makes up for it later in the chain, where an amplifier and a digitally controlled attenuator set the final output power.

Design Takeaways

  1. Read the harmonic table of your synthesizer. Divided outputs are much dirtier than the VCO itself.
  2. Harmonics are above the signal, so use low-pass filters, and set each cutoff just above the top of its band.
  3. Make bands about an octave wide, so the 3rd harmonic of the lowest frequency lands in the stopband.
  4. Switch both ends of a filter bank. Unused paths left connected become stubs.
  5. Use a real RF switch for anything in the GHz range: matched, fast, durable and linear.