# Demo — Free-Space Path Loss Calculator

Free-space path loss is the first thing that happens to a radar signal: it spreads and weakens with both range and frequency. This demo makes the 6 dB rules tactile — slide range or frequency, watch the loss climb, and see the band structure of the spectrum laid out.

## The relationship

With range in km and frequency in GHz,

$$
L_\text{fs,dB} = 20\log_{10}(R_\text{km}) + 20\log_{10}(f_\text{GHz}) + 92.45.
$$

Because both terms are $20\log_{10}(\cdot)$ and $20\log_{10}(2)\approx 6$ dB, **doubling either range or frequency adds 6 dB**.

## Interactive demo

<a class="demo-fullscreen" href="../_static/demos/FSPLCalculator.html" target="_blank" rel="noopener">Open in full screen</a>

<div class="demo-wrap">
<iframe src="../_static/demos/FSPLCalculator.html"
        title="Interactive Free-Space Path Loss calculator"
        width="100%"
        loading="lazy">
</iframe>
</div>

## Walkthrough

1. **Set frequency to 10 GHz (X-band) and range to 50 km.** Read the FSPL — about 146 dB — and the wavelength readout (~3 cm).
2. **Double the range to 100 km.** Watch the loss climb by exactly 6 dB. Double again to 200 km for another 6 dB.
3. **Reset range, then double the frequency from 10 to 20 GHz.** The loss again climbs 6 dB — frequency and range behave identically in the formula.
4. **Click the band chips (L, S, C, X, Ku, K, Ka).** Frequency snaps to each band center. Notice how much more loss the high bands carry at the same range.
5. **Watch the Plotly curves.** Each band is an FSPL-vs-range line; the vertical cursor follows your range slider so you can read all bands at once.
6. **Find a 6 dB step yourself.** Move the range cursor between any value and its double; confirm the footer's "+6 dB" indicator lights up.

## Key observations

- **Loss grows with both range and frequency**, and identically in dB — that symmetry is the whole point of the 6 dB rules.
- **High bands pay a propagation tax.** Ku/Ka give resolution and small antennas but start from a higher loss floor, which is why long-range search radars sit at L/S band.
- **This is one-way loss.** The radar round trip doubles the dB and feeds the $1/R^4$ of the next lesson's range equation.

## Source

<a class="matlab-link" href="../_static/downloads/ECE%20495%20EW%20%E2%80%93%20Code.zip#code/L2_FreeSpacePathLoss.m" download><svg viewBox="0 0 22 22" width="14" height="14" aria-hidden="true" style="vertical-align:-2px;margin-right:6px;"><rect width="22" height="22" rx="3" fill="#e87722"/><text x="11" y="15.5" text-anchor="middle" font-family="'Inter',sans-serif" font-size="9" font-weight="800" fill="#fff" letter-spacing="-0.04em">MAT</text></svg><span class="ml-text">MATLAB · code/L2_FreeSpacePathLoss.m</span><span class="ml-arrow">↓</span></a>

The in-class script plots FSPL versus range for the L, S, C, and X bands and verifies the 6 dB rules numerically.
