pyntbci.eeg.generate_c_vep_source

pyntbci.eeg.generate_c_vep_source(stimulus: NDArray, y: NDArray, n_samples: int, fs: int, impulse_response: NDArray = None, dtype: str | dtype = 'float32') NDArray[source]

Generate a single-source c-VEP signal per trial. The c-VEP is generated by convolving a binary stimulus with a VEP impulse response, following the reconvolution approach used throughout PyntBCI (see rCCA in classifiers).

Parameters:
  • stimulus (NDArray) – The (single-cycle) binary stimulus of shape (n_classes, n_bits). Sampled at fs.

  • y (NDArray) – The vector of ground-truth labels of shape (n_trials), i.e., the index in stimulus of the class of each trial.

  • n_samples (int) – The number of samples per trial.

  • fs (int) – The sampling frequency in Hz.

  • impulse_response (NDArray (default: None)) – The impulse response of shape (n_response_samples,) to convolve the stimulus with. If None, a default impulse response is generated using generate_impulse_response(fs).

  • dtype (str | np.dtype (default: "float32")) – The dtype of the returned array. Computation is always done in float64 internally; this only controls the precision of the final result.

Returns:

source – The single-source c-VEP signal of shape (n_trials, n_samples), normalized to unit standard deviation.

Return type:

NDArray