SableRaf / signalfilter

A signal filtering library for Processing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

A signal filtering library for Processing


Languages

Language:HTML 71.9%Language:Java 15.7%Language:Processing 8.0%Language:CSS 4.3%