phase_swap
- selfeeg.augmentation.functional.phase_swap(x: ArrayLike) ArrayLike[source]
Apply the phase swap data augmentation to the ArrayLike object.
The phase swap data augmentation consists in merging the amplitude and phase components of biosignals from different sources to help the model learn their coupling. Specifically, the amplitude and phase of two randomly selected EEG samples are extracted using the Fourier transform. New samples are then generated by applying the inverse Fourier transform, combining the amplitude from one sample with the phase from the other. See the following paper for more information [phaseswap].
- Parameters:
x (ArrayLike) – A 3-dimensional torch tensor or numpy array. The last two dimensions must refer to the EEG (Channels x Samples).
- Returns:
x (ArrayLike) – The augmented version of the input Tensor or Array.
Note
Phase swap ignores the class of each sample.
References
[phaseswap]Lemkhenter, Abdelhak, and Favaro, Paolo. “Boosting Generalization in Bio-signal Classification by Learning the Phase-Amplitude Coupling”. DAGM GCPR (2020).