I would like to find periodicity and the oscillation frequency in a signal. I used this simple MATLAB code which works find for some signals, but for a harmonic polluted signal like the one given below it generates wrong results. Is there any way to estimate the frequency of oscillation for a signal like the one given here. I appreciate any MATLAB code snippets.
I wonder if there is a simple way of using fft to estimate the fundamental oscillation frequency or using an FLL frequency estimator.
[pks,pktimes] = findpeaks(x, (1:N)*DT);
Period = mean(diff(pktimes))
