pyntbci.utilities.trials_to_epochs
- pyntbci.utilities.trials_to_epochs(X: NDArray, y: NDArray, codes: NDArray, epoch_size: int, step_size: int) tuple[NDArray, NDArray][source]
Slice trials to epochs.
- Parameters:
X (NDArray) – The EEG data of shape (n_trials, n_channels, n_samples).
y (NDArray) – Label vector of shape (n_trials).
codes (NDArray) – Codes matrix of shape (n_codes, n_samples).
epoch_size (int) – The width of an epoch starting at the onset of an epoch in samples.
step_size (int) – The distance between consecutive epochs in samples.
- Returns:
X_sliced (NDArray) – The sliced EEG data of shape (n_trials, n_epochs, n_channels, epoch_size).
y_sliced (NDArray) – The sliced label information of shape (n_trials, n_epochs).