braindecode.augmentation.functional.ft_surrogate#

braindecode.augmentation.functional.ft_surrogate(X, y, phase_noise_magnitude, channel_indep, random_state=None)[source]#

FT surrogate augmentation of a single EEG channel, as proposed in [1].

Function copied from cliffordlab/sleep-convolutions-tf and modified.

Parameters:
  • X (torch.Tensor) – EEG input example or batch.

  • y (torch.Tensor) – EEG labels for the example or batch.

  • phase_noise_magnitude (float) – Float between 0 and 1 setting the range over which the phase perturbation is uniformly sampled: [0, phase_noise_magnitude * 2 * pi].

  • channel_indep (bool) – Whether to sample phase perturbations independently for each channel or not. It is advised to set it to False when spatial information is important for the task, like in BCI.

  • random_state (int | numpy.random.Generator, optional) – Used to draw the phase perturbation. Defaults to None.

Returns:

  • torch.Tensor – Transformed inputs.

  • torch.Tensor – Transformed labels.

References

[1]

Schwabedal, J. T., Snyder, J. C., Cakmak, A., Nemati, S., & Clifford, G. D. (2018). Addressing Class Imbalance in Classification Problems of Noisy Signals by using Fourier Transform Surrogates. arXiv preprint arXiv:1806.08675.