Compute ratio between low-frequency power spectrum and total power spectrum. What is "low-frequency"? Defined by user but standard is something like 10 lowest percent of the total power spectrum. Performs well wherever CSD is expected (conversely bad wherever CSD might be "hidden", e.g. by high signal-to-noise ratio).
Reference
Bury et al. (2020), Detecting and distinguishing tipping points using spectral early warning signals.
Codebase
Rely on FFTW for FFT
Implementation plan
struct LowfreqPowerSpectrum <: Function
plan::Any
i_lofreq::Int
end
function LowfreqPowerSpectrum(x::AbstractVector, width::Int; q_lofreq = 0.1)
p = plan_rfft(x[1:width+1])
fft_x = p*x
i_lofreq = Int(round(length(fft_x) * q_lofreq))
return LowfreqPowerSpectrum(p, i_lofreq)
end
function (lfps::LowfreqPowerSpectrum)(x::AbstractVector)
ps = abs.(lfps.plan * x)
return sum(ps[1:lfps.i_lofreq])
end
Indicator summary
Compute ratio between low-frequency power spectrum and total power spectrum. What is "low-frequency"? Defined by user but standard is something like 10 lowest percent of the total power spectrum. Performs well wherever CSD is expected (conversely bad wherever CSD might be "hidden", e.g. by high signal-to-noise ratio).
Reference
Bury et al. (2020), Detecting and distinguishing tipping points using spectral early warning signals.
Codebase
Rely on FFTW for FFT
Implementation plan