# Goertzel algorithm: Relationship of magnitude

I've written a quick test app that uses the Goertzel algorithm to determine if a given frequency is present in the signal. This is to pick up DTMF tones and various other signals. The app appears to be working. I'm using the 'magnitude squared' approach in my final stage.

http://www.embedded.com/design/configurable-systems/4024443/The-Goertzel-Algorithm

Now, how does this magnitude relate to all the other variables (especially the amplitude of the source signal)? Most of the implementations determine the presence of a given frequency if the magnitude exceeds some threshold. I want to know how this threshold is determined, and how would I go about selecting a suitable threshold.

EDIT:

OK, I think I've found the answer (I hope). Most implementations of the algorithm state that is will return the 'relative power'. I couldn't find any that stated what it was relative to.

This morning, it dawned on me (pun intended) that it's probably relative to the input signal (duh!). So, if we calculated what the power of the input signal is over all the samples taken, and then compare this to the relative power given by the algorithm, we should have a good idea of the contribution of our target frequency?

Is my understanding correct?

• Have you ever found an answer to that question? I find that the average signal power tends to be quite low compared to the high magnitude squared responses of Goertzel (even if the actual frequency is +100 Hz off). Maybe the average signal power could be used to normalize the response somehow? – Good Night Nerd Pride Nov 16 '19 at 17:47
• Ok, I think I got it. Insteaid of using the average signal power, I'm calculating the total signal energy (basically just the sum of all squared signal values) and divide the Goertzel response by that. This makes the responses independent of the signal strength/volume and also helps to prevent the detection of false positives in noisy signals. – Good Night Nerd Pride Nov 17 '19 at 11:22