mne.time_frequency.combine_spectrum#

mne.time_frequency.combine_spectrum(all_spectrum, weights='nave')[source]#

Merge spectral data by weighted addition.

Create a new mne.time_frequency.Spectrum instance, using a combination of the supplied instances as its data. By default, the mean (weighted by trials) is used. Subtraction can be performed by passing negative weights (e.g., [1, -1]). Data must have the same channels and the same frequencies.

Parameters:
all_spectrumlist of Spectrum

The Spectrum objects.

weightslist of float | str

The weights to apply to the data of each Spectrum instance, or a string describing the weighting strategy to apply: ‘nave’ computes sum-to-one weights proportional to each object’s nave attribute; ‘equal’ weights each Spectrum by 1 / len(all_spectrum).

Returns:
spectrumSpectrum

The new spectral data.

Notes

New in v1.10.0.