eelbrain.resample

eelbrain.resample(ndvar, sfreq, npad='auto', window=None, pad='edge', name=None)

Resample an NDVar along the time dimension

Parameters:
ndvar : NDVar

Input data.

sfreq : scalar

New sampling frequency.

npad : int | ‘auto’

Number of samples for padding at the beginning and end (default is determined automatically).

window : str | tuple

Window applied to the signal in the fourier domain (default is no window; see scipy.signal.resample()).

pad : str

Padding method (default 'edge'; see numpy.pad() mode parameter).

name : str

Name for the new NDVar (default is ndvar.name).

Notes

If padding is enabled, this function uses mne.filter.resample(). If not, scipy.signal.resample() is used directly.

This function can be very slow when the number of time samples is uneven (see scipy.signal.resample()). Using npad='auto' (default) ensures an optimal number of samples.