0

from matlab official site , Lomb-Scargle periodogram is defined as

http://www.mathworks.com/help/signal/ref/plomb.html#lomb

suppose we have some random signal let say

 x=rand(1,1000);

average of this signal can be easily implemented as

average=mean(x); variance can be implemented as

>> average_vector=repmat(average,1,1000);
>> diff=x-average_vector;
>> variance= sum(diff.*diff)/(length(x)-1);

how should i continue? i mean how to choose frequencies ? calculation of time offset is not problem,let us suppose that we have time vector

t=0:0.1:99.9;

so that total length of time vector be 1000, in generally for DFT, frequencies bins are represented as a multiplier of 2*pi/N, where N is length of signal, but what about this case? thanks in advance

1 Answers1

1

As can be seen from the provided link to MATLAB documentation, the algorithm does not depend on a specific sampling times tk selection. Note that for equally spaced sampling times (as you have selected), the same link indicates:

The offset depends only on the measurement times and vanishes when the times are equally spaced.

So, as you put it "calculation of time offset is not a problem".

Similar to the DFT which can be obtained from the Discrete-Time Fourier Transform (DTFT) by selecting a discrete set of frequencies, we can also choose f[n] = n * sampling_rate/N (where sampling_rate = 10 for your selection of tk). If we disregard the value of PLS(f[n]) for n=mN where m is any integer (since it's value is ill-formed, at least in the formula posted in the link), then:

\sum_{k=1}^N \cos^2(2\pi f_n t_k) = \sum_{k=1}^N \sin^2(2\pi f_n t_k) = N/

Thus for real-valued data samples:

P_{LS}(f_n) = \frac{1}{N\sigma^2} |Y(n)|^2

where Y can be expressed in terms of the diff vector you defined as:

Y = fft(diff);

That said, as indicated on wikipedia, the Lomb–Scargle method is primarilly intended for use with unequally spaced data.

SleuthEye
  • 14,379
  • 2
  • 32
  • 61
  • so it means that i should take FFT of real signal ,take square of absolute value right ? then divide by N*sigma^2 ? –  Oct 28 '14 at 10:33
  • sorry not signal itself, but signal - average ? –  Oct 28 '14 at 10:35
  • so anyway, to calculate Lomb-Scargle periodogram, i need to substract mean value from given signal ,then take fft, square of absolute value and divide by N*sigma^2 right ? –  Oct 28 '14 at 12:27
  • For your case of equally spaced signal, yes. – SleuthEye Oct 28 '14 at 16:29
  • if it is not equally spaced ? –  Oct 31 '14 at 19:34
  • Then you'd have to go back to [the formula](http://www.mathworks.com/help/signal/ref/plomb.html#lomb) to evaluate each summation term. The Nonuniform FFT (NFFT) and NFCT/NFST may come in handy to efficiently evaluate those terms (see eg. https://www-user.tu-chemnitz.de/~potts/nfft/). – SleuthEye Oct 31 '14 at 22:43