Hacker News new | ask | show | jobs
by xchip 806 days ago
you dont need a FFT you can use a Goertzel band pass filter
2 comments

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

Thanks for this, I'll toy with implementing that instead of a full FFT
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.