Thanks a lot to whoever downvoted my question for no good reason.
You can find the code here: http://github.com/ravenstine/goertzeljs
The demo is below, and you can try it out if you have a web browser that supports WebRTC(newer versions of Chrome and Firefox do).
I have an issue where I need help:
- I need a way to effectively filter out background noise.
There wasn't much information that I could find on the subject that didn't already assume that I knew a lot about DSP. I heard about using a window function and while I could find some algorithms, implementing them didn't seem to make any significant difference(Goertzel.js uses Exact Blackman).
As a result, I came up with my own filter where if an energy peak is not distinct enough from the energies of other frequencies, the information from that sample isn't used. This was actually tremendously effective when using a buffer size of 2048.
However, I want my DTMF detector to be as close to meeting ITU specifications as possible; the minimum duration of a DTMF tone to be detected is specified by ITU as 40ms, but my detector doesn't consistently detect tones unless they are around 110ms.
To deal with this, I want to make the buffer size even smaller, but if I do this then my method of removing noise becomes unmanageable(meaning it seems to either discriminate too-little or too-much).
At the moment, my detector works pretty well but background noise occasionally creates erroneous detections.
What are some other methods that I can implement to filter out noise with my DTMF detector? Also, am I correctly employing the window function?