Resample#
- class torch_ecg.preprocessors.Resample(fs: int | None = None, dst_fs: int | None = None, siglen: int | None = None, inplace: bool = False, **kwargs: Any)[source]#
Bases:
ModuleResample the signal into fixed sampling frequency or length.
- Parameters:
Note
One and only one of fs and siglen should be set. If fs is set, src_fs should also be set.
TODO
Consider vectorized
scipy.signal.resample()?- forward(sig: Tensor) Tensor[source]#
Apply the resampling to the signal tensor.
- Parameters:
sig (torch.Tensor) – The signal tensor to be resampled, of shape
(..., n_leads, siglen).- Returns:
The resampled signal tensor, of shape
(..., n_leads, siglen).- Return type: