diff --git a/doc/api/time_frequency.rst b/doc/api/time_frequency.rst index b66b1b6ca64..a9ab2c34268 100644 --- a/doc/api/time_frequency.rst +++ b/doc/api/time_frequency.rst @@ -32,6 +32,7 @@ Functions that operate on mne-python objects: :toctree: ../generated/ combine_spectrum + combine_tfr csd_tfr csd_fourier csd_multitaper diff --git a/doc/changes/devel/13054.newfeature.rst b/doc/changes/devel/13054.newfeature.rst new file mode 100644 index 00000000000..3c89290e7fe --- /dev/null +++ b/doc/changes/devel/13054.newfeature.rst @@ -0,0 +1 @@ +Added :func:`mne.time_frequency.combine_tfr` to allow combining TFRs across tapers, by `Thomas Binns`_. \ No newline at end of file diff --git a/mne/time_frequency/__init__.pyi b/mne/time_frequency/__init__.pyi index a612c2a850a..6b53c39a98b 100644 --- a/mne/time_frequency/__init__.pyi +++ b/mne/time_frequency/__init__.pyi @@ -12,6 +12,7 @@ __all__ = [ "Spectrum", "SpectrumArray", "combine_spectrum", + "combine_tfr", "csd_array_fourier", "csd_array_morlet", "csd_array_multitaper", @@ -73,6 +74,7 @@ from .tfr import ( EpochsTFRArray, RawTFR, RawTFRArray, + combine_tfr, fwhm, morlet, read_tfrs, diff --git a/mne/time_frequency/tfr.py b/mne/time_frequency/tfr.py index b1736f151d2..71dabce6d31 100644 --- a/mne/time_frequency/tfr.py +++ b/mne/time_frequency/tfr.py @@ -3914,10 +3914,10 @@ def __init__( def combine_tfr(all_tfr, weights="nave"): """Merge AverageTFR data by weighted addition. - Create a new AverageTFR 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 time instants. + Create a new :class:`mne.time_frequency.AverageTFR` 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 time instants. Parameters ----------