Skip to main content

lomb_scargle

Function lomb_scargle 

Source
pub fn lomb_scargle(
    t: &[f64],
    y: &[f64],
    angular_frequencies: &[f64],
    normalize: bool,
) -> Result<Vec<f64>, ErrorsJSL>
Expand description

The Lomb-Scargle periodogram of samples y taken at times t, at the given angular frequencies (radians per unit time).

The mean is removed first. With normalize the result is the dimensionless power in [0, 1] (the fraction of the variance explained by the sinusoid at that frequency, so a noise-free sinusoid scores 1 at its frequency); otherwise it is the unnormalised power, which for a sinusoid of amplitude A sampled N times is about A² N / 4. Zero frequencies give 0.