Try It: Filter Threshold Simulator
Try Change Normal readings (%) from 97 to 80.
Observe Watch Alert readings/day, Filtered data/day, and Bandwidth reduction at 80% normal readings.
Explain Explain why 97% normal readings determines the bandwidth reduction.
Technical boundaries. Alert readings use the normal readings percentage, not the threshold value. Raw and filtered data use 8 bytes per reading.
viewof filterSampleRate = Inputs.range([1, 100], {value: 10, step: 1, label: "Sample rate (Hz)"})
viewof filterThreshold = Inputs.range([50, 95], {value: 80, step: 1, label: "Threshold (°C)"})
viewof filterNormalPct = Inputs.range([80, 99], {value: 97, step: 1, label: "Normal readings (%)"})
filterReadingsPerDay = filterSampleRate * 86400
filterAlertReadings = Math.round(filterReadingsPerDay * (1 - filterNormalPct / 100))
filterBytesRaw = filterReadingsPerDay * 8
filterBytesFiltered = filterAlertReadings * 8
filterReduction = ((filterBytesRaw - filterBytesFiltered) / filterBytesRaw) * 100
html`<div style="background: var(--bs-light, #f8f9fa); padding: 1rem; border-radius: 8px; border-left: 4px solid #E74C3C; margin-top: 0.5rem;">
<h4 style="color: #2C3E50; margin-top: 0;">Filter Pattern Results</h4>
<p><strong>Total readings/day:</strong> ${filterReadingsPerDay.toLocaleString()}</p>
<p><strong>Alert readings/day:</strong> ${filterAlertReadings.toLocaleString()} (above ${filterThreshold}°C)</p>
<p><strong>Raw data/day:</strong> ${(filterBytesRaw / 1024).toFixed(1)} KB</p>
<p><strong>Filtered data/day:</strong> ${(filterBytesFiltered / 1024).toFixed(1)} KB</p>
<p style="font-size: 1.1em;"><strong>Bandwidth reduction:</strong> <span style="color: #16A085; font-weight: bold;">${filterReduction.toFixed(2)}%</span></p>
<p style="color: #7F8C8D; font-size: 0.9em;">Only ${(100 - filterNormalPct).toFixed(0)}% of readings exceed the threshold and get transmitted.</p>
</div>`
Back to the chapter