Shortcuts

BaselineRemoval

class torcheeg.transforms.BaselineRemoval[source][source]

A transform method to subtract the baseline signal (the signal recorded before the emotional stimulus), the nosie signal is removed from the emotional signal unrelated to the emotional stimulus.

TorchEEG recommends using this class in online_transform for higher processing speed. Even though, this class is also supported in offline_transform. Usually, the baseline needs the same transformation as the experimental signal, please add apply_to_baseline=True to all transforms before this operation to ensure that the transformation is performed on the baseline signal

from torcheeg import transforms

t = transforms.Compose([
    transforms.BandDifferentialEntropy(apply_to_baseline=True),
    transforms.ToTensor(apply_to_baseline=True),
    transforms.BaselineRemoval(),
    transforms.ToGrid(DEAP_CHANNEL_LOCATION_DICT)
])

t(eeg=np.random.randn(32, 128), baseline=np.random.randn(32, 128))['eeg'].shape
>>> (4, 9, 9)
__call__(*args, eeg: any, baseline: any | None = None, **kwargs) Dict[str, any][source][source]
Parameters:
  • eeg (any) – The input EEG signal.

  • baseline (any) – The corresponding baseline signal.

Returns:

The transformed result after removing the baseline signal.

Return type:

any

Read the Docs v: latest
Versions
latest
stable
v1.1.1
v1.1.0
v1.0.11
v1.0.10
v1.0.9
v1.0.8.post1
v1.0.8
v1.0.7
v1.0.6
v1.0.4
v1.0.3
v1.0.2
v1.0.1
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources