braindecode.functional.derivation_matrix#

braindecode.functional.derivation_matrix(ch_names, electrodes=None, reference=None)[source]#

Each channel as a row over electrode potentials.

Parameters:
  • ch_names (list[str]) – "A" is V(A), "A-B" is V(A) - V(B). Names are compared ignoring case; any other name is one electrode.

  • electrodes (list[str] | None) – Columns (lower case). Defaults to the electrodes of ch_names in order of appearance; electrodes missing from the list are added.

  • reference (str | None) – Reference of the single-electrode channels: None (the recording’s, left implicit), an electrode name ("Cz": A is V(A) - V(Cz)) or "average" (A minus the mean of the single-electrode channels).

Return type:

tuple[Tensor, list[str]]

Returns:

  • matrix (torch.Tensor) – (n_channels, n_electrodes), float64.

  • electrodes (list of str) – The columns.