pyhctsa.operations.spectral.phase_fluctuation_scaling

pyhctsa.operations.spectral.phase_fluctuation_scaling(y, half_width_frac=0.01, num_windows=16, max_n=10000)

Multi-scale fluctuation analysis of the instantaneous phase of the dominant oscillation.

Isolates the dominant oscillatory component of y (the frequency band carrying the most spectral power, excluding DC and Nyquist), takes its instantaneous phase via the analytic signal, and asks how the fluctuation of that phase about its mean rotation rate grows with window size w: mean(|dphi(t+w) - dphi(t)|) against w, in log-log space (the same logic as detrended fluctuation analysis, as in fluctuation_analysis, applied to instantaneous phase instead of raw values).

The method is inspired by the analytic-signal analysis of strange nonchaotic dynamics (SNA): for nonchaotic dynamics the curve rises at short windows but flattens at longer windows (the largest Lyapunov exponent is negative and the phase dynamics are globally stable), whereas for chaotic dynamics it keeps rising at long windows. The original method uses empirical mode decomposition to isolate the dominant intrinsic mode; this implementation instead bandpasses around the single dominant non-edge FFT peak (the band-limited analytic-signal trick of phase_amp_coupling), which is simpler and avoids EMD’s mode-mixing and boundary sensitivities, at the cost of not being a literal reimplementation.

Parameters:
y : array-like

The input time series.

half_width_frac : float, optional

Half-width of the frequency band around the dominant peak, as a fraction of the usable (DC- and Nyquist-excluded) one-sided spectrum, and at least 2 bins. Default is 0.01.

num_windows : int, optional

The number of log-spaced window sizes (from 2 samples to N/4) to evaluate, split into a short-window half and a long-window half for two separate linear fits in log-log space. Default is 16.

max_n : int, optional

The maximum number of samples to consider; longer series are cropped to their first max_n points. Default is 10000.

Returns:

  • meanFreq: the mean rotation frequency of the isolated dominant component, in cycles per sample.

  • slope_short, slope_long: log-log slopes of the phase fluctuation against window size, over the shorter and the longer half of the window sizes (the two fits share one point).

  • slope_diff: slope_short - slope_long.

NaN is returned if the series is too short for a well-defined dominant band (or the phase is non-finite); the slopes are NaN if it is too short for the multi-scale analysis.

Return type:

dict or float

Notes

The short-window slope does not behave as the SNA reasoning suggests: the phase comes from a narrow band, so it is smooth at short lags for any input, and mean(|dphi(t+w) - dphi(t)|) grows linearly with w there (the trivial derivative regime): slope_short is about 1 regardless of dynamics, and slope_diff is just 1 - slope_long. The informative quantity is slope_long alone: near 0 where the phase fluctuation saturates (periodic, SNA-like), and positive where it keeps growing (chaotic, noisy).

References

K. Gupta, A. Prasad, H.P. Singh, R. Ramaswamy, “Analytical signal analysis of strange nonchaotic dynamics”, Phys. Rev. E 77, 046220 (2008).