braindecode.datautil.create_fixed_length_windows

braindecode.datautil.create_fixed_length_windows(concat_ds, start_offset_samples, stop_offset_samples, window_size_samples, window_stride_samples, drop_last_window, mapping=None, preload=False, drop_bad_windows=True)

Windower that creates sliding windows.

Parameters
concat_ds: ConcatDataset

a concat of base datasets each holding raw and descpription

start_offset_samples: int

start offset from beginning of recording in samples

stop_offset_samples: int | None

stop offset from beginning of recording in samples.

window_size_samples: int

window size

window_stride_samples: int

stride between windows

drop_last_window: bool

whether or not have a last overlapping window, when windows do not equally divide the continuous signal

mapping: dict(str: int)

mapping from event description to target value

preload: bool

if True, preload the data of the Epochs objects.

drop_bad_windows: bool

If True, call .drop_bad() on the resulting mne.Epochs object. This step allows identifying e.g., windows that fall outside of the continuous recording. It is suggested to run this step here as otherwise the BaseConcatDataset has to be updated as well.

Returns
windows_ds: WindowsDataset

Dataset containing the extracted windows.

Examples using braindecode.datautil.create_fixed_length_windows