1. Motivation: 40 nights, one planet

The radial velocities of a star are measured when they can be: at night, without clouds, when the object is high and the telescope has been allocated. The result is a time series with gaps, repetitions and no constant step. The classical tool, the discrete Fourier transform, presupposes uniform sampling. The Lomb–Scargle periodogram (Lomb 1976; Scargle 1982) solves the problem by fitting a sinusoid at each trial frequency; it is the standard method for finding the period of a planet (and of variable stars, rotation, binaries). But the sampling leaves fingerprints: ghost peaks (aliases) and a false-positive statistics that must be understood in order not to “discover” planets that do not exist. We follow the exposition of VanderPlas (2018).
2. From the classical periodogram to irregular sampling

For data (with zero mean) at , the Schuster periodogram is
With uniform sampling it inherits the Fourier properties: it is periodic in with period and symmetric, so that it only carries information up to the Nyquist frequency , and under Gaussian noise follows a distribution with two degrees of freedom at each frequency (it is the sum of two squared Gaussians). With irregular sampling both things are lost: there is no in the strict sense (if the are multiples of a unit , for example the precision with which they are recorded, then , which can be enormous; Eyer & Bartholdi 1999; VanderPlas 2018, §IV), and the sine and cosine terms are no longer independent, which spoils the statistical distribution.
3. Derivation of the Lomb–Scargle periodogram

Fitting a sinusoid at each frequency
Instead of a transform, Lomb and Scargle set up a least-squares fit of the model , , to the (centered) data. The function to minimize is and the normal equations are
The reduction in from including the sinusoid is , with (problem 1).
The phase shift τ
The cross term can be made to vanish by shifting the time origin: with instead of , if
With that choice the matrix is diagonal and (everything evaluated at ). Scargle (1982) defined the periodogram as half of that quantity:
(VanderPlas 2018, eqs. 33–34). Two properties justify the : the periodogram is invariant under time
translations and, under white Gaussian noise of variance , follows exactly an exponential
distribution (χ² with 2 d.o.f.) at each frequency, like the classical periodogram. For uniform sampling, and
. For a pure sinusoid of amplitude , (test in lombscargle.ts).
Generalized periodogram and normalization
Two practical improvements (Zechmeister & Kürster 2009): weights and a floating mean, that is, fitting
instead of subtracting the sample mean. The difference matters when the phase
coverage is incomplete: the mean of the data is not that of the model, and centering on it can suppress the true peak
(VanderPlas 2018, §VI.2). In that case the normal equations are ; potenciaLS solves them by eliminating
analytically. We normalize as the fraction of explained variance,
(VanderPlas 2018, eq. 59) with for a noiseless sinusoid and if the sinusoid improves nothing.
4. Spectral window and aliases

The periodogram of the data is, approximately, that of the underlying process convolved with the spectral window, the periodogram of the sampling itself:
with (VanderPlas 2018, eq. 48). Each peak of at replicates the true signal at (eqs. 45–47). For nightly observations from the ground the dominant peak is d⁻¹; the synodic month (29.5 d) and the year also appear. The structure of also sets the width of the peaks, with the baseline, and hence the recommended grid:
with chosen by physics (the shortest plausible period) or by a “pseudo-Nyquist” of the sampling (VanderPlas 2018, §VII.1). A grid uniform in period undersamples the high frequencies and is a frequent mistake.
5. Significance: false-alarm probability

The operational question is: if there were no signal, with what probability would the noise produce a peak as high as the observed one? This is the false-alarm probability (FAP). For the normalization of §3 with floating mean and Gaussian noise, at one frequency fixed in advance (Cumming 2004; VanderPlas 2018, eq. 53),
But we search for the maximum over many frequencies. With independent frequencies, and the naive estimate tends to underestimate the real FAP. The Baluev bound (2008), based on the extreme-value theory of continuous processes, does not need :
(VanderPlas 2018, eqs. 55–56). It is an upper bound valid for windows without strong structure; with intense aliases
it may overestimate. The empirical alternative is the bootstrap: permute the over the same many times,
recompute the periodogram and record the maximum; it is expensive (to estimate a FAP one needs
periodograms) and does not handle correlated noise. Implementation: fapUnaFrecuencia, fapBaluev, fapBootstrap.
What the FAP does not say. It is not the probability that the signal is periodic, nor that the peak is at the correct frequency: an alias can be nearly as high as the true peak (§6). And the uncertainty of the period is not the width of the peak: the width () depends neither on nor on the S/N, whereas the precision does, with the mean signal-to-noise ratio (VanderPlas 2018, eq. 52), and in any case it ignores the risk of being on the wrong peak.
Simulator
Generate a 51 Peg-like radial-velocity series and change the sampling pattern from “random” to “nights only”: the aliases at c/d of §4 appear. Reduce or raise until the peak no longer exceeds the 1% FAP line, and fold the data with the alias to see why a “pretty” folded curve is not enough as proof.
- Detected P
- 4.229 d (0.2365 cycles/d)
- True P
- 4.230 d · error -0.03 %
- Peak power
- 0.911 (1 % FAP threshold: 0.162)
- FAP (Baluev)
- < 0.01 % · significant
- Verdict
- matches the true period
- Grid
- 3515 frequencies, Δf = 1.14e-3 c/d
- Daily aliases of the peak
- 1.31 d, 0.809 d, 0.567 d, 0.447 d
- Folded with
- P = 4.229 d (detected)
6. Computational example: a 51 Peg-like series

With velocidadRadial.ts and lombscargle.ts we generate 40 measurements on 40 different nights within an interval of 61 d
(one measurement per night at a random time), with d, m s⁻¹, circular orbit and noise m s⁻¹
(ELODIE), grid up to d⁻¹:
| Quantity | Result |
|---|---|
| Periodogram peak | d⁻¹, d, |
| Grid step | d⁻¹ ⇒ d |
| (one frequency) | |
| Baluev FAP () | |
| Window at d⁻¹ | (very strong diurnal alias) |
| Alias d⁻¹ ( d) | power 0.863 |
| Alias d⁻¹ ( d) | power 0.708 |
| Pure noise (same ): maximum | 0.373, Baluev FAP 0.017 |
| Bootstrap versus Baluev at | 0.033 versus 0.008 |
Lessons of the experiment: (i) the period is recovered within the resolution of the grid; (ii) the peak is overwhelmingly significant, but (iii) the 1.31 d alias has 98% of the power of the true one: with a single season of nightly data one cannot decide between 4.23 d and 1.31 d from the periodogram alone (one needs observations at different times of night, or from another hemisphere, or a second periodogram after subtracting the candidate); (iv) in pure noise the maximum reaches 0.37, and Baluev (0.017) is more optimistic than the bootstrap (0.033) because the window is highly structured: for nightly windows it is advisable to calibrate with resampling.
7. Error analysis and cost

- Cost. The direct computation is with : for years, d⁻¹ and that is frequencies; the Press & Rybicki (1989) algorithm with FFT lowers it to .
- Grid error. If the peaks can fall between nodes and up to half of the power can be lost; with the maximum loss is (sinc² width).
- Red noise. Stellar activity produces correlated power at periods from days to months; none of the FAPs above is valid, and the stellar-rotation peaks (and their aliases) compete with the planets. It is modeled with Gaussian processes or simultaneous activity indicators are used.
- Multiple signals. The periodogram is linear in a single sinusoid; two planets are searched for iteratively (“pre-whitening”: subtract the best fit and repeat), or with multi-frequency fits.
Problems
1. (Proof) Reduction of χ². Show that for the linear model with normal matrix and vector , the minimum of is , and specialize to the two-parameter model (cosine and sine) with the matrix of §3.
Proof
with . The gradient gives and, substituting, . With , : , and , which reduces to when .
2. (Proof) The phase shift τ. Show that with one has , and that is invariant if all the are shifted by .
Proof
with , ; it vanishes if . If , then rotate by the angle and the solution becomes : the arguments do not change and neither does .
3. Aliases. A planet has d. With nightly observations (window at 1 d⁻¹) and over one year (window at 1/365 d⁻¹), list the periods of the first-order aliases. Which of them would be confused with a “super-Earth at 1.4 d”? What observation breaks the degeneracy?
Show solution
d⁻¹. Diurnal aliases: ⇒ 1.385 d; ⇒ 0.783 d. Annual aliases: ⇒ 3.565 and 3.636 d (indistinguishable with shorter than a few years). The 1.385 d alias is the “1.4 d” candidate. Observing at different phases of the day (several measurements per night at different times, or telescopes at different longitudes) reduces the window at 1 d⁻¹; or compare the of the two fits with many data.
4. FAP. With and d⁻¹ over d with : (a) compute and the Baluev bound for , and ; (b) what height is needed for FAP = 1%? (c) Why is the single-frequency FAP so small compared with that of the maximum?
Show solution
. (a) : , , FAP . : , , FAP . : , . (b) Solving : . (c) Because the maximum is searched for among independent peaks: the bound multiplies approximately by that number.
5. (Proof) Single-frequency distribution. For Gaussian noise of variance and uniform sampling, show that follows an exponential of mean 1, that is, , at a frequency that is neither 0 nor Nyquist. Why does it change to with the normalization of §3?
Proof
and are linear combinations of Gaussians, with mean 0 and variance (by construction of the denominators) and uncorrelated (because after the phase shift τ): they are two independent normals . Half the sum of their squares divided by is , whose survival function is . With the normalization and floating mean, and are independent, so that follows a Beta distribution, with (Cumming 2004); for and small , , which recovers the exponential.
6. (Computational) Reproduce the example of §6. Generate the series, compute the generalized periodogram, the spectral window and the three FAPs (one frequency, Baluev, bootstrap with 300 permutations) for the peak and for in pure noise. Then subtract the fitted sinusoid and recompute the periodogram: does the 1.31 d alias disappear?
Outline in Python
import numpy as np
rng = np.random.default_rng(2024)
t = np.sort(rng.choice(np.arange(61), 40, replace=False) + 0.9 + 0.2*rng.random(40))
P0, K, s = 4.2293, 59.0, 13.0
y = K*np.cos(2*np.pi*t/P0) + s*rng.standard_normal(40)
def pot(t, y, f): # generalized periodogram, normalization [0, 1]
X = np.c_[np.ones_like(t), np.cos(2*np.pi*f*t), np.sin(2*np.pi*f*t)]
r = y - X @ np.linalg.lstsq(X, y, rcond=None)[0]
return 1 - (r @ r) / ((y - y.mean()) @ (y - y.mean()))
T = t.max() - t.min(); fr = np.arange(0, 2, 1/(10*T))
P = np.array([pot(t, y, f) for f in fr]); k = P.argmax()
W = np.abs(np.exp(-2j*np.pi*np.outer(fr, t)).sum(1))**2 / 40**2
N = 40; z = P[k]; Weff = 2*np.sqrt(4*np.pi*t.var())
fap1 = (1-z)**((N-3)/2); fap_b = 1 - (1-fap1)*np.exp(-Weff*(1-z)**((N-4)/2)*np.sqrt(z))
boot = np.mean([max(pot(t, rng.permutation(y), f) for f in fr) >= z for _ in range(300)])
print(1/fr[k], z, fap1, fap_b, boot, W[np.argmin(abs(fr-1))])After subtracting the fit at 4.23 d, the residual periodogram shows no peak at 1.31 d: the alias was a reflection of the signal, not an independent signal. Had the alias been subtracted, the residual would keep power at 4.23 d.
7. Grid. For a campaign of years with d⁻¹ and , how many frequencies must be evaluated? If instead a grid uniform in period between 1 and 3000 d with the same number of points is used, what is the step in frequency near d and near d? Which peaks are lost?
Show solution
. With step d: near d, d⁻¹, 300 times larger than the width d⁻¹ (almost all the short-period peaks are lost); near 1000 d, d⁻¹, a useless oversampling of 3000 points per peak.
✦ Self-assessment
Further reading
- VanderPlas, J. T. (2018). Understanding the Lomb–Scargle periodogram, ApJS 236, 16: the conceptual guide this lesson follows; includes code.
- Scargle (1982), ApJ 263, 835 and Lomb (1976), Ap&SS 39, 447: the original papers; Zechmeister & Kürster (2009), A&A 496, 577: floating mean and weights.
- Baluev (2008), MNRAS 385, 1279: the FAP bound; Cumming (2004), MNRAS 354, 1165: FAP and detectability in radial-velocity surveys.
- Perryman (2018). The Exoplanet Handbook, §2.3; Gregory (2005). Bayesian Logical Data Analysis, ch. 13: the periodogram from the Bayesian perspective (Bretthorst).
🍎 Teacher guide
- Time
- 2 classes of 75 min
- Learning outcome
- By the end, the student derives the Lomb–Scargle periodogram as a least-squares fit, predicts the aliases from the spectral window and assesses the significance of a peak with the Baluev FAP and by resampling, knowing their limits.
- Evidence of learning
- Submission of problem 6 (periodogram, window, three FAPs and pre-whitening) and of problem 4 with the calculations of the Baluev bound.
Materials
- Python 3 with NumPy (optionally astropy.timeseries.LombScargle for comparison)
- src/lib/math/lombscargle.ts and velocidadRadial.ts
- Figures 17 and 24 of VanderPlas 2018 (window and aliases)
Suggested sequence
Class 1. Fourier with irregular sampling (§2); full derivation of Lomb–Scargle with the phase shift τ (§3, problems 1 and 2). Spectral window and aliases (§4) with the 51 Peg example: predict 1.31 d before computing.
Class 2. Single-frequency FAP, Baluev and bootstrap (§5) with problem 4; lab with problem 6, including pre-whitening. Closing: list of what the periodogram does not say (§7).
Common mistakes
- Applying the Nyquist frequency 1/(2 mean Δt) to irregular data: no such limit exists; use the pseudo-Nyquist or the physics.
- Taking the width of the peak as the error of the period.
- Interpreting a small FAP as proof that the period is that of the highest peak and not an alias.
- Using grids uniform in period.
- Forgetting the floating mean with incomplete phase coverage.