LOMB-SCARGLE PERIODOGRAM · UNEVEN SAMPLING · FALSE ALARM PROBABILITY · ALIAS CHECK · RUNS IN YOUR BROWSER · NOTHING UPLOADED

Which periods are in these unevenly spaced measurements?

Paste measurements taken at uneven times, with gaps, from one instrument or several: a star's brightness on the nights it was observed, river levels read by hand, a patient's readings at each visit, sensor logs with dropouts. The Lomb-Scargle periodogram (generalised and error-weighted, Zechmeister & Kürster 2009, with one offset per instrument) fits a sine wave at every trial period and shows how much of the scatter each explains.

You get the strongest periods with their amplitude and false alarm probability (Baluev 2008), more periods found by removing each and searching again, and a check of each against the sampling rhythm, where false periods come from.

Nothing you enter leaves this browser tab. Statistical output from data you supply, not advice. Not legal, tax, or financial advice.

Your data

Rows with a missing time or value are skipped and counted.

Method and citation

The periodogram. At every trial frequency f the model y = a cos(2πft) + b sin(2πft) + c_g is fitted by weighted least squares, with weights 1/σ² when errors are given and one offset c_g per instrument or site. The power is the fraction of chi-square the sine wave removes beyond the offsets alone, p = (χ²₀ − χ²(f)) / χ²₀, from 0 to 1. This is the generalised Lomb-Scargle periodogram of Zechmeister & Kürster (2009), equations 5 and 10-20; with one group and equal weights it is the classical periodogram of Lomb (1976) and Scargle (1982) with a floating mean. The extension to several offsets centres the data and the cosine and sine within each group before forming the same sums, which is that least-squares fit with the offsets profiled out.

The grid. Frequencies run from one over the longest period to one over the shortest in steps of 1/(5T), five points per peak width over the time span T (VanderPlas 2018, section 7.1), and each peak is refined between grid points. Uneven sampling has no true Nyquist limit; the default shortest period, twice the median gap, is a convenience, so lower it if you expect faster cycles.

Significance. The false alarm probability of a peak of power z is Baluev's (2008) bound for the highest peak up to the maximum frequency searched: FAP = 1 − (1 − P₁) e^(−τ), with P₁ = (1 − z)^(N_K/2) and τ = γ(N_H) W (1 − z)^((N_K − 1)/2) √(N_H z/2), W = f_max √(4π Var t). Here N_H = N − G and N_K = N − G − 2 count the G offsets. It assumes independent Gaussian noise with the stated errors.

More periods and aliases. Each period found is fitted (amplitude, phase, offsets) and subtracted, and the periodogram is run again on what is left (pre-whitening), until the next peak's false alarm probability passes your threshold. The period's uncertainty is σ_P = P² √(6/N) σ_res / (π T A) (Montgomery & O'Donoghue 1999). The spectral window |Σ wᵢ e^(2πi f tᵢ)|² is the periodogram of the sampling alone; for each of its strongest peaks f_w, a true frequency f₀ reappears at f₀ ± f_w, and the table lists the power at those aliases as a share of the peak's.

Verified by tests in the source: on one instrument of the example the power matches astropy 6.1.4's LombScargle to 10⁻⁹ at every tested frequency, with and without errors, and its Baluev false alarm probabilities to 10⁻⁸ relative; with several groups the power equals the chi-square reduction of a brute-force least-squares fit to 10⁻¹⁰; it is unchanged by shifting the times, scaling the values or adding a constant to one group; two sine waves hidden in gappy data with an instrument offset are recovered with their amplitudes and the offset; and a 0.8-day signal sampled once a night is flagged as indistinguishable from its 4-day alias.

BibTeX

@article{lomb1976least,
  author  = {Lomb, N. R.},
  title   = {Least-squares frequency analysis of unequally spaced data},
  journal = {Astrophysics and Space Science},
  volume  = {39}, pages = {447--462}, year = {1976},
  doi     = {10.1007/BF00648343}
}
@article{scargle1982studies,
  author  = {Scargle, Jeffrey D.},
  title   = {Studies in astronomical time series analysis. {II}. Statistical aspects of spectral analysis of unevenly spaced data},
  journal = {The Astrophysical Journal},
  volume  = {263}, pages = {835--853}, year = {1982},
  doi     = {10.1086/160554}
}
@article{zechmeister2009generalised,
  author  = {Zechmeister, M. and K{\"u}rster, M.},
  title   = {The generalised {L}omb-{S}cargle periodogram. A new formalism for the floating-mean and {K}eplerian periodograms},
  journal = {Astronomy \& Astrophysics},
  volume  = {496}, pages = {577--584}, year = {2009},
  doi     = {10.1051/0004-6361/200811296}
}
@article{baluev2008assessing,
  author  = {Baluev, Roman V.},
  title   = {Assessing the statistical significance of periodogram peaks},
  journal = {Monthly Notices of the Royal Astronomical Society},
  volume  = {385}, number = {3}, pages = {1279--1285}, year = {2008},
  doi     = {10.1111/j.1365-2966.2008.12689.x}
}
@article{vanderplas2018understanding,
  author  = {VanderPlas, Jacob T.},
  title   = {Understanding the {L}omb-{S}cargle Periodogram},
  journal = {The Astrophysical Journal Supplement Series},
  volume  = {236}, number = {1}, pages = {16}, year = {2018},
  doi     = {10.3847/1538-4365/aab766}
}
@article{montgomery1999derivation,
  author  = {Montgomery, M. H. and O'Donoghue, D.},
  title   = {A derivation of the errors for least squares fitting to time series data},
  journal = {Delta Scuti Star Newsletter},
  volume  = {13}, pages = {28--32}, year = {1999}
}

Limits

Questions

What is a Lomb-Scargle periodogram?

It answers which repeating periods are in a set of measurements taken at uneven times. For every trial period it fits the best sine wave to the data by least squares and records how much of the scatter that wave explains, from 0 (none) to 1 (all). A real cycle shows up as a tall, narrow peak at its period.

Why not use an FFT?

The fast Fourier transform needs samples at equal spacing with no gaps. Field notes, telescope nights, lab visits, sensor dropouts and manual readings are not like that. Filling the gaps by interpolation invents data and can create or hide periods. The Lomb-Scargle periodogram works on the times you actually have.

What does the false alarm probability mean?

It is the chance that pure noise, with the errors you gave, would produce a peak this tall somewhere in the searched range. A value of 0.1% says noise alone rarely does this. It does not say what causes the signal, and it assumes the noise is independent from point to point with the stated size; correlated noise or underestimated errors make it too optimistic.

What is an alias?

When the sampling itself has a rhythm, such as observing only at night, only in some seasons or once a week, a true period also shows up at other periods that the sampling cannot tell apart from it. The tool computes the spectral window, the periodogram of the sampling times alone, and for each period found reports where its aliases fall and how much power they carry. If an alias is nearly as tall as the peak, the data cannot tell which is real.

What is pre-whitening?

After the strongest period is found, its sine wave is subtracted from the data and the periodogram is run again on what is left. A weaker period that was hidden under the strongest one's side lobes can then stand out. The tool repeats this until the next peak's false alarm probability rises above your threshold.

Why give each instrument its own offset?

Two instruments, sites or observers often measure the same thing with different zero points. If one of them was used mostly in later years, a single mean turns that offset into a fake long period. Fitting one offset per group removes it. Put the instrument name in a text column and the tool finds it.

Is my data uploaded anywhere?

No. The file is read and analysed by JavaScript in this browser tab. There are no accounts, cookies or analytics vendors.

Example data: 401 radial velocities in metres per second of the nearby star HD 164922, from the Keck telescope's HIRES spectrometer (k before its 2004 detector upgrade, j after) and the Automated Planet Finder at Lick Observatory (a), 1996 to 2015, with times in barycentric Julian days. They were published by Fulton et al. (2016, The Astrophysical Journal 830, 46), who announced the planet HD 164922 c, and are shipped as an example in the open-source radvel package (MIT licence). With jitter 2.6 m/s (the starting value in radvel's example fit) and four periods, the tool finds signals at the periods of the four planets the NASA Exoplanet Archive lists for this star: b near 1,200 days, c near 75.8 days, and d (12.46 days, Benatti et al. 2020) and e (41.76 days, Rosenthal et al. 2021), which were announced after this data set was published, with more data.