Filters
Filters
Source code in cmtj/utils/filters.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
butter_bandpass_filter(data, pass_freq, fs, order=5)
staticmethod
Basic bandpass (notch) butterworth filter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
np.ndarray
|
input data. |
required |
pass_freq |
Tuple[float, float]
|
the tuple of (low, high) band frequencies. |
required |
fs |
float
|
sampling frequency. |
required |
Source code in cmtj/utils/filters.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
butter_lowpass_filter(data, cutoff, fs, order=5)
staticmethod
Low pass digital filter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
np.ndarray
|
data to be filtered. |
required |
cutoff |
float
|
cutoff frequency of the filter. |
required |
fs |
float
|
sampling frequency. |
required |
order |
int
|
order of the filter. |
5
|
Source code in cmtj/utils/filters.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
|
detrend_axis(arr, axis)
staticmethod
Detrend axis for better spectrum visibility.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
arr |
input array (spectrum) |
required | |
axis |
axis along which to detrend |
required |
Source code in cmtj/utils/filters.py
57 58 59 60 61 62 63 64 |
|