The research that I have performed Goertzel is not applicable (need ability to see at least 200 different frequencie). FFT application (spectrum analyzer) is what I thought was possible. Why is FFT not optimal?
FFT is not optimal because it is too indirect to calculate 512 coefficients to get 256 amplitudes to search among them for peak then to find frequency that is between two most significant nearby "harmonics"... such waste of power.
FFT is just fast DFT. DFT is just a bunch of fixed width correlations between signal and set of orthogonal "templates" (sin and cos). You need something different.
What you need is to use apriori information about your signal to find the shortest path to desired parameter.
First point you have to know about - all three parameters of one sine wave (amplitude, phase and frequency) can be derived from only three samples. theoretically. without noise, etc.
There is the least complicated model of periodic signal with additive noise - autoregressive model.
For single sinusoid:
sᵢ = A sin(2πif/Fs+φ) , the model is:
sᵢ = Ksᵢ₋₁ − sᵢ₋₂ , where
K = 2cos(2πf/Fs).
For single sinusoid with noise:
xᵢ = sᵢ + noiseᵢ , the model looks:
xᵢ = Kxᵢ₋₁ − xᵢ₋₂ + nᵢ − Knᵢ₋₁ + nᵢ₋₂ . You can start from major simplification:
xᵢ + xᵢ₋₂ = Kxᵢ₋₁ + eᵢ , K = (xᵢ + xᵢ₋₂)∕xᵢ₋₁ + e'ᵢ . It's better to select set of samples with bigger |xᵢ₋₁| for better arithmetic accuracy of last equation solution.
As an option you can adapt sampling rate (just decimating ADC samples) after obtaining first estimation of K.
Then add some averaging or make iterative adaptation of estimated K or do more sophisticated
min(F(e')) or
min(F(e)) or even
min(F(noise)) optimization.
Comparing mean and deviation you can set detection threshold.
Develop algorithm in PC simulation environment (Matlab, Octave, FreeMat or Python or whatever) to estimate actual computational burden to select proper target devices (uC and ADC).
Here are some keywords for start:
ML (maximum likelihood), AR (Autoregressive frequency estimation), ARMA (Autoregressive Moving Average), MUSIC (MUltiple SIgnal Classification).
https://en.wikipedia.org/wiki/MUSIC_(algorithm)Most difficulties and complications of these methods relate to common case of this task - multiple harmonics and maximum achievable performance with presence of known noise.
Also knowing LMS is a good background to start understanding adaptive algorithms.
How fast do you need to detect it?
Every .05 sec.
With delay not greater than 30 ms? Or 30 periods of tone?
Tone detection 30 times/second
I meant that you can take into account a possible tradeoff - to use weak microcontroller (PIC18 for example) but get some delayed result due to calculation time with some unprocessed period of signal.
Another choice - select sliding window iterative sample by sample algorithm with updated result ready at each sample (or at last sample of block) or block pipelined processing (calculation upon previously recorded window while next window is sampling and get result after new window recording is finished - thus maximum 30ms delay of result from most recent sample of 30ms window)
Edit: use math symbols