-
Notifications
You must be signed in to change notification settings - Fork 1
[Class] Time Domain Filter
This class allows you to design time domain filters! Conventional time filters apply a convolution operation to a window sliding through the samples.
Give the following design properties:
-
📶
operation
: The convolution operation to apply to each segment. Choose one from ConvolutionOperation:-
MEDIAN
- Median of the window' samples -
HAMMING
- Hamming window -
HANN
- Hann window -
PARZEN
- Parzen window -
KAISER
- Kaiser window -
GAUSSIAN
- Gaussian or Normal window
-
-
↔️ window_length
: The length of the window (in timedelta). -
⏭
overlap_length
: The overlap between adjecent windows when sliding (in timdelta). -
**options
: Other parameters to be passed to scipy filtering function -- optional.
filter = TimeDomainFilter(ConvolutionOperation.MEDIAN, timedelta(seconds=2), timedelta(seconds=0.5))
filter = TimeDomainFilter(ConvolutionOperation.HAMMING, timedelta(seconds=2))
You can get and reset any of the properties given at instantiation.
It's so easy, let's do it 👩🏽💻! To apply a Filter you have designed (e.g. f1
) to a Biosignal, just call filter
from that Biosignal and give f1
:
biosignal.filter(f1)
The filter will be applied to every channel of biosignal
and return 0 in case of success.