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, with UTS time dimension.

  • sfreq (float) – New sampling frequency.

  • npad (Union[int, Literal[‘auto’]]) – Number of samples for padding at the beginning and end (default is determined automatically).

  • window (Union[str, tuple, None]) – 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 (Optional[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.

Return type

NDVar