Skip to content
Biquad filter functions for OpenFrameworks
C++ Objective-C
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This openFrameworks addon implements a biquad filter. Use it when you need to filter a value over time. You can set it to filter out high frequancy noise (lowpass filter), this could for example be fast mouse movements, or other noisy data. Or you can use it as a highpassfilter that only will let fast movements through, this could for example be used to detect abrupt changes in a value.


For normal use, the only value that you need to change is the fc value. This describes the cutoff frequency, where 1 is the rate you supply new values. So for example, if you supply values 60 times a second (60 fps), then a fc value of 0.5 means the filter will cut off 30hz.

The addon comes with filters that supports both 1d, 2d 3d and 4d vectors, and it can also work of ofFloatColors. The types are

  • ofxBiquadFilter1f
  • ofxBiquadFilter2f
  • ofxBiquadFilter3f
  • ofxBiquadFilter4f
  • ofxBiquadFilterColor

The type of the filter can be set with the command .setType(ofxBiquadFilterType type). The most commonly used filter types are the OFX_BIQUAD_TYPE_LOWPASS (default) and OFX_BIQUAD_TYPE_HIGHPASS, but there are other types of filters defined.

Call update(..) with the new input value to update the filter, and get the filtered value by calling value().


in the header:

ofxBiquadFilter2f filter;

in the cpp:

void setup(){
  // Sets the cutoff frequency to 1/10 of the framerate
  // Lowering this value will make the circle move slower

void update(){
  //Update the filter

void draw(){
  ofCircle(filter.value().x, filter.value().y);

Interactive tool

You can use this tool to visualize the biquad filters and it's values:

Created by Jonas Jongejan and DZL

You can’t perform that action at this time.