Thanks for your answer
This is for impedance measurement, first I will test at 1 kHz, so the signal is quite stable and has low phase noise.
If it works I plan to use 2 VCOs (1-10MHz), one feeding the impedance tested through a current probe. The second VCO - feeding a mixer, will downconvert the voltage and current proportional signals to 1 kHz. Those VCOs will have higher phase noise, but will be controlled by PLL to be at 1kHz difference in frequency. A fast response is preferred.
For sine fitting do you know of a C code freely available, or some examples? I could try to do a gradient least squares optimization, but I don't know if it's good enough and efficient.
Also I couldn't find some theory regarding the number of samples to be processed.