1eurofilter 1.0.2 → 1.1.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 +15 -13
- package/dist/OneEuroFilter.d.ts +4 -4
- package/dist/OneEuroFilter.js +4 -0
- package/package.json +3 -3
package/Readme.md
CHANGED
|
@@ -27,21 +27,23 @@ let filtered = f.filter(noisyvalue, timestamp);
|
|
|
27
27
|
|
|
28
28
|
## Related publication
|
|
29
29
|
|
|
30
|
+
[](https://doi.org/10.1145/2207676.2208639)
|
|
31
|
+
|
|
30
32
|
```
|
|
31
33
|
@inproceedings{10.1145/2207676.2208639,
|
|
32
|
-
author = {Casiez, G\'{e}ry and Roussel, Nicolas and Vogel, Daniel},
|
|
33
|
-
title = {1 € Filter: A Simple Speed-Based Low-Pass Filter for Noisy Input in Interactive Systems},
|
|
34
|
-
year = {2012},
|
|
35
|
-
isbn = {9781450310154},
|
|
36
|
-
publisher = {Association for Computing Machinery},
|
|
37
|
-
address = {New York, NY, USA},
|
|
38
|
-
url = {https://doi.org/10.1145/2207676.2208639},
|
|
39
|
-
doi = {10.1145/2207676.2208639},
|
|
40
|
-
pages = {2527–2530},
|
|
41
|
-
numpages = {4},
|
|
42
|
-
keywords = {noise, jitter, lag, precision, filtering, responsiveness, signal},
|
|
43
|
-
location = {Austin, Texas, USA},
|
|
44
|
-
series = {CHI '12}
|
|
34
|
+
author = {Casiez, G\'{e}ry and Roussel, Nicolas and Vogel, Daniel},
|
|
35
|
+
title = {1 € Filter: A Simple Speed-Based Low-Pass Filter for Noisy Input in Interactive Systems},
|
|
36
|
+
year = {2012},
|
|
37
|
+
isbn = {9781450310154},
|
|
38
|
+
publisher = {Association for Computing Machinery},
|
|
39
|
+
address = {New York, NY, USA},
|
|
40
|
+
url = {https://doi.org/10.1145/2207676.2208639},
|
|
41
|
+
doi = {10.1145/2207676.2208639},
|
|
42
|
+
pages = {2527–2530},
|
|
43
|
+
numpages = {4},
|
|
44
|
+
keywords = {noise, jitter, lag, precision, filtering, responsiveness, signal},
|
|
45
|
+
location = {Austin, Texas, USA},
|
|
46
|
+
series = {CHI '12}
|
|
45
47
|
}
|
|
46
48
|
```
|
|
47
49
|
|
package/dist/OneEuroFilter.d.ts
CHANGED
|
@@ -36,10 +36,10 @@ export declare class OneEuroFilter {
|
|
|
36
36
|
private dx;
|
|
37
37
|
private lasttime;
|
|
38
38
|
private alpha;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
setFrequency(f: number): void;
|
|
40
|
+
setMinCutoff(mc: number): void;
|
|
41
|
+
setBeta(b: number): void;
|
|
42
|
+
setDerivateCutoff(dc: number): void;
|
|
43
43
|
constructor(freq: number, mincutoff?: number, beta?: number, dcutoff?: number);
|
|
44
44
|
reset(): void;
|
|
45
45
|
filter(value: number, timestamp: number | undefined): number;
|
package/dist/OneEuroFilter.js
CHANGED
|
@@ -86,6 +86,8 @@ class OneEuroFilter {
|
|
|
86
86
|
if (mc <= 0)
|
|
87
87
|
console.log("mincutoff should be >0");
|
|
88
88
|
this.mincutoff = mc;
|
|
89
|
+
if (this.x != undefined)
|
|
90
|
+
this.x.setAlpha(this.alpha(mc));
|
|
89
91
|
}
|
|
90
92
|
setBeta(b) {
|
|
91
93
|
this.beta = b;
|
|
@@ -94,6 +96,8 @@ class OneEuroFilter {
|
|
|
94
96
|
if (dc <= 0)
|
|
95
97
|
console.log("dcutoff should be >0");
|
|
96
98
|
this.dcutoff = dc;
|
|
99
|
+
if (this.dx != undefined)
|
|
100
|
+
this.dx.setAlpha(this.alpha(dc));
|
|
97
101
|
}
|
|
98
102
|
constructor(freq, mincutoff = 1.0, beta = 0.0, dcutoff = 1.0) {
|
|
99
103
|
this.setFrequency(freq);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "1eurofilter",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Algorithm to filter noisy signals for high precision and responsiveness.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"license": "BSD-3-Clause",
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
|
-
"url": "https://github.com/casiez/OneEuroFilter/
|
|
14
|
+
"url": "https://github.com/casiez/OneEuroFilter/"
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
17
17
|
"1 euro filter",
|
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
"noise"
|
|
21
21
|
],
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@types/node": "^20.
|
|
23
|
+
"@types/node": "^20.7.0"
|
|
24
24
|
}
|
|
25
25
|
}
|