lpf

lpf

Low Pass Filter for JavaScript

Showing:

Popularity

Downloads/wk

47

Maintenance

No Maintenance Data Available

Package

Dependencies

0

Size (min+gzip)

0.4KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Low Pass Filter for JavaScript

Overview

Lightweight algorithm to for smoothing series of values. Low Pass Filter muffles fast (high-frequency) changes to the signal. For more information visit http://en.wikipedia.org/wiki/Low-pass_filter

Installation

npm install lpf

Examples

// Array of values
LPF.smoothing = 0.5;
var values = [10,8,9,10,12,8,50,10,12,8];
LPF.smoothArray(values)
// RESULT: [10,9,9,10,11,9,30,20,16,12]

// Stream
LPF.smoothing = 0.2;
LPF.init([10,10,10,10,10,10,10,10,10,10]);
LPF.next(20); // around 12.0
LPF.next(10); // around 10.3

Testing

Open folder and run:

mocha -R spec

License

Software is licensed under MIT license. For more information check LICENSE file.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100