braindecode.preprocessing.Resample#

class braindecode.preprocessing.Resample(up=1.0, down=1.0, npad=100, axis=-1, window='boxcar', n_jobs=None, pad='reflect_limited', *, verbose=None)[source]#

Resample an array.

Operates along the last dimension of the array.

Parameters:
xndarray

Signal to resample.

upfloat

Factor to upsample by.

downfloat

Factor to downsample by.

npadint | str

Amount to pad the start and end of the data. Can also be “auto” to use a padding that will result in a power-of-two size (can be much faster).

axisint

Axis along which to resample (default is the last axis).

windowstr | tuple

Frequency-domain window to use in resampling. See scipy.signal.resample().

n_jobsint | str

Number of jobs to run in parallel. Can be ‘cuda’ if cupy is installed properly.

padstr

The type of padding to use. Supports all numpy.pad() mode options. Can also be "reflect_limited", which pads with a reflected version of each vector mirrored on the first and last values of the vector, followed by zeros. The default is 'reflect_limited'.

New in version 0.15.

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.

Returns:
yarray

The x array resampled.

See more details in mne.filter.resample