mne.make_fixed_length_epochs(raw, duration=1.0, preload=False, reject_by_annotation=True, proj=True, overlap=0.0, id=1, verbose=None)[source]#

Divide continuous raw data into equal-sized consecutive epochs.

rawinstance of Raw

Raw data to divide into segments.


Duration of each epoch in seconds. Defaults to 1.

preloadbool or str (default False)

Preload data into memory for data manipulation and faster indexing. If True, the data will be preloaded into memory (fast, requires large amount of memory). If preload is a string, preload is the file name of a memory-mapped file which is used to store the data on the hard drive (slower, requires less memory).


Whether to reject based on annotations. If True (default), epochs overlapping with segments whose description begins with 'bad' are rejected. If False, no rejection based on annotations is performed.

New in v0.21.0.

projbool | ‘delayed’

Apply SSP projection vectors. If proj is ‘delayed’ and reject is not None the single epochs will be projected before the rejection decision, but used in unprojected state if they are kept. This way deciding which projection vectors are good can be postponed to the evoked stage without resulting in lower epoch counts and without producing results different from early SSP application given comparable parameters. Note that in this case baselining, detrending and temporal decimation will be postponed. If proj is False no projections will be applied which is the recommended value if SSPs are not used for cleaning the data.

New in v0.22.0.


The overlap between epochs, in seconds. Must be 0 <= overlap < duration. Default is 0, i.e., no overlap.

New in v0.23.0.


The id to use (default 1).

New in v0.24.0.

verbosebool | str | int | None

Control verbosity of the logging output. If None, use the default verbosity level. See the logging documentation and mne.verbose() for details. Should only be passed as a keyword argument.

epochsinstance of Epochs

Segmented data.


New in v0.20.

Examples using mne.make_fixed_length_epochs#

Divide continuous data into equally-spaced epochs

Divide continuous data into equally-spaced epochs