BandHurst¶
- class torcheeg.transforms.BandHurst(sampling_rate: int = 128, order: int = 5, band_dict: Dict[str, Tuple[int, int]] = {'alpha': [8, 14], 'beta': [14, 31], 'gamma': [31, 49], 'theta': [4, 8]}, apply_to_baseline: bool = False)[source][source]¶
A transform method for calculating the hurst exponent of EEG signals in several sub-bands with EEG signals as input. We revised part of the implementation in PyEEG to fit the TorchEEG pipeline.
Paper: Bao F S, Liu X, Zhang C. PyEEG: an open source python module for EEG/MEG feature extraction[J]. Computational intelligence and neuroscience, 2011, 2011.
Related Project: https://github.com/forrestbao/pyeeg/blob/master/pyeeg/hurst.py
Please cite the above paper if you use this module.
from torcheeg import transforms t = transforms.BandHurst() t(eeg=np.random.randn(32, 128))['eeg'].shape >>> (32, 4)
If the output H=0.5,the behavior of the EEG signals is similar to random walk. If H<0.5, the EEG signals cover less “distance” than a random walk, vice verse.
- __call__(*args, eeg: ndarray, baseline: ndarray | None = 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:
The differential entropy of several sub-bands for all electrodes.
- Return type:
np.ndarray[number of electrodes, number of sub-bands]