mne.time_frequency.csd_array

mne.time_frequency.csd_array(X, sfreq, mode=’multitaper’, fmin=0, fmax=inf, fsum=True, n_fft=None, mt_bandwidth=None, mt_adaptive=False, mt_low_bias=True, verbose=None)[source]

Estimate cross-spectral density from an array.

Note

Results are scaled by sampling frequency for compatibility with Matlab.

Parameters:

X : array-like, shape (n_replicates, n_series, n_times)

The time series data consisting of n_replicated separate observations of signals with n_series components and of length n_times. For example, n_replicates could be the number of epochs, and n_series the number of vertices in a source-space.

sfreq : float

Sampling frequency of observations.

mode : str

Spectrum estimation mode can be either: ‘multitaper’ or ‘fourier’.

fmin : float

Minimum frequency of interest.

fmax : float

Maximum frequency of interest.

fsum : bool

Sum CSD values for the frequencies of interest. Summing is performed instead of averaging so that accumulated power is comparable to power in the time domain. If True, a single CSD matrix will be returned. If False, the output will be an array of CSD matrices.

n_fft : int | None

Length of the FFT. If None the exact number of samples between tmin and tmax will be used.

mt_bandwidth : float | None

The bandwidth of the multitaper windowing function in Hz. Only used in ‘multitaper’ mode.

mt_adaptive : bool

Use adaptive weights to combine the tapered spectra into PSD. Only used in ‘multitaper’ mode.

mt_low_bias : bool

Only use tapers with more than 90% spectral concentration within bandwidth. Only used in ‘multitaper’ mode.

verbose : bool, str, int, or None

If not None, override default verbose level (see mne.verbose()).

Returns:

csd : array, shape (n_freqs, n_series, n_series) if fsum is True, otherwise (n_series, n_series).

The computed cross spectral-density (either summed or not).

freqs : array

Frequencies the cross spectral-density is evaluated at.