Signal Filter is a Processing library for noisy signal filtering. It provides a convenient way to get rid of the noise in raw signals (like blob tracking coordinates for example).
Signal Filter is built upon the OneEuroFilter by Géry Casiez. It uses the Java implementation by Stéphane Conversy.
Note: Signal Filter is considered beta and should not be used for production. The API is not final (some features and function names may change slightly). Please report bugs and submit feature requests on the issues page.
“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]
The library provides different 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 version of the 1€ filter by Jonathan Aceituno.
Unzip and put the extracted SignalFilter folder into the libraries folder of your Processing sketch folder. Reference and examples are included in the SignalFilter folder.
Import the library, create your filter, and apply it to your signal. Easy! Optionnally, you can get more control over the parameters (recommended). Look at 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);
}
System:
- OSX
- Windows
Signal Filter should theoretically work on Linux too, if you try it, please let me know.
Processing Version:
- 2.0.1
- 2.0
- 2.0b9
- 2.0b8
- 2.0b7
- 1.5.1
None.
Wanna chat? Ping me on Twitter. For bug reports, please use the issues page.
- The library is Open Source Software released under the GNU General Public License. It is developed and maintained by Raphaël de Courville.
This README file was last updated on 2013-07-24 by Raphaël de Courville.