News for hackers. Stuff that matters.
Re:Fire alarm audio detection, using FFTs and 184 lines of Go by xchip on Sunday April 07, 2024 @03:57PM (#39963352)
you dont need a FFT you can use a Goertzel band pass filter
Re:Fire alarm audio detection, using FFTs and 184 lines of Go by qwertox on Sunday April 07, 2024 @05:35PM (#39964162)
I was thinking the same.

From Wikipedia:

"The Goertzel algorithm is a technique in digital signal processing (DSP) for efficient evaluation of the individual terms of the discrete Fourier transform (DFT). It is useful in certain practical applications, such as recognition of dual-tone multi-frequency signaling (DTMF) tones produced by the push buttons of the keypad of a traditional analog telephone. The algorithm was first described by Gerald Goertzel in 1958." [0]

It's also a nice project for an ESP32 with a MEMS microphone.

[0] https://en.wikipedia.org/wiki/Goertzel_algorithm

Re:Fire alarm audio detection, using FFTs and 184 lines of Go by pdubouilh on Sunday April 07, 2024 @05:51PM (#39964286)
Thanks for this, I'll toy with implementing that instead of a full FFT
Re:Fire alarm audio detection, using FFTs and 184 lines of Go by Prcmaker on Sunday April 07, 2024 @09:15PM (#39965363)
100% great suggestion. I found this solution the hard way, by hand, on paper, a few weeks before learning this algorithm already existed. Reminded me that a large percentage of efficient engineering is just knowing what tools you have available off the shelf.

The algorithm I figured out was mostly equivalent, though about 3x slower than implementing Goertzel. In my use case, it was already a win hitting the product requirements, but implementing Goertzel allowed background functionality to operate better while capturing data.