DWTDecomposition¶
- class torcheeg.transforms.DWTDecomposition(apply_to_baseline: bool = False)[source][source]¶
Splitting the EEG signal from each electrode into two functions using wavelet decomposition.
transform = DWTDecomposition() transform(eeg=np.random.randn(32, 1000))['eeg'].shape >>> (32, 500)
- Parameters
apply_to_baseline – (bool): Whether to act on the baseline signal at the same time, if the baseline is passed in when calling. (defualt:
False)
- __call__(*args, eeg: ndarray, baseline: Optional[ndarray] = None, **kwargs) Dict[str, ndarray][source][source]¶
- Parameters
eeg (np.ndarray) – The input EEG signals in shape of [number of electrodes, number of data points].
baseline (np.ndarray, optional) – The corresponding baseline signal, if apply_to_baseline is set to True and baseline is passed, the baseline signal will be transformed with the same way as the experimental signal.
- Returns
EEG signal after wavelet decomposition, where 2 corresponds to the two functions of the wavelet decomposition, and number of data points / 2 represents the length of each component
- Return type
np.ndarray[number of electrodes, 2, number of data points / 2]