yasa.hypno_upsample_to_sf

yasa.hypno_upsample_to_sf(hypno, sf_hypno, sf_data)[source]

Upsample the hypnogram to a given sampling frequency.

New in version 0.1.5.

Parameters
hypnoarray_like

The sleep staging (hypnogram) 1D array.

sf_hypnofloat

The current sampling frequency of the hypnogram, in Hz, e.g.

  • 1/30 = 1 value per each 30 seconds of EEG data,

  • 1 = 1 value per second of EEG data

sf_datafloat

The desired sampling frequency of the hypnogram, in Hz (e.g. 100 Hz, 256 Hz, …)

Returns
hypnoarray_like

The hypnogram, upsampled to sf_data.