mne.decoding.PSDEstimator#

class mne.decoding.PSDEstimator(sfreq=6.283185307179586, fmin=0, fmax=inf, bandwidth=None, adaptive=False, low_bias=True, n_jobs=None, normalization='length', *, verbose=None)[source]#

Compute power spectral density (PSD) using a multi-taper method.

Parameters:
sfreqfloat

The sampling frequency.

fminfloat

The lower frequency of interest.

fmaxfloat

The upper frequency of interest.

bandwidthfloat

The bandwidth of the multi taper windowing function in Hz.

adaptivebool

Use adaptive weights to combine the tapered spectra into PSD (slow, use n_jobs >> 1 to speed up computation).

low_biasbool

Only use tapers with more than 90% spectral concentration within bandwidth.

n_jobsint

Number of parallel jobs to use (only used if adaptive=True).

normalization‘full’ | ‘length’

Normalization strategy. If “full”, the PSD will be normalized by the sampling rate as well as the length of the signal (as in Nitime). Default is 'length'.

verbosebool | str | int | None

Control verbosity of the logging output. If None, use the default verbosity level. See the logging documentation and mne.verbose() for details. Should only be passed as a keyword argument.

Methods

fit(epochs_data, y)

Compute power spectral density (PSD) using a multi-taper method.

fit_transform(X[, y])

Fit to data, then transform it.

set_output(*[, transform])

Set output container.

transform(epochs_data)

Compute power spectral density (PSD) using a multi-taper method.

fit(epochs_data, y)[source]#

Compute power spectral density (PSD) using a multi-taper method.

Parameters:
epochs_dataarray, shape (n_epochs, n_channels, n_times)

The data.

yarray, shape (n_epochs,)

The label for each epoch.

Returns:
selfinstance of PSDEstimator

The modified instance.

fit_transform(X, y=None, **fit_params)[source]#

Fit to data, then transform it.

Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.

Parameters:
Xarray_like of shape (n_samples, n_features)

Input samples.

yarray_like of shape (n_samples,) or (n_samples, n_outputs), default=None

Target values (None for unsupervised transformations).

**fit_paramsdict

Additional fit parameters.

Returns:
X_newndarray array of shape (n_samples, n_features_new)

Transformed array.

set_output(*, transform=None)[source]#

Set output container.

See Introducing the set_output API for an example on how to use the API.

Parameters:
transform{“default”, “pandas”, “polars”}, default=None

Configure output of transform and fit_transform.

  • “default”: Default output format of a transformer

  • “pandas”: DataFrame output

  • “polars”: Polars output

  • None: Transform configuration is unchanged

New in v1.4: “polars” option was added.

Returns:
selfestimator instance

Estimator instance.

transform(epochs_data)[source]#

Compute power spectral density (PSD) using a multi-taper method.

Parameters:
epochs_dataarray, shape (n_epochs, n_channels, n_times)

The data.

Returns:
psdarray, shape (n_signals, n_freqs) or (n_freqs,)

The computed PSD.