Skip to content

Per-sensor detection gates

Every continuous sensor runs the same six-gate pipeline (ImpactDetector): warmup, spike threshold, rise rate, crest factor, confirmation count, intensity remap. Each gate kills a specific class of false positive that the gate before it cannot. Walking the gates in order is walking the design conversation about what counts as an impact.

Every impact sensor runs an ImpactDetector independently. Each sample passes through six gates in order. All six must pass to produce an intensity value. Any gate failure returns nil for that sample. no event emitted, no noise downstream.

      ImpactDetector.process() -- per-sample gate chain

The combination of these gates is what makes Yamete usable at a desk. Typing produces magnitude but no sharp rise. Footsteps produce a rise but the crest factor is too low (ambient RMS is already elevated). A real smack produces all six: a clean spike, a fast transient, a high crest, and multiple samples above threshold in the window.

GateWhat it rejectsAccel defaultMic defaultHeadphone default
warmupSamplesFilter transients on startup (IIR settling)50 samples50 samples50 samples
spikeThresholdAmbient vibration, background noise0.020 g0.020 PCM0.10 g
minRiseRateSlow drifts, HVAC, sustained rumble0.0100.0100.05
minCrestFactorNoisy rooms, street noise (peak/RMS too low)1.51.51.5
minConfirmationsOne-sample spikes, electrical interference3 samples2 samples2 samples
intensity mapping(output stage) maps passing magnitude to 0-10.002-0.060 g0.005-0.3000.05-2.0 g

Engineered with excessive care for a deeply unnecessary purpose.