# yasa.spindles_detect_multi

yasa.spindles_detect_multi(data, sf=None, ch_names=None, multi_only=False, **kwargs)[source]

Multi-channel spindles detection.

Parameters
dataarray_like

Multi-channel data. Unit must be uV and shape (n_chan, n_samples). Can also be a mne.io.BaseRaw, in which case data, sf, and ch_names will be automatically extracted, and data will also be automatically converted from Volts (MNE) to micro-Volts (YASA).

sffloat

Sampling frequency of the data in Hz. Can be omitted if data is a mne.io.BaseRaw.

ch_nameslist of str

Channel names. Can be omitted if data is a mne.io.BaseRaw.

multi_onlyboolean

Define the behavior of the multi-channel detection. If True, only spindles that are present on at least two channels are kept. If False, no selection is applied and the output is just a concatenation of the single-channel detection dataframe. Default is False.

**kwargs

Keywords arguments that are passed to the yasa.spindles_detect() function.

Returns
sp_paramspandas.DataFrame

Ouput detection dataframe:

'Start' : Start time of each detected spindles (in seconds)
'Peak': Timing of the most prominent spindles peak (in seconds)
'End' : End time (in seconds)
'Duration' : Duration (in seconds)
'Amplitude' : Amplitude (in uV)
'RMS' : Root-mean-square (in uV)
'AbsPower' : Median absolute power (in log10 uV^2)
'RelPower' : Median relative power (ranging from 0 to 1, in % uV^2)
'Frequency' : Median frequency (in Hz)
'Oscillations' : Number of oscillations (peaks)
'Symmetry' : Symmetry index, ranging from 0 to 1
'Channel' : Channel name
'IdxChannel' : Integer index of channel in data
'Stage' : Sleep stage (only if hypno was provided)


Notes

For an example of how to run the detection, please refer to https://github.com/raphaelvallat/yasa/blob/master/notebooks/02_spindles_detection_multi.ipynb