Resurrecting my earlier attempts using the Goertzel algorithm to detect some tones for drum hits, but seeing a lot of inconsistencies in the libraries and their performance. A few use much less dynamic memory but don't seem that reliable. Others that use more memory, don't seem to work as advertised, where, decreasing the value for N, which is supposed to widen the filter bandwidth, only changes the center frequency and doesn't seem to affect bandwidth at all.
Is there a reliable Goertzel library out there that doesn't use a lot of memory (30% for a single tone) and works as expected on a Nano? Tried FHT, but to get the desired frequency resolution requires too many bins and uses up all the memory.
If you read some litterature on this you'll see that such filtering process is vulnerable to numerical-error accumulation when computed using low-precision arithmetic and long input sequence. On a 8 bit microprocessor with 4 bytes double or float that might be part of the precision challenge you see especially at low frequency
Actually, since drums are tuned, there is a detectable frequency component or tone. A kick drum for instance has a decaying sinusoidal response, but being at 50-60 Hz, presents a challenge due to the long ~20msec period.
Probably need a faster processor with more memory, but already have a few Nanos and want to see if it can do the job. Not expecting precision, just predictability and repeatability.