pyntbci.utilities.decoding_matrix

pyntbci.utilities.decoding_matrix(data: ndarray[Any, dtype[_ScalarType_co]], length: int, stride: int = 1) ndarray[Any, dtype[_ScalarType_co]][source]

Make a Hankel-like decoding matrix. Used to phase-shift the data (i.e., backward / decoding model), to learn a spatio-spectral filter (i.e., a spectral filter per channel).

Parameters:
  • data (NDArray) – Data matrix of shape (n_trials, n_channels, n_samples).

  • length (int) – The length in samples of the spectral filter, i.e., the number of phase-shifted data per channel.

  • stride (int (default: 1)) – The step size in samples over the length of the spectral filter.

Returns:

dmatrix – Decoding matrix of shape (n_trials, n_channels * length / stride, n_samples).

Return type:

NDArray