mne.time_frequency.dpss_windows#

mne.time_frequency.dpss_windows(N, half_nbw, Kmax, *, sym=True, norm=None, low_bias=True, interp_from=None, interp_kind=None)[source]#

Compute Discrete Prolate Spheroidal Sequences.

Will give of orders [0,Kmax-1] for a given frequency-spacing multiple NW and sequence length N.

Note

Copied from NiTime.

Parameters:
Nint

Sequence length.

half_nbwfloat

Standardized half bandwidth corresponding to 2 * half_bw = BW*f0 = BW*N/dt but with dt taken as 1.

Kmaxint

Number of DPSS windows to return is Kmax (orders 0 through Kmax-1).

symbool

Whether to generate a symmetric window (True, for filter design) or a periodic window (False, for spectral analysis). Default is True.

New in version 1.3.

norm2 | 'approximate' | 'subsample' | None

Window normalization method. If 'approximate' or 'subsample', windows are normalized by the maximum, and a correction scale-factor for even-length windows is applied either using N**2/(N**2+half_nbw) (“approximate”) or a FFT-based subsample shift (“subsample”). 2 uses the L2 norm. None (the default) uses "approximate" when Kmax=None and 2 otherwise.

New in version 1.3.

low_biasbool

Keep only tapers with eigenvalues > 0.9.

interp_fromint | None

The dpss can be calculated using interpolation from a set of dpss with the same NW and Kmax, but shorter N. This is the length of this shorter set of dpss windows.

Deprecated since version 1.3: The interp_from option is deprecated and will be removed in version 1.4. Modern implementations can handle large values of N so interpolation is no longer necessary; any value passed here will be ignored.

interp_kindstr | None

This input variable is passed to scipy.interpolate.interp1d and specifies the kind of interpolation as a string (‘linear’, ‘nearest’, ‘zero’, ‘slinear’, ‘quadratic, ‘cubic’) or as an integer specifying the order of the spline interpolator to use.

Deprecated since version 1.3: The interp_kind option is deprecated and will be removed in version 1.4. Modern implementations can handle large values of N so interpolation is no longer necessary; any value passed here will be ignored.

Returns:
v, etuple,

The v array contains DPSS windows shaped (Kmax, N). e are the eigenvalues.

Notes

Tridiagonal form of DPSS calculation from [1].

References