问题
I have a two column array of data. First column is time (date in decimal years) and second column is the signal strength. The plot is a triangle wave or should be ideally because the sampling is irregularly timed. I've tried numerous methods to get the period of the wave, including fitting a sine wave to the data via lsqcurvefit, but it doesn't always return the right period. Using OCTAVE how do I get the period (my main aim) of this/any irregularly-spaced time series?See plot
回答1:
Found answer to my own question. The lomb custom function (here) is one of several at matlab central, but this one works without problems in OCTAVE.
[P,f,alpha] = lomb(M,date);
[maxpower,maxpowerindex] = max(P);
rightfreq = f(maxpowerindex);
Period = 1/rightfreq
来源:https://stackoverflow.com/questions/42846316/getting-the-period-from-irregularly-spaced-time-series-using-octave