spectral_connectivity.transforms.dpss_windows#

dpss_windows(n_time_samples_per_window: int, time_halfbandwidth_product: float, n_tapers: int, is_low_bias: bool = True) → tuple[ndarray[tuple[int, ...], dtype[floating]], ndarray[tuple[int, ...], dtype[floating]]][source]#

Compute Discrete Prolate Spheroidal Sequences.

Returns the DPSS (Slepian) tapers of orders [0, n_tapers-1] for a given time-halfbandwidth product NW and window length n_time_samples_per_window, together with their spectral-concentration ratios (eigenvalues).

Delegates to scipy.signal.windows.dpss(), which solves the same symmetric tridiagonal eigenproblem (Percival & Walden 1993) via LAPACK. The sym=True / norm=2 options reproduce the symmetric, unit-L2-norm convention used here, matching the previous vendored NiTime/MNE implementation to floating-point tolerance. It is CPU-only (banded linear algebra); the result is moved to the active array namespace afterward, as before.

Parameters:
  • n_time_samples_per_window (int) – Sequence length.

  • time_halfbandwidth_product (float, unitless) – Standardized half bandwidth NW.

  • n_tapers (int) – Number of DPSS windows to return.

  • is_low_bias (bool) – Keep only tapers with eigenvalues > MIN_EIGENVALUE_THRESHOLD (0.9).

Returns:

tapers, eigenvalues – tapers has shape (n_tapers, n_time_samples_per_window); eigenvalues has shape (n_tapers,).

Return type:

tuple

Notes

Tridiagonal form of DPSS calculation from: Slepian, D. Prolate spheroidal wave functions, Fourier analysis, and uncertainty V: The discrete case. Bell System Technical Journal, Volume 57 (1978), 1371430