viewof txPower = Inputs.range([10, 30], {value: 20, step: 1, label: "TX Power (dBm)"})
viewof distance = Inputs.range([5, 100], {value: 25, step: 5, label: "Distance to AP (m)"})
viewof numWalls = Inputs.range([0, 6], {value: 2, step: 1, label: "Drywall Partitions"})
viewof interferencePenalty = Inputs.range([0, 20], {value: 10, step: 1, label: "Assumed interference/fade penalty (dB)"})Wi-Fi Link Budget Calculator
Wi-Fi Link Budget Calculator
animation
wifi
networking
Try Change Distance to AP (m) and Drywall Partitions, then press Calculate.
Observe Watch Worst-case SNR and Recommended MCS (with 5 dB margin).
Explain Explain why the recommendation keeps a 5 dB margin.
Technical boundaries. The model uses free-space path loss at 2.4 GHz, 4 dB per drywall, and a −95 dBm noise floor. Interference/fade is an assumed slider value; a network count alone cannot determine interference in dB.
NoteTry It: Wi-Fi Link Budget Calculator
Adjust the parameters below to see how SNR and modulation scheme selection change for different deployment scenarios.
{
// Path loss model: FSPL(dB) = 32.45 + 20*log10(d_m) + 20*log10(f_GHz); at 2.4 GHz this is ≈ 40 + 20*log10(d_m)
const freqGHz = 2.4;
const pathLoss = 32.45 + 20 * Math.log10(distance) + 20 * Math.log10(freqGHz);
const wallLoss = numWalls * 4; // ~4 dB per drywall
const totalLoss = pathLoss + wallLoss;
const noiseFloor = -95;
const rss = txPower - totalLoss;
const snr = rss - noiseFloor;
// A network count alone cannot determine interference in dB.
const ifPenalty = interferencePenalty;
const worstSnr = snr - ifPenalty;
// MCS selection
const mcsTable = [
{ name: "802.11ac 256-QAM 5/6", minSNR: 32, rate: "433 Mbps (802.11ac, 1 stream, 80 MHz, short GI)" },
{ name: "802.11n MCS 6 (64-QAM 3/4)", minSNR: 25, rate: "58.5 Mbps (20 MHz, long GI)" },
{ name: "802.11n MCS 3 (16-QAM 1/2)", minSNR: 12, rate: "26 Mbps (20 MHz, long GI)" },
{ name: "802.11g QPSK 1/2", minSNR: 7, rate: "12 Mbps" },
{ name: "802.11g BPSK 1/2", minSNR: 4, rate: "6 Mbps" },
];
// Recommended: highest scheme where worst-case SNR exceeds minSNR + 5 dB margin
const recommended = mcsTable.find(m => worstSnr >= m.minSNR + 5) || { name: "Link unusable", rate: "N/A" };
const theoretical = mcsTable.find(m => snr >= m.minSNR) || { name: "No signal", rate: "N/A" };
const snrColor = worstSnr >= 30 ? "#16A085" : worstSnr >= 15 ? "#E67E22" : "#E74C3C";
const rssOk = rss > -80;
return html`<div style="font-family: Arial, sans-serif; background: #f8f9fa; border-radius: 6px; padding: 16px; max-width: 600px;">
<table style="width:100%; border-collapse: collapse; font-size: 0.9em;">
<tr style="background:#2C3E50; color:white;">
<th style="padding:6px 10px; text-align:left;">Parameter</th>
<th style="padding:6px 10px; text-align:right;">Value</th>
</tr>
<tr style="background:#ecf0f1;">
<td style="padding:5px 10px;">Path loss (free-space + walls)</td>
<td style="padding:5px 10px; text-align:right;">${totalLoss.toFixed(1)} dB</td>
</tr>
<tr>
<td style="padding:5px 10px;">Received signal strength (RSS)</td>
<td style="padding:5px 10px; text-align:right; color:${rssOk ? "#16A085" : "#E74C3C"};">${rss.toFixed(1)} dBm</td>
</tr>
<tr style="background:#ecf0f1;">
<td style="padding:5px 10px;">SNR (no interference)</td>
<td style="padding:5px 10px; text-align:right;">${snr.toFixed(1)} dB</td>
</tr>
<tr>
<td style="padding:5px 10px;">Assumed interference/fade penalty</td>
<td style="padding:5px 10px; text-align:right;">−${ifPenalty.toFixed(1)} dB</td>
</tr>
<tr style="background:#ecf0f1;">
<td style="padding:5px 10px;"><strong>Worst-case SNR</strong></td>
<td style="padding:5px 10px; text-align:right; font-weight:bold; color:${snrColor};">${worstSnr.toFixed(1)} dB</td>
</tr>
<tr style="background:#d5f0eb;">
<td style="padding:5px 10px;"><strong>Recommended MCS (with 5 dB margin)</strong></td>
<td style="padding:5px 10px; text-align:right; font-weight:bold; color:#16A085;">${recommended.name} — ${recommended.rate}</td>
</tr>
<tr>
<td style="padding:5px 10px;">Theoretical max (no margin)</td>
<td style="padding:5px 10px; text-align:right; color:#7F8C8D;">${theoretical.name} — ${theoretical.rate}</td>
</tr>
</table>
<p style="margin-top:10px; font-size:1rem; line-height:1.5; color:#52606D;">Path loss model: 32.45 + 20·log₁₀(d m) + 20·log₁₀(2.4 GHz) ≈ 40 + 20·log₁₀(d). Wall loss: 4 dB/drywall. Noise floor: −95 dBm. Interference/fade: slider value (assumed). Recommendation keeps a 5 dB margin.</p>
</div>`;
}