Code covered by the BSD License  

Highlights from
Lomb (Lomb-Scargle) Periodogram

4.66667

4.7 | 3 ratings Rate this file 35 Downloads (last 30 days) File Size: 2.11 KB File ID: #20004

Lomb (Lomb-Scargle) Periodogram

by Dmitry Savransky

 

21 May 2008 (Updated 22 May 2008)

Computes the Lomb normalized periodogram (spectral power as a function of frequency).

| Watch this File

File Information
Description

LOMB(T,H,OFAC,HIFAC) computes the Lomb normalized periodogram (spectral
power as a function of frequency) of a sequence of N data points H,
sampled at times T, which are not necessarily evenly spaced. T and H must
be vectors of equal size. The routine will calculate the spectral power
for an increasing sequence of frequencies (in reciprocal units of the
time array T) up to HIFAC times the average Nyquist frequency, with an
oversampling factor of OFAC (typically >= 4).

The returned values are arrays of frequencies considered (f), the
associated spectral power (P) and estimated significance of the power
values (prob). Note: the significance returned is the false alarm
probability of the null hypothesis, i.e. that the data is composed of
independent gaussian random variables. Low probability values indicate a
high degree of significance in the associated periodic signal.

Although this implementation is based on that described in Press,
Teukolsky, et al. Numerical Recipes In C, section 13.8, rather than using
trigonometric rercurrences, this takes advantage of MATALB's array
operators to calculate the exact spectral power as defined in equation
13.8.4 on page 577. This may cause memory issues for large data sets and
frequency ranges.

Example
   [f,P,prob] = lomb(t,h,4,1);
   plot(f,P)
   [Pmax,jmax] = max(P)
   disp(['Most significant period is',num2str(1/f(jmax)),' with FAP of ',num2str(prob(jmax))])

MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (7)
22 May 2008 Scott Miller

How does this compare with lombscargle.m?

23 May 2008 Dmitry Savransky

As explained in the description, this implementation calculates the exact normalized periodogram equation in a single step, using all matrix and array operations. lombscargle.m is an almost exact copy of the algorithm from Numerical Recipes in C, which uses trigonometric recurrences and many loops, and runs somewhat slower. Also, this program does not search out significant frequencies or try to reconstruct the waveform.

31 Jul 2008 Benj Hodel

Have you thought about coding a faster implementation of this as detailed in W.H. Press and G.B. Rybicki, "Fast Algorithm for Spectral Analysis of Unevenly Sampled Data," Astrophysical Journal, 338, 277 (1989)? I think it would be much quicker and more useful. See http://adsbit.harvard.edu/cgi-bin/nph-iarticle_query?1989ApJ%2E%2E%2E338%2E%2E277P

25 Jun 2009 guj

How you can reconstruct the original data

05 Nov 2009 Filipe

I have one question regarding the units that the lomb.m outputs.
The power is in ms^2, s^2, ms^2/Hz, s^2/Hz????

Any help on this would be greatly appreaciated.

Best regards!

Thank you very much in advance!

03 Mar 2010 Sarah Halliday

Thank you very much for this code it has been very useful so far.

I am attempting to analysis 2 1/2 years worth of data collected on a daily timestep. I just wanted to know exactly how I should format the input TIME vector and what the power output units would be??

Additionally, is there any guidance for selecting the best HIFAC and OFAC factors.

Thank you very much, any help would be greatly appreciated.

23 Mar 2010 Lei

Although the input of the data is the same, the signicant level is different so much when the time resolution is different (for expample, hourly, or daily resolution). I understand the signicant level depends on the number of total frequency. it seems not make sense to me. how to resolve this problem?

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
time frequency Dmitry Savransky 22 Oct 2008 10:02:41
wavelets Dmitry Savransky 22 Oct 2008 10:02:41
lomb lomb Dmitry Savransky 22 Oct 2008 10:02:41
time frequency Tian Zhijia 29 Nov 2011 08:06:49

Contact us at files@mathworks.com