1eurofilter 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Readme.md +104 -0
- package/package.json +1 -1
package/Readme.md
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
[](https://npmjs.org/package/1eurofilter)
|
|
2
|
+
[](https://npm-stat.com/charts.html?package=1eurofilter)
|
|
3
|
+
|
|
1
4
|
# 1€ filter typescript version
|
|
2
5
|
|
|
3
6
|
Provides a typescript implementation for the [1€ filter](https://gery.casiez.net/1euro/).
|
|
@@ -25,6 +28,107 @@ let filtered = f.filter(noisyvalue, timestamp);
|
|
|
25
28
|
|
|
26
29
|
```
|
|
27
30
|
|
|
31
|
+
|
|
32
|
+
## Doc
|
|
33
|
+
|
|
34
|
+
### constructor
|
|
35
|
+
|
|
36
|
+
• **new OneEuroFilter**(`freq`, `mincutoff`, `beta`, `dcutoff`)
|
|
37
|
+
|
|
38
|
+
Constructs a 1 euro filter.
|
|
39
|
+
|
|
40
|
+
#### Parameters
|
|
41
|
+
|
|
42
|
+
| Name | Type | Default value | Description |
|
|
43
|
+
| :------ | :------ | :------ | :------ |
|
|
44
|
+
| `freq` | `number` | `undefined` | An estimate of the frequency in Hz of the signal (> 0), if timestamps are not available. |
|
|
45
|
+
| `mincutoff` | `number` | `1.0` | Min cutoff frequency in Hz (> 0). Lower values allow to remove more jitter. |
|
|
46
|
+
| `beta` | `number` | `0.0` | Parameter to reduce latency (> 0). |
|
|
47
|
+
| `dcutoff` | `number` | `1.0` | Used to filter the derivates. 1 Hz by default. Change this parameter if you know what you are doing. |
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
### filter
|
|
51
|
+
|
|
52
|
+
▸ **filter**(`value`, `timestamp`): `number`
|
|
53
|
+
|
|
54
|
+
Returns the filtered value.
|
|
55
|
+
|
|
56
|
+
#### Parameters
|
|
57
|
+
|
|
58
|
+
| Name | Type | Description |
|
|
59
|
+
| :------ | :------ | :------ |
|
|
60
|
+
| `value` | `number` | Noisy value to filter |
|
|
61
|
+
| `timestamp` | `number` | (optional) timestamp in seconds |
|
|
62
|
+
|
|
63
|
+
### reset
|
|
64
|
+
|
|
65
|
+
▸ **reset**(): `void`
|
|
66
|
+
|
|
67
|
+
Resets the internal state of the filter.
|
|
68
|
+
|
|
69
|
+
### setBeta
|
|
70
|
+
|
|
71
|
+
▸ **setBeta**(`beta`): `void`
|
|
72
|
+
|
|
73
|
+
Sets the Beta parameter
|
|
74
|
+
|
|
75
|
+
#### Parameters
|
|
76
|
+
|
|
77
|
+
| Name | Type | Description |
|
|
78
|
+
| :------ | :------ | :------ |
|
|
79
|
+
| `beta` | `number` | Parameter to reduce latency (> 0). |
|
|
80
|
+
|
|
81
|
+
### setDerivateCutoff
|
|
82
|
+
|
|
83
|
+
▸ **setDerivateCutoff**(`dcutoff`): `void`
|
|
84
|
+
|
|
85
|
+
Sets the dcutoff parameter
|
|
86
|
+
|
|
87
|
+
#### Parameters
|
|
88
|
+
|
|
89
|
+
| Name | Type | Description |
|
|
90
|
+
| :------ | :------ | :------ |
|
|
91
|
+
| `dcutoff` | `number` | Used to filter the derivates. 1 Hz by default. Change this parameter if you know what you are doing. |
|
|
92
|
+
|
|
93
|
+
### setFrequency
|
|
94
|
+
|
|
95
|
+
▸ **setFrequency**(`freq`): `void`
|
|
96
|
+
|
|
97
|
+
Sets the frequency of the signal
|
|
98
|
+
|
|
99
|
+
#### Parameters
|
|
100
|
+
|
|
101
|
+
| Name | Type | Description |
|
|
102
|
+
| :------ | :------ | :------ |
|
|
103
|
+
| `freq` | `number` | An estimate of the frequency in Hz of the signal (> 0), if timestamps are not available. |
|
|
104
|
+
|
|
105
|
+
### setMinCutoff
|
|
106
|
+
|
|
107
|
+
▸ **setMinCutoff**(`mincutoff`): `void`
|
|
108
|
+
|
|
109
|
+
Sets the filter min cutoff frequency
|
|
110
|
+
|
|
111
|
+
#### Parameters
|
|
112
|
+
|
|
113
|
+
| Name | Type | Description |
|
|
114
|
+
| :------ | :------ | :------ |
|
|
115
|
+
| `mincutoff` | `number` | Min cutoff frequency in Hz (> 0). Lower values allow to remove more jitter. |
|
|
116
|
+
|
|
117
|
+
### setParameters
|
|
118
|
+
|
|
119
|
+
▸ **setParameters**(`freq`, `mincutoff`, `beta`): `void`
|
|
120
|
+
|
|
121
|
+
Sets the parameters of the 1 euro filter.
|
|
122
|
+
|
|
123
|
+
#### Parameters
|
|
124
|
+
|
|
125
|
+
| Name | Type | Description |
|
|
126
|
+
| :------ | :------ | :------ |
|
|
127
|
+
| `freq` | `number` | An estimate of the frequency in Hz of the signal (> 0), if timestamps are not available. |
|
|
128
|
+
| `mincutoff` | `number` | Min cutoff frequency in Hz (> 0). Lower values allow to remove more jitter. |
|
|
129
|
+
| `beta` | `number` | Parameter to reduce latency (> 0). |
|
|
130
|
+
|
|
131
|
+
|
|
28
132
|
## Related publication
|
|
29
133
|
|
|
30
134
|
[](https://doi.org/10.1145/2207676.2208639)
|