I have some input signal sampled at 1-10 MS/s. Let's assume that it contains one strong frequency component (with frequency anywhere in the range from 1 Hz to 1000 Hz or even higher, changing over time) plus a number of higher harmonics (with quite a bit lower amplitude than the main frequency) and some noise.
The frequency may rise from zero to 1 kHz in a few seconds. The idea is to calculate the result approximately every 10-20 periods of the signal.
I need an algorithm which is as fast as possible to calculate the precise main frequency in real time.
I'm currently testing a couple of methods (like this or this) which can already give a pretty accurate result (under 0.01% when there are not too many higher harmonics) if I know an approximate frequency upfront and feed the FFT with cca. 10 periods (if the signal is around 100 Hz, I would use 100 ms slices; in case of 1 Hz, I'm ok with a lower accuracy, so taking just 1 - 2 periods is fine in that case). All these algorithms use just two or three bins from the FFT (around the highest amplitude) to calculate the exact frequency.
The problem is that in order to cover a wide frequency range without any idea what the base frequency is, I would first need to calculate FFT a lot of times. For example, first calculate all chunks of 10 ms just in case there is some 1 kHz component present. If it's not, maybe switch to 20 ms, then 40 ms ... and so on until we find the first signal length which adequately covers cca. 10 periods of the signal. That might slow down the algorithm 10-fold compared to the situation when frequency is approximately known upfront.
My question is: is there any way to first calculate 10 ms FFTs for each chunk of the signal, and if the frequency turns out to be too low, somehow combine results from two neighbouring 10 ms + 10 ms FFTs with a method that would require less computation resources than calculating FFT of the full 20 ms from scratch (given that I probably only need one or two FFT bins for a 20 ms signal anyway, and in this case I should know which ones).
Or any other idea of the fastest way to determine an approximate frequency quickly? (Some even use zero-crossing to do that which works fine as long as you are looking at nearly perfect sine curve, but that's not useful when higher frequencies and noise are present.)