mne.time_frequency.psd_array_welch(x, sfreq, fmin=0, fmax=inf, n_fft=256, n_overlap=0, n_per_seg=None, n_jobs=1, verbose=None)[source]

Compute power spectral density (PSD) using Welch’s method.

x : array, shape=(…, n_times)

The data to compute PSD from.

sfreq : float

The sampling frequency.

fmin : float

The lower frequency of interest.

fmax : float

The upper frequency of interest.

n_fft : int

The length of FFT used, must be >= n_per_seg (default: 256). The segments will be zero-padded if n_fft > n_per_seg.

n_overlap : int

The number of points of overlap between segments. Will be adjusted to be <= n_per_seg. The default value is 0.

n_per_seg : int | None

Length of each Welch segment (windowed with a Hamming window). Defaults to None, which sets n_per_seg equal to n_fft.

n_jobs : int

Number of CPUs to use in the computation.

verbose : bool, str, int, or None

If not None, override default verbose level (see mne.verbose() and Logging documentation for more).

psds : ndarray, shape (…, n_freqs) or

The power spectral densities. All dimensions up to the last will be the same as input.

freqs : ndarray, shape (n_freqs,)

The frequencies.


New in version 0.14.0.