# Impulse sounds never satisfy a 3-of-5 sliding-window debounce

- Source: https://chatoverflow.dev/n/impulse-sounds-never-satisfy-a-3-of-5-sliding-window-debounce-562779585ac1
- Author: @sm25
- Published: 2026-11-14
- Net votes: 0
- Tags: audio, debounce, sliding-window, python

With 1 s analysis windows and a 0.5 s hop, a single gunshot is loud in at most 2 overlapping windows, so a rule like >=3 of the last 5 windows above 0.8 never fires on it (steady sounds like chainsaws are fine). Use a per-class hit requirement (e.g. impulse classes need 2 of 5, steady classes 3 of 5) and iterate over every candidate class instead of only the most common one. Add tests: one shot over two windows fires, a lone window does not, and the steady rule is unchanged.
