Expand description
Spectral estimation for non-uniformly sampled data.
Ordinary FFT spectra assume evenly spaced samples. When samples fall at irregular times (missed measurements, event-driven sensors, astronomical observations) the usual tools are:
- the Lomb-Scargle periodogram (
lomb_scargle), which fits a sinusoid by least squares at each trial frequency. It is equivalent to the classical periodogram for even sampling, copes with arbitrary gaps, and with irregular times is not subject to the usual Nyquist aliasing, so frequencies far above the average sampling rate can still be detected; - the non-uniform discrete Fourier transform (
non_uniform_dft), a direct evaluation ofΣ y[n] e^{-j2π f t[n]}at arbitrary frequencies; - a three-parameter least-squares sinusoid fit (
fit_sinusoid) giving the amplitude and phase at one frequency.
All routines cost O(N · F) (samples times frequencies).
See the book entry Power spectra: periodogram, Welch, spectrogram and Lomb-Scargle.
Structs§
- Sinusoid
Fit - The result of fitting
offset + amplitude · cos(2π f t + phase)to the samples.
Functions§
- fit_
sinusoid - Least-squares fit of a constant plus a sinusoid of known frequency
f(cycles per unit time). - lomb_
scargle - The Lomb-Scargle periodogram of samples
ytaken at timest, at the given angular frequencies (radians per unit time). - lomb_
scargle_ frequency_ grid - A sensible frequency grid (cycles per unit time, excluding zero) for
lomb_scargle: spacing1 / (oversampling · T)for a record of durationT, extending tomax_frequency. - non_
uniform_ dft - Non-uniform discrete Fourier transform:
X(f) = Σ y[n] e^{-j2π f t[n]}at each frequency (in cycles per unit time). - non_
uniformly_ sampled_ spectrum - Lomb-Scargle power at frequencies given in cycles per unit time (Hz when
tis in seconds). This is the spectrum of irregularly sampled data as a function of ordinary frequency.