S-Parameters
S-parameters (scattering parameters) are the standard way to describe how RF devices behave. They tell you what happens to signals when they “scatter” off your antenna, pass through a filter, or interact with any RF component. The NanoVNA-H measures S11 (reflection) and S21 (transmission).
The Two-Port Model
Section titled “The Two-Port Model”Think of your device under test as a “black box” with two ports:
flowchart LR
subgraph DUT[Device Under Test]
direction LR
P1((Port 1)) --- Box[Black Box] --- P2((Port 2))
end
A[Signal In<br/>a1] --> P1
P1 --> B[Reflected<br/>b1]
P2 --> C[Transmitted<br/>b2] - a1: Signal going INTO Port 1 (from the NanoVNA)
- b1: Signal coming OUT of Port 1 (reflected back)
- b2: Signal coming OUT of Port 2 (transmitted through)
S-parameters are simply ratios of these waves:
| Parameter | Definition | What It Tells You |
|---|---|---|
| S11 | b1 / a1 | Reflection coefficient at Port 1 |
| S21 | b2 / a1 | Transmission from Port 1 to Port 2 |
S11: Reflection Coefficient
Section titled “S11: Reflection Coefficient”S11 measures how much signal bounces back when it hits your device. It is a complex number with magnitude and phase:
S11 = |S11| * e^(j*phase)The NanoVNA displays this in several useful formats:
Return Loss (dB)
Section titled “Return Loss (dB)”Return loss converts the reflection magnitude to decibels:
Return Loss = -20 * log10(|S11|) dB| Return Loss | |S11| | Power Reflected | Interpretation | |-------------|-------|-----------------|----------------| | 0 dB | 1.00 | 100% | Total reflection (open or short) | | 6 dB | 0.50 | 25% | Poor match | | 10 dB | 0.32 | 10% | Acceptable for many uses | | 14 dB | 0.20 | 4% | Good match | | 20 dB | 0.10 | 1% | Excellent match | | 30 dB | 0.03 | 0.1% | Near perfect |
SWR (Standing Wave Ratio)
Section titled “SWR (Standing Wave Ratio)”SWR is the classic ham radio metric, derived from S11 magnitude:
SWR = (1 + |S11|) / (1 - |S11|)The firmware calculates this in plot.c:
static float swr(int i, const float *v) { float x = linear(i, v); // |S11| = sqrt(re^2 + im^2) if (x > 0.99f) return infinityf(); return (1 + x)/(1 - x);}| SWR | Return Loss | |S11| | Power Reflected | |-----|-------------|-------|-----------------| | 1.0:1 | infinity | 0.00 | 0% | | 1.5:1 | 14 dB | 0.20 | 4% | | 2.0:1 | 10 dB | 0.33 | 11% | | 3.0:1 | 6 dB | 0.50 | 25% | | infinity | 0 dB | 1.00 | 100% |
S11 phase tells you whether the impedance is inductive or capacitive:
static float phase(int i, const float *v) { return (180.0f / VNA_PI) * vna_atan2f(v[1], v[0]);}- Positive phase (0 to +180): Inductive reactance (antenna too long, add capacitance)
- Negative phase (0 to -180): Capacitive reactance (antenna too short, add inductance)
- Zero phase: Purely resistive (resonance point)
S21: Transmission Coefficient
Section titled “S21: Transmission Coefficient”S21 measures how much signal passes from Port 1 to Port 2. For passive devices, |S21| is always less than or equal to 1 (signal cannot magically increase).
Insertion Loss (dB)
Section titled “Insertion Loss (dB)”For filters and cables, we express S21 as insertion loss:
Insertion Loss = -20 * log10(|S21|) dB| Insertion Loss | |S21| | Power Transmitted | Typical Device | |----------------|-------|-------------------|----------------| | 0 dB | 1.00 | 100% | Perfect thru | | 0.5 dB | 0.94 | 89% | Good filter passband | | 3 dB | 0.71 | 50% | 3 dB attenuator, filter cutoff | | 6 dB | 0.50 | 25% | 6 dB attenuator | | 20 dB | 0.10 | 1% | Filter stopband | | 40 dB | 0.01 | 0.01% | Good filter rejection |
Gain (for Active Devices)
Section titled “Gain (for Active Devices)”If |S21| > 1, we have gain (amplifiers):
Gain = 20 * log10(|S21|) dBFrom S11 to Impedance
Section titled “From S11 to Impedance”The magic of a VNA is converting S11 (which the hardware measures) to impedance (which you actually want to know). The relationship is:
Z = Z0 * (1 + S11) / (1 - S11)Where Z0 is the reference impedance (50 ohms). In the firmware (plot.c):
// Resistance: Real part of impedancestatic float resistance(int i, const float *v) { return get_s11_r(1.0f - v[0], -v[1], PORT_Z);}
// Reactance: Imaginary part of impedancestatic float reactance(int i, const float *v) { return get_s11_x(1.0f - v[0], -v[1], PORT_Z);}
// Impedance magnitudestatic float mod_z(int i, const float *v) { const float z0 = PORT_Z; return z0 * vna_sqrtf(get_l(1.0f + v[0], v[1]) / get_l(1.0f - v[0], v[1]));}Understanding the Traces
Section titled “Understanding the Traces”The NanoVNA-H supports many trace types, all derived from S11 and S21:
| Trace Type | What It Shows | Use Case |
|---|---|---|
| LOGMAG | Return loss in dB | Quick SWR check |
| PHASE | S11 phase angle | Inductive vs capacitive |
| SWR | Standing wave ratio | Classic ham metric |
| SMITH | Impedance on Smith chart | Matching network design |
| R | Resistance (ohms) | Antenna resistance |
| X | Reactance (ohms) | Antenna reactance |
| Z | ||
| Q | Quality factor | Component quality |
| Trace Type | What It Shows | Use Case |
|---|---|---|
| LOGMAG | Insertion loss in dB | Filter response |
| PHASE | S21 phase angle | Phase shift through device |
| DELAY | Group delay | Signal delay vs frequency |
| LINEAR | S21 |
Group Delay
Section titled “Group Delay”Group delay measures how long signals take to pass through your device, and whether different frequencies are delayed differently:
Group Delay = -d(phase) / d(frequency)The firmware calculates this by comparing phase at adjacent frequency points:
float groupdelay_from_array(int i, const float *v) { int bottom = (i == 0) ? 0 : -1; int top = (i == sweep_points-1) ? 0 : 1; freq_t deltaf = get_sweep_frequency(ST_SPAN) / ((sweep_points - 1) / (top - bottom)); return groupdelay(&v[2*bottom], &v[2*top], deltaf);}Practical Examples
Section titled “Practical Examples”Example 1: Dipole Antenna
Section titled “Example 1: Dipole Antenna”You measure a 40m dipole at 7.15 MHz:
- S11 magnitude: 0.33 (-9.6 dB return loss)
- S11 phase: +45 degrees
- Calculated: SWR = 2.0:1, Z = 35 + j35 ohms
Interpretation: The antenna is slightly short (positive reactance = inductive), and the resistance is lower than 50 ohms. Lengthen the antenna slightly to reduce reactance, or use a matching network.
Example 2: Bandpass Filter
Section titled “Example 2: Bandpass Filter”You measure a 2m bandpass filter:
- At 145 MHz: S21 = -0.5 dB (good passband)
- At 144 MHz: S21 = -1.0 dB (band edge)
- At 130 MHz: S21 = -35 dB (good rejection)
Interpretation: The filter passes the 2m band with minimal loss and provides 35 dB of rejection for out-of-band signals.
Summary
Section titled “Summary”| Term | Formula | Range | Good Values |
|---|---|---|---|
| Return Loss | -20*log( | S11 | ) |
| SWR | (1+ | S11 | )/(1- |
| Insertion Loss | -20*log( | S21 | ) |
| Impedance | Z0*(1+S11)/(1-S11) | Complex ohms | 50+j0 ohms |
Next Steps
Section titled “Next Steps”Now that you understand S-parameters, learn to visualize them on the Smith Chart---the most powerful tool for impedance matching.