A Fast Periodicity Detection Algorithm Sensitive to Arbitrary Waveforms
Authors
Douglas P. Finkbeiner, Thomas A. Prince, Samuel E. Whitebook
Abstract
A reexamination of period finding algorithms is prompted by new large area astronomical sky surveys that can identify billions of individual sources having a thousand or more observations per source. This large increase in data necessitates fast and efficient period detection algorithms. In this paper, we provide an initial description of an algorithm that is being used for detection of periodic behavior in a sample of 1.5 billion objects using light curves generated from Zwicky Transient Facility (ZTF) data (Bellm et al. 2019; Masci et al. 2018). We call this algorithm "Fast Periodicity Weighting" (FPW), derived using a Gaussian Process (GP) formalism. A major advantage of the FPW algorithm for ZTF analysis is that it is agnostic to the details of the phase-folded waveform. Periodic sources in ZTF show a wide variety of waveforms, some quite complex, including eclipsing objects, sinusoidally varying objects also exhibiting eclipses, objects with cyclotron emission at various phases, and accreting objects with complex waveforms. We describe the FPW algorithm and its application to ZTF, and provide efficient code for both CPU and GPU.
Concepts
The Big Picture
Imagine finding a heartbeat in a crowd of 1.5 billion people, simultaneously, in real time, using nothing but faint flickering light. That’s what modern astronomers face as sky surveys like the Zwicky Transient Facility (ZTF) generate data on billions of stars, each observed hundreds or thousands of times. Hidden in those brightness records are pulsing stars, eclipsing binaries, and exotic objects feeding off companion stars. But you have to detect their rhythms fast enough to keep pace with the data.
The problem with existing period-finding algorithms is that they are picky. The Lomb-Scargle periodogram, the gold standard for decades, assumes stars brighten and dim in a smooth, repeating wave. Nature rarely cooperates. An eclipsing binary produces sharp, sudden dips. A white dwarf feeding on a companion creates jagged, asymmetric spikes. Stars with powerful magnetic fields pulse in complex, multi-humped patterns. Use a tool tuned for smooth waves and you miss half the zoo.
Douglas Finkbeiner (Harvard), Thomas Prince, and Samuel Whitebook (Caltech) built Fast Periodicity Weighting (FPW): an algorithm that detects periodic signals of any waveform shape, derived from statistical first principles, and fast enough to process over a billion objects on modern hardware.
Key Insight: FPW detects periodicity without assuming anything about waveform shape, making it sensitive to the full diversity of variable stars and transients that traditional sinusoid-fitting algorithms routinely miss.
How It Works
FPW belongs to the family of phase-binning algorithms, methods that test whether a signal truly repeats by folding observations together in time. Given a candidate period, every data point gets assigned to one of M phase bins based on where it falls in the cycle. If the source is truly periodic, the same bins consistently land brighter or fainter. If the period is wrong, flux scrambles randomly across bins.
The core computation has three steps:
- For each phase bin, compute a weighted sum of mean-subtracted flux values, where each observation is weighted by its inverse-variance. Precise measurements carry more weight than noisy ones.
- Square that weighted sum and divide by the total bin weight, normalizing by how many observations fell there.
- Sum across all M bins to get the FPW score S_FPW.
The algorithm handles non-uniform photometric errors without special treatment, since each brightness measurement carries its own uncertainty. For ZTF, errors are calibrated using all sources in a 47-square-degree camera quadrant, capturing systematic effects like variations in the point spread function (the way a star’s light spreads across the detector) that affect entire regions simultaneously.

The mathematical grounding comes from Gaussian Process (GP) theory. The FPW statistic is formally the difference in χ² between two hypotheses: “this source is periodic at this trial frequency” versus “this source is constant.” So FPW isn’t heuristic. It optimizes the detection of any signal that creates coherent structure when folded in phase.

There is a trade-off: for pure sinusoids, FPW is slightly less sensitive than Lomb-Scargle. But the gain everywhere else is overwhelming. ZTF contains eclipsing binaries, cataclysmic variables, accreting white dwarfs, and contact binaries, all sources whose complex waveforms are nearly invisible to a sine-wave detector. FPW recovers them.
Eclipsing systems produce sharp dips with flat tops, nothing like a sinusoid. Accreting compact objects generate asymmetric multi-peaked patterns that shift with orbital phase. Cyclotron emitters pulse in ways that depend on the viewer’s angle relative to the magnetic field axis.

For each candidate period, FPW constructs a periodogram by plotting S_FPW values versus frequency. A real period stands out as a sharp peak above the noise floor. The team validated FPW on known ZTF variable stars, recovering periods cleanly across all these morphologies where Lomb-Scargle produces weak or aliased detections.
FPW also handles irregularly sampled time series without difficulty. ZTF doesn’t observe every source on a perfect schedule, and the algorithm takes uneven gaps in stride. The implementation runs efficiently on both CPUs and GPUs, with open code available for both.
Why It Matters
The Vera Rubin Observatory’s Legacy Survey of Space and Time (LSST) will push object counts higher and observation cadences denser. Algorithms that work fine for millions of sources become bottlenecks at billions. FPW was built with this scaling problem in mind: its explicit target is ZTF’s full 1.5-billion-object dataset, and it’s already running in production.
The waveform-agnostic design also opens up astrophysics that model-specific algorithms miss. The diversity of periodic variable stars encodes stellar physics: mass transfer, magnetic fields, orbital dynamics, interior structure. A period-finder blind to non-sinusoidal signals is systematically blind to entire classes of objects.
A companion paper will provide the full Gaussian Process derivation, quantitative comparisons across waveform types, and rigorous statistical characterization of FPW’s performance.
Bottom Line: FPW delivers waveform-agnostic period detection grounded in Bayesian statistics, fast enough to process 1.5 billion ZTF light curves as billion-source sky surveys come online.
IAIFI Research Highlights
This work brings Gaussian Process machine learning into classical astrophysical time-series analysis, producing a period-finding algorithm that is both theoretically grounded and computationally scalable to billion-source surveys.
FPW shows how GP-derived probabilistic frameworks can be condensed into simple, hardware-accelerated statistics, a useful model for deploying ML-inspired inference at production scale in data-intensive science.
By detecting periodic signals across the full waveform diversity of variable stars, FPW expands access to compact object physics (accreting white dwarfs, eclipsing binaries, cyclotron emitters) in extreme environments where fundamental interactions shape observable behavior.
A follow-up paper will provide rigorous statistical benchmarking and full GP derivations; the algorithm and GPU code are publicly available, with application to ZTF's 1.5 billion-object dataset ongoing ([arXiv:2502.00243](https://arxiv.org/abs/2502.00243)).