Harmonic Mixing
The Si5351 frequency synthesizer has a practical upper limit around 200-300 MHz. To measure at VHF, UHF, and beyond, the NanoVNA-H uses a clever technique: harmonic mixing. By generating a fundamental frequency and mixing with its odd harmonics, the VNA can measure up to 1.5 GHz or higher.
The Frequency Threshold
Section titled “The Frequency Threshold”The firmware defines a boundary where it switches from direct synthesis to harmonic mode:
// From nanovna.h#ifdef __ZEETK__#define FREQUENCY_THRESHOLD 300000110U // 300 MHz for ZeeTK NE602A#else#define FREQUENCY_THRESHOLD 290000110U // 290 MHz for SA612A#endif- Below threshold: Direct frequency synthesis
- Above threshold: Harmonic mixing with odd harmonics (3rd, 5th, 7th…)
How Harmonic Mixing Works
Section titled “How Harmonic Mixing Works”Square Wave Harmonics
Section titled “Square Wave Harmonics”The Si5351 outputs square waves, which are rich in odd harmonics:
Square wave = sin(f) + (1/3)sin(3f) + (1/5)sin(5f) + (1/7)sin(7f) + ...| Harmonic | Relative Amplitude | dB below fundamental |
|---|---|---|
| 1st (fundamental) | 1.000 | 0 dB |
| 3rd | 0.333 | -9.5 dB |
| 5th | 0.200 | -14 dB |
| 7th | 0.143 | -17 dB |
| 9th | 0.111 | -19 dB |
Mixing Process
Section titled “Mixing Process”To measure at frequency f_target:
- Generate fundamental at
f_fund = f_target / harmonic_number - The DUT sees the harmonic component at
f_target - The LO also generates harmonics at
f_target + IF_offset - Mixing produces the same IF frequency as direct mode
flowchart LR
subgraph RF Path
SI[Si5351<br/>100 MHz] --> |3rd harmonic| DUT[DUT<br/>300 MHz]
end
subgraph LO Path
LO[Si5351<br/>100 MHz + IF/3] --> |3rd harmonic| MIX[Mixer]
end
DUT --> MIX
MIX --> IF[IF Output<br/>12 kHz] Harmonic Level Detection
Section titled “Harmonic Level Detection”The firmware determines which harmonic to use based on the target frequency:
uint32_t si5351_get_harmonic_lvl(uint32_t freq) { if (freq < FREQUENCY_THRESHOLD) return 1; // Direct mode
// Find lowest odd harmonic that puts fundamental in range uint32_t harmonic = 3; while (freq / harmonic > (FREQUENCY_THRESHOLD - 10000000)) harmonic += 2; // Only odd harmonics
return harmonic;}Harmonic Selection Table
Section titled “Harmonic Selection Table”| Target Frequency | Harmonic | Fundamental Frequency |
|---|---|---|
| 50 - 290 MHz | 1st (direct) | 50 - 290 MHz |
| 290 - 870 MHz | 3rd | 97 - 290 MHz |
| 870 - 1450 MHz | 5th | 174 - 290 MHz |
| 1450 - 2000 MHz | 7th | 207 - 286 MHz |
Impact on Dynamic Range
Section titled “Impact on Dynamic Range”Harmonic mixing reduces dynamic range because:
- Lower harmonic power: 3rd harmonic is 9.5 dB down
- Double the loss: Both RF and LO are reduced
- Total penalty: Approximately 19 dB for 3rd harmonic
Dynamic Range (harmonic) = Dynamic Range (direct) - 20*log10(1/N)Where N is the harmonic number.
| Mode | Harmonic | Typical Dynamic Range |
|---|---|---|
| Direct | 1st | > 70 dB |
| 3rd harmonic | 3rd | ~ 50-55 dB |
| 5th harmonic | 5th | ~ 40-45 dB |
| 7th harmonic | 7th | ~ 35-40 dB |
Frequency Offset Adjustment
Section titled “Frequency Offset Adjustment”In harmonic mode, the IF offset must be divided by the harmonic number to maintain the correct final IF:
// When generating LO for harmonic modeuint32_t lo_offset = FREQUENCY_OFFSET / harmonic;
// LO fundamental = target/harmonic + IF_offset/harmonic// LO at harmonic = target + IF_offset (same as direct mode)Calibration at Harmonic Boundaries
Section titled “Calibration at Harmonic Boundaries”The transition between direct and harmonic modes creates a discontinuity in the error terms. The calibration interpolation routine handles this specially:
// From main.c cal_interpolate()uint32_t hf0 = si5351_get_harmonic_lvl(src_f0);if (hf0 != si5351_get_harmonic_lvl(src_f1)) { // Points span a harmonic boundary // Cannot interpolate across - must extrapolate within same mode if (hf0 == si5351_get_harmonic_lvl(f)) { // Use points from current harmonic region // ... extrapolation code }}Spurious Responses
Section titled “Spurious Responses”Harmonic mixing can create spurious responses (spurs) from:
- Unwanted harmonic combinations: RF 3rd mixing with LO 5th
- Image frequencies: (LO - RF) as well as (LO + RF) products
- Intermodulation: From non-linearities in mixers
Spur Frequencies
Section titled “Spur Frequencies”Common spur patterns near 290 MHz boundary:
| Spur Type | Frequency | Mitigation |
|---|---|---|
| 3rd-5th mixing | Various | Filtering |
| LO leakthrough | At LO freq | Isolation |
| Half-IF | At IF/2 offset | Careful cal |
The firmware includes some spur mitigation:
// Avoid exact harmonic boundary#define FREQUENCY_THRESHOLD 290000110U // Not exactly 290 MHzThe odd offset (110 Hz) prevents the fundamental and harmonic frequencies from landing on exact multiples that might produce coherent spurs.
Practical Implications
Section titled “Practical Implications”What Works Well
Section titled “What Works Well”- Antenna SWR at UHF: Return loss up to ~30 dB measurable
- Filter passbands: Good for tuning UHF filters
- Relative measurements: Comparing similar DUTs
What Is Challenging
Section titled “What Is Challenging”- Filter stopband: May not see > 40 dB rejection
- High-isolation measurements: Limited by harmonic mode range
- Phase accuracy at UHF: Increased phase noise
Hardware Variations
Section titled “Hardware Variations”Different mixer chips affect harmonic performance:
| Chip | Frequency Coverage | Notes |
|---|---|---|
| SA612A (NXP) | Up to ~290 MHz direct | Original chip, discontinued |
| NE602A (ZeeTK) | Up to ~300 MHz direct | Drop-in replacement |
| Both | To 1.5+ GHz harmonics | With reduced dynamic range |
#ifdef __ZEETK__#define FREQUENCY_THRESHOLD 300000110U // ZeeTK allows higher#else#define FREQUENCY_THRESHOLD 290000110U // SA612A more conservative#endifSummary
Section titled “Summary”| Parameter | Direct Mode | 3rd Harmonic | 5th Harmonic |
|---|---|---|---|
| Frequency | 0-290 MHz | 290-870 MHz | 870-1450 MHz |
| Dynamic Range | > 70 dB | ~50 dB | ~40 dB |
| Phase Noise | Lowest | Moderate | Higher |
| Calibration | Normal | Discontinuity | Discontinuity |
Next Steps
Section titled “Next Steps”Learn how the firmware manages real-time tasks in Threading Model.