I am taking samples at 30Hz of a signal which is a slowly-varying sinewave.
The period of the sinewave is expected to drift slowly, but will always be somewhere between 0.5s and 2s.
I would like calculate a estimate of the period/frequency of the sinewave, from just the last 1s of data (i.e. the last 30 samples).
I've tried Discrete Fourier Transform, but from what I can tell it doesn't behave well when you have less than a whole cycle sampled.
A naive approach is just to measure the time since the amplitude was roughly where it is at the current sample (two times ago), but that will get fiddly if I happen to be exactly at a maxima with the current sample.
Are there any other approaches I should be trying?
The fitting to experimental data of the function : $$y(x)=a+b\cos(\omega x)+c \sin(\omega x)$$ or $$y(x)=a+\rho\sin(\omega x+\varphi)$$ can be carried out thanks to the a method based on integral equation : https://fr.scribd.com/doc/14674814/Regressions-et-equations-integrales
(in French, presently no translation available) Nevertheless, the synopsis of equations is legible pages 35-36.
The method is convenient especially for data covering only a small part of period.
Also, a specific part of the paper deals with damped sinusoidal regression : $$y(x)=\rho\sin(\omega x+\varphi)e^{\alpha x}$$ in English, pages 64-67.
A numerical example is included in the referenced paper :
The data is :
-1.983 , 0.936
-1.948 , 0.81
-1.837 , 0.716
-1.827 , 0.906
-1.663 , 0.247
-0.815 , -1.513
-0.778 , -1.901
-0.754 , -1.565
-0.518 , -1.896
0.322 , 0.051
0.418 , 0.021
0.781 , 1.069
0.931 , 0.862
1.51 , 0.183
1.607 , 0.311
Equations (12), (13) yield $S_k$ and $SS_k$ :
Equations (15), (16) yield $\omega_1, a_1, b_1, c_1$ :
Then, equations (18), (19) , (20) yield $\rho_1 , \phi_1 , \Phi_k , K_k , \theta_k$ :
Equations (21), (22) yield $\omega_2 , \phi_2$ , with $a_2=a_1$ and $b_2=\rho_2\cos(\phi_2) \: ; \: c_2=\rho_2\sin(\phi_2)$ :
Finally, with $\omega_3=\omega_2$ , equation (23) yields $a_3 , b_3 , c_3$ which are approximates of $\omega , a , b , c$ :