Git Product home page Git Product logo

microsmooth's Introduction

Microsmooth

Introduction

A lightweight and fast signal smoothing library for the Arduino platform.

This library provides implementations of signal processing algorithms like:

  • Simple Moving Average (SMA)
  • Cumulative Moving Average (CMA)
  • Exponential Moving Average (EMA)
  • Savitzky Golay Filter (SGA)
  • Ramer Douglas Peucker Algorithm (RDP)
  • Kolmogorov Zurbenko Algorithm (KZA)

Installation

Use the standard process for Arduino libraries. The following steps are involved:

  • Create a folder libraries in your Sketchbook
  • Git clone, or download and extract, this library in that folder. So, your sketchbook should have the following structure -> /libraries/microsmooth/microsmooth.[cpp|h] and additional files.
  • In your sketch, add #include <microsmooth.h> and compile.

Usage

The library can be used as shown below:

  • First, initialize the library: uint16_t *history = ms_init(SMA); where SMA can be replaced with any of the three alphabet codes given above.
  • Then, input your analog signal value using analogRead() or pulseIn into an int variable, referred here as channel_value.
  • Pass the variable into the filter initialized in the first step: int processed_value = sma_filter(channel_value, history);
  • Repeat for input channel for a time domain signal.
  • When done, deinit library with: ms_deinit(history); (This releases the memory being utilized)

The filters all have the same interface:

<Three digit code>_filter(channel_value, history)

where <Three digit code> can be sma, cma, ema, rdp, sga, kza.

Code Sample

A simple code sample for using any of the filters in the library is available here.

Performance Analysis

The best performing filter at present is EMA with alpha parameter 0.10.

The ranking strategy for the filters is discussed in this paper.

microsmooth's People

Contributors

asheeshr avatar daanvanhasselt avatar ivankravets avatar poisa avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.