BandPass¶
- class torch_ecg.preprocessors.BandPass(fs: numbers.Real, lowcut: Optional[numbers.Real] = 0.5, highcut: Optional[numbers.Real] = 45, inplace: bool = True, **kwargs: Any)[source]¶
Bases:
torch.nn.modules.module.Module
Bandpass filtering preprocessor.
- Parameters
fs (numbers.Real) – Sampling frequency of the ECG signal to be filtered.
lowcut (numbers.Real, optional) – Low cutoff frequency.
highcut (numbers.Real, optional) – High cutoff frequency.
inplace (bool, default True) – Whether to perform the filtering in-place.
kwargs (dict, optional) – Other keyword arguments for
torch.nn.Module
.
- forward(sig: torch.Tensor) torch.Tensor [source]¶
Apply the preprocessor to the signal tensor.
- Parameters
sig (torch.Tensor) – The ECG signal tensor, of shape
(batch, lead, siglen)
.- Returns
The bandpass filtered ECG signal tensor, of shape
(batch, lead, siglen)
.- Return type