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:
- N
int Sequence length.
- half_nbw
float Standardized half bandwidth corresponding to 2 * half_bw = BW*f0 = BW*N/dt but with dt taken as 1.
- Kmax
int Number of DPSS windows to return is Kmax (orders 0 through Kmax-1).
- sym
bool Whether to generate a symmetric window (
True, for filter design) or a periodic window (False, for spectral analysis). Default isTrue.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 usingN**2/(N**2+half_nbw)(“approximate”) or a FFT-based subsample shift (“subsample”).2uses the L2 norm.None(the default) uses"approximate"whenKmax=Noneand2otherwise.New in version 1.3.
- low_bias
bool Keep only tapers with eigenvalues > 0.9.
- interp_from
int|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_fromoption is deprecated and will be removed in version 1.4. Modern implementations can handle large values ofNso interpolation is no longer necessary; any value passed here will be ignored.- interp_kind
str|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_kindoption is deprecated and will be removed in version 1.4. Modern implementations can handle large values ofNso interpolation is no longer necessary; any value passed here will be ignored.
- N
- 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