1eurofilter

中文文档
1.3.0发布于 2026/02/15BSD-3-ClauseTypeScriptCommonJS零依赖近 30 天下载 2388

Algorithm to filter noisy signals for high precision and responsiveness.

原始使用文档
文档目录12 节
  1. Install
  2. Minimal example
  3. Doc
  4. constructor
  5. filter
  6. reset
  7. setBeta
  8. setDerivateCutoff
  9. setFrequency
  10. setMinCutoff
  11. setParameters
  12. Related publication

NPM Version npm downloads

1€ filter typescript version

Provides a typescript implementation for the 1€ filter.

Install

npm install 1eurofilter

Minimal example

import {OneEuroFilter} from '1eurofilter'

let frequency = 120; // Hz
let mincutoff = 1.0; // Hz
let beta = 0.1;      
let dcutoff = 1.0; 

let f = new OneEuroFilter(frequency, mincutoff, beta, dcutoff);

let noisyvalue = 2.1;
let timestamp = 0.0; // in seconds

let filtered = f.filter(noisyvalue, timestamp);

Doc

constructor

• new OneEuroFilter(freq, mincutoff, beta, dcutoff)

Constructs a 1 euro filter.

Parameters

NameTypeDefault valueDescription
freqnumberundefinedAn estimate of the frequency in Hz of the signal (> 0), if timestamps are not available.
mincutoffnumber1.0Min cutoff frequency in Hz (> 0). Lower values allow to remove more jitter.
betanumber0.0Parameter to reduce latency (> 0).
dcutoffnumber1.0Used to filter the derivates. 1 Hz by default. Change this parameter if you know what you are doing.

filter

▸ filter(value, timestamp): number

Returns the filtered value.

Parameters

NameTypeDescription
valuenumberNoisy value to filter
timestampnumber(optional) timestamp in seconds

reset

▸ reset(): void

Resets the internal state of the filter.

setBeta

▸ setBeta(beta): void

Sets the Beta parameter

Parameters

NameTypeDescription
betanumberParameter to reduce latency (> 0).

setDerivateCutoff

▸ setDerivateCutoff(dcutoff): void

Sets the dcutoff parameter

Parameters

NameTypeDescription
dcutoffnumberUsed to filter the derivates. 1 Hz by default. Change this parameter if you know what you are doing.

setFrequency

▸ setFrequency(freq): void

Sets the frequency of the signal

Parameters

NameTypeDescription
freqnumberAn estimate of the frequency in Hz of the signal (> 0), if timestamps are not available.

setMinCutoff

▸ setMinCutoff(mincutoff): void

Sets the filter min cutoff frequency

Parameters

NameTypeDescription
mincutoffnumberMin cutoff frequency in Hz (> 0). Lower values allow to remove more jitter.

setParameters

▸ setParameters(freq, mincutoff, beta): void

Sets the parameters of the 1 euro filter.

Parameters

NameTypeDescription
freqnumberAn estimate of the frequency in Hz of the signal (> 0), if timestamps are not available.
mincutoffnumberMin cutoff frequency in Hz (> 0). Lower values allow to remove more jitter.
betanumberParameter to reduce latency (> 0).

DOI

@inproceedings{10.1145/2207676.2208639,
    author = {Casiez, G\'{e}ry and Roussel, Nicolas and Vogel, Daniel},
    title = {1 € Filter: A Simple Speed-Based Low-Pass Filter for Noisy Input in Interactive Systems},
    year = {2012},
    isbn = {9781450310154},
    publisher = {Association for Computing Machinery},
    address = {New York, NY, USA},
    url = {https://doi.org/10.1145/2207676.2208639},
    doi = {10.1145/2207676.2208639},
    pages = {2527–2530},
    numpages = {4},
    keywords = {noise, jitter, lag, precision, filtering, responsiveness, signal},
    location = {Austin, Texas, USA},
    series = {CHI '12}
}

版本与发布记录

1eurofilter 共发布 10 个版本,首次发布于 2023/08/06;过去 12 个月发布了 1 个版本。

版本发布日期距今
1.3.0latest2026/02/158 个月前
1.2.22024/08/142 年前
1.2.12023/10/083 年前
1.2.02023/10/083 年前
1.1.12023/09/283 年前
1.1.02023/09/283 年前

关于 1eurofilter 的常见问题

1eurofilter 是什么?

Algorithm to filter noisy signals for high precision and responsiveness.

如何安装 1eurofilter?

在项目目录运行 npm install 1eurofilter,或使用 pnpm add / yarn add / bun add。

1eurofilter 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

1eurofilter 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

1eurofilter 可以商用吗?

1eurofilter 使用 BSD-3-Clause 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。另外不得用原作者名义为衍生产品背书。以上为概括,不构成法律意见,请以许可原文为准。

1eurofilter 的下载量有多少?

根据 npm 官方下载统计,1eurofilter 在 2026/10/04 – 2026/11/02 这 30 天内被下载 2,388 次,日均约 80 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

1eurofilter 还在维护吗?

最新版本 1.3.0 发布于 2026/02/15(8 个月前);至今共发布 10 个版本,其中过去 12 个月发布了 1 个;首次发布于 2023/08/06。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。