Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lpf

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lpf

Low Pass Filter for JavaScript

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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.

Keywords

FAQs

Package last updated on 10 Apr 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc