I need an algorithm to detect frequency and phase of a pure sine signal. The frequency of the input signal changes between 0 and 100 Hz.
The value of the signal gets captured with a frequency of 20kHz (so I get 20.000 values per second) - this is given and cannot be changed. I need to detect frequency and phase of this input signal and using PWM generate MCU interrupts with the same frequency as the input signal.
Can anyone suggest what algorithm to use to do this simple and efficient? Maybe Goertzel algorithm?