Giter Site home page Giter Site logo

signalfilter's Introduction

Signal Filter

The Signal Filter Processing library is a simple way to turn noisy raw data–such as a tracker's position or your microphone volume for example–into a signal that changes smoothly over time.

Signal Filter is built upon the OneEuroFilter by Géry Casiez which is a lightweight alternative to common filtering algorithms. Signal Filter wraps the Java implementation of the 1€ filter by Stéphane Conversy.

Please report bugs and submit feature requests on the issues page.

About

“The 1€ filter (“one Euro filter”) is a simple algorithm to filter noisy signals for high precision and responsiveness. It uses a first order low-pass filter with an adaptive cutoff frequency: at low speeds, a low cutoff stabilizes the signal by reducing jitter, but as speed increases, the cutoff is increased to reduce lag.” [Casiez 2012]

This library provides convenience functions to deal with the most common scenarios: single signal, coordinates (as PVector or individual floats), multiple channels. Look at the examples and the documentation for more information.

To learn more about the 1€ Filter algorithm, read the CHI 2012 paper (PDF) by Géry Casiez.

You can also try the online demo of the 1€ filter for a comparison with other filters.

Installation (PDE)

To install the Signal Filter library in the Processing Development Environment, go to tools > Manage Tools... and find the Libraries tab. Search for "Signal Filter" and click install.

Usage

Import the library, create your filter, and apply it to your signal. You can get more control over the parameters (look at comments in the examples for instructions).

// Add the library to the sketch
import signal.library.*;

// -----------------------------------------------------
// Create the filter
   SignalFilter myFilter;
// -----------------------------------------------------

// Variables for the dummy & filtered signal
float sourceSignal;
float noisySignal;
float filteredSignal;

void setup() {

  // -----------------------------------------------------
  // Initialize the filter
     myFilter = new SignalFilter(this);
  // -----------------------------------------------------

}

void draw()
{

  // Generate a dummy signal
  sourceSignal = sin(frameCount / 1000.0);

  // Add random noise to our dummy signal
  noisySignal = sourceSignal + random(-0.05, 0.05);

  // -----------------------------------------------------
  // Filter the signal
     filteredSignal = myFilter.filterUnitFloat( noisySignal );
  // -----------------------------------------------------

  // Display the results in the console
  println("");
  println("Source   = " + sourceSignal);
  println("Noisy    = " + noisySignal);
  println("Filtered = " + filteredSignal);

}

Examples

After installing the Signal Filter library, you will find the following examples in File > Examples... > Contributed Libraries > Signal Filter

Snapshots

Snapshots

Snapshots

Tested

Processing Versions:

  • 4.0.1
  • 3.5.3
  • 3.4
  • 2.0.1
  • 2.0
  • 2.0b9
  • 2.0b8
  • 2.0b7
  • 1.5.1

Dependencies

None.

Questions?

Wanna chat? Ping me on Twitter. For bug reports, please use the issues page.

License

This README file was last updated on 2020-11-26

signalfilter's People

Contributors

sableraf avatar casiez avatar hamoid 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.