EMA Smoothing Speed and a Beacon-Battery Flag

Ada re-derives this chapter’s own numbers step by step, at full precision

foundations
math-foundations
calculation-audit
bluetooth-ble
Ada ADA · CALCULATION AUDIT

EMA Smoothing Speed and a Beacon-Battery Flag

A retail-analytics beacon with a 1000 mAh battery advertising at 1 Hz draws 8 mA for 3 ms across its 86,400 daily events, which works out to 0.576 mAh/day and about 1,736 days of life from advertising alone. Raise the rate 10× to 10 Hz and that collapses to roughly 174 days. This audit re-derives the cascade — and the EMA settling times behind it — and asks whether it is the advertising rate, not the 8 mA peak, that turns a years-scale maintenance interval into a months-scale one.

Companion to the chapter BLE in Python with Bleak — every number here comes from that chapter.

Ada: This chapter makes two kinds of numeric claim: how fast the EMA filter reacts, and how long a beacon battery lasts. Both check out, and the battery cascade deserves a careful re-derivation because its units are easy to slip on.

The EMA effective window and 95% response time, sampling at 1 Hz:

  • alpha = 0.3: window 2 / 0.3 - 1 = 6.6667 - 1 = 5.6667, about 6 samples; response -ln(0.05) / (0.3 x 1) = 2.9957 / 0.3 = 9.986 s, about 10 s.
  • alpha = 0.1: window 2 / 0.1 - 1 = 19 samples; response 2.9957 / 0.1 = 29.96 s, about 30 s.

Both match the chapter and confirm the tradeoff: dropping alpha from 0.3 to 0.1 roughly triples both the averaging window and the settling time.

The beacon-battery cascade is where units demand care: mA x seconds is a charge in mA-seconds, and converting to mAh divides by 3,600 – not by 1,000, which is the classic slip. Re-deriving: 8 x 0.003 x 86,400 = 2,073.6 mA-s = 2,073.6 / 3,600 = 0.576 mAh/day, so advertising alone allows 1,000 mAh / 0.576 = 1,736 days at 1 Hz, and one tenth of that, 173.6 days, at 10 Hz. The design meaning: at a 0.2% duty cycle the radio burst is barely the story – it is the 10x advertising rate, not the 8 mA peak, that moves a beacon from a years-scale to a months-scale maintenance interval.

Every number above is taken from the chapter’s own material and re-derived step by step.