Interactive Calculator: Sensor Fusion
Try Change Sensor 1 uncertainty sigma1 (m).
Observe Watch Fused Estimate and Fused Uncertainty after Calculate.
Explain Explain why the fused result is weighted toward Sensor 2 when it is more precise.
Technical boundaries. The formulas combine two measurements using their squared uncertainties. Fused Uncertainty uses only those two uncertainties.
viewof sensor1_value = Inputs.range([0, 200], {value: 100, step: 0.1, label: "Sensor 1 measurement (m)"})
viewof sensor1_sigma = Inputs.range([0.1, 20], {value: 10, step: 0.1, label: "Sensor 1 uncertainty sigma1 (m)"})
viewof sensor2_value = Inputs.range([0, 200], {value: 95, step: 0.1, label: "Sensor 2 measurement (m)"})
viewof sensor2_sigma = Inputs.range([0.1, 20], {value: 5, step: 0.1, label: "Sensor 2 uncertainty sigma2 (m)"})
fused_value = (sensor1_sigma * sensor1_sigma * sensor2_value + sensor2_sigma * sensor2_sigma * sensor1_value) / (sensor1_sigma * sensor1_sigma + sensor2_sigma * sensor2_sigma)
fused_sigma = Math.sqrt((sensor1_sigma * sensor1_sigma * sensor2_sigma * sensor2_sigma) / (sensor1_sigma * sensor1_sigma + sensor2_sigma * sensor2_sigma))
precision_ratio = sensor1_sigma / sensor2_sigma
html`<div style="background: var(--bs-light, #f8f9fa); padding: 1rem; border-radius: 8px; border-left: 4px solid #9B59B6; margin-top: 0.5rem;">
<p><strong>Fused Estimate:</strong> ${fused_value.toFixed(2)} m</p>
<p><strong>Fused Uncertainty:</strong> sigma = ${fused_sigma.toFixed(2)} m (better than either sensor!)</p>
<p style="margin-top: 0.5rem; font-size: 0.9em; font-style: italic;">
${precision_ratio > 2 ? `Sensor 2 is ${precision_ratio.toFixed(1)}x more precise - fused result heavily weighted toward it` : precision_ratio < 0.5 ? `Sensor 1 is ${(1/precision_ratio).toFixed(1)}x more precise - fused result heavily weighted toward it` : "Sensors have similar precision - balanced weighting"}
</p>
</div>`
Back to the chapter