one_euro_filter
OneEuroFilter
One Euro Filter for smoothing signals, taken from https://github.com/HoBeom/OneEuroFilter-Numpy
Examples:
>>> from fast_cody import OneEuroFilter
>>> import numpy as np
>>> mu = np.ones((3, 1))
>>> x0 = np.random.randn(3, 1) + mu
>>> f = OneEuroFilter(x0)
>>> x = np.random.randn(3, 1) + mu
>>> x_filtered = f(x)
>>> print(x_filtered)
Source code in src\fast_cody\one_euro_filter.py
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 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
__call__(x)
Compute the filtered signal.
Source code in src\fast_cody\one_euro_filter.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
__init__(x0, dx0=0.0, min_cutoff=1.0, beta=0.0, d_cutoff=1.0)
Initialize the one euro filter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x0 |
float
|
Initial value for the filtered signal. |
required |
dx0 |
float
|
Initial value for the derivative. |
0.0
|
min_cutoff |
float
|
Minimum cutoff frequency. |
1.0
|
beta |
float
|
Cutoff slope. |
0.0
|
d_cutoff |
float
|
Cutoff frequency for the derivate. |
1.0
|
Source code in src\fast_cody\one_euro_filter.py
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 |
|