acoustic-safety-events
:::warning [UNTESTED] — v0.9 paper-correct
The acoustic_event DSP core is host-unit-tested on native_sim/native/64; the full app runs end-to-end on native_sim with synthetic audio cycling the four event types. No model ships (stub + deterministic fallback). HiL with a real mic + a trained model is bench-gated.
:::
An always-listening safety/security node: a PDM MEMS mic captures audible-band sound, per-frame DSP extracts features, and a small NPU model classifies the sound event — AMBIENT, GLASS_BREAK, ALARM (smoke/CO beep), or SCREAM.
Source: examples/audio/acoustic-safety-events/.
Honest scope
Detects loud, acoustically-distinct events. Not a certified security / life-safety sensor. Real-world confounders (music, TV, clattering dishes, door slams) cause false positives; robust deployment needs a model trained on real data — the deterministic fallback is coarse threshold rules.
Discriminators: GLASS_BREAK = broadband impulsive HF burst (high crest + centroid + ZCR); ALARM = narrowband ~3 kHz tonal beep (very low spectral flatness); SCREAM = voiced harmonic, high energy 1–4 kHz; AMBIENT = low RMS baseline.
Pipeline
PDM mic (<alp/audio.h>, 16 kHz) --frame--> acoustic_event
(8 FFT band energies, spectral centroid/flatness/rolloff, crest, ZCR, RMS)
-> <alp/inference.h> 4-class classifier (deterministic fallback)
-> ASE record per frame
board.yaml
som:
sku: E1M-AEN701
preset: e1m-evk
cores:
a32_cluster:
os: "off"
m55_he:
app: ./src
libraries:
- tflite_micro
inference:
default_arena_kib: 64
diagnostics:
log_level: info
PDM mic input is the Zephyr DMIC audio subsystem (via CONFIG_AUDIO_DMIC=y), not a peripheral enum — same convention as audio-wake-word. Flip som.sku to E1M-V2M101 for the DEEPX DX-M1 path.
Expected output
# ASE,t_s,event,confidence,centroid_hz,rms
ASE,0.00,AMBIENT,0.80,1111.0,0.00
ASE,0.03,GLASS_BREAK,0.85,5762.0,0.16
ASE,0.06,ALARM,0.90,3000.0,0.21
ASE,0.10,SCREAM,0.75,1684.0,0.22
See also
<alp/audio.h>·<alp/inference.h>audio-wake-word— always-on KWS on the same low-power AI subsystem- Examples overview