TimeseriesFeatures

Documentation for TimeseriesFeatures, including syntax for the Feature, FeatureSet, and FeatureArray types.

TimeseriesFeatures.BandPower — Method
BandPower(edges; fs = 1, name = Symbol(:BandPower_, fs), psd)

A SuperFeatureSet giving the power in each of the length(edges) - 1 successive frequency bands [edges[i], edges[i + 1]). Requires DSP.jl. Frequencies are in the same units as fs, which defaults to 1 (so that bands are given in cycles per sample). The power spectral density is estimated by psd, a Welch periodogram with a Hann window by default, and shared across all bands, so it is computed only once per time series.

The default psd uses Welch segments of length(x) ÷ 8, giving a frequency resolution of 8fs / length(x); bands narrower than this contain no frequency bin and so are 0. Pass a psd with longer segments (and a matching name) to resolve narrow bands.

Features are identified by their names alone, so name carries fs: two sets differing in fs are named apart and keep their own spectra when combined, while two sets sharing an fs correctly share one spectrum. Names use numeric values rather than types, so fs = 1000 and fs = 1000.0 share a spectrum. A custom psd is not reflected in the name and so needs its own name; otherwise its spectrum aliases to that of any set with a matching fs.

Examples

𝒇 = BandPower(0:5:100; fs = 1000) # 20 linearly spaced bands
𝒈 = BandPower(exp10.(range(0, 2, 21)); fs = 1000) # shares the spectrum of 𝒇
F = (𝒇 + 𝒈)(x)
source
TimeseriesFeatures.RAD — Function
RAD(x, τ=1, doAbs=true)

Compute the rescaled auto-density, a metric for inferring the distance to criticality that is insensitive to uncertainty in the noise strength. Calibrated to experiments on the Hopf bifurcation with variable and unknown measurement noise.

Inputs: x: The input time series (vector). doAbs: Whether to centre the time series at 0 then take absolute values (logical flag) τ: The embedding and differencing delay in units of the timestep (integer), or :τ

Outputs: f: The RAD feature value

source
TimeseriesFeatures.bandpower — Function
bandpower(p, lo, hi)

Integrate the power spectral density p over the half-open band [lo, hi), so that successive bands do not share a frequency bin. A band containing no bin of p integrates to 0, so bands should be at least as wide as the frequency resolution of p.

Implemented by DSPExt (loaded with using DSP).

source