# yasa.sw_detect_multi

yasa.sw_detect_multi(data, sf=None, ch_names=None, **kwargs)[source]

Multi-channel slow-waves 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.

**kwargs

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

Returns
sw_paramspandas.DataFrame

Ouput detection dataframe:

'Start' : Start of each detected slow-wave (in seconds of data)
'NegPeak' : Location of the negative peak (in seconds of data)
'MidCrossing' : Location of the negative-to-positive zero-crossing
'Pospeak' : Location of the positive peak
'End' : End time (in seconds)
'Duration' : Duration (in seconds)
'ValNegPeak' : Amplitude of the negative peak (in uV - filtered)
'ValPosPeak' : Amplitude of the positive peak (in uV - filtered)
'PTP' : Peak to peak amplitude (ValPosPeak - ValNegPeak)
'Slope' : Slope between NegPeak and MidCrossing (in uV/sec)
'Frequency' : Frequency of the slow-wave (1 / Duration)
'Stage' : Sleep stage (only if hypno was provided)
'Channel' : Channel name
'IdxChannel' : Integer index of channel in data


Notes

For better results, apply this detection only on artefact-free NREM sleep.

Note that the PTP, Slope, ValNegPeak and ValPosPeak are computed on the filtered signal.

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