pyeeg.utils.rolling_func

pyeeg.utils.rolling_func(func, data, winsize=2, overlap=1, padding=True)

Apply a function on a rolling window on the data.

The data is first chunked into (overlapping) windows with chunk_data(), then func is applied to each window along the channel dimension.

Parameters:
  • func (callable) – Function to apply to each window. It receives a 2D array of shape (winsize, nchannels) and must return a scalar or array.

  • data (ndarray (nsamples, nchannels)) – Data to compute rolling statistics on.

  • winsize (int) – Number of samples in one window (default 2).

  • overlap (int) – Number of samples overlapping between consecutive windows (0 means no overlap, default 1).

  • padding (bool) – Whether to pad the data so that all samples are covered by a window (default True). Currently accepted for API compatibility but ignored: the implementation always passes padding=True to chunk_data().

Returns:

out – List of func results, one per window.

Return type:

list