Giter Club home page Giter Club logo

arduino-filters's Introduction

Build Status Test Coverage GitHub

Arduino Filters

Features

  • Infinite Impulse Response Filters
  • Finite Impulse Response Filters
  • BiQuad Filters
  • Butterworth Filters
  • Notch Filters
  • Median Filters
  • Simple and Exponential Moving Average Filters
  • Hysteresis

These filters were originally part of the old Filters library.
It has been updated completely, with continuous integration, unit tests, etc.

Documentation

The automatically generated Doxygen documentation for this library can be found here:
Documentation
Test coverage information can be found here:
Code Coverage
Arduino examples can be found here:
Examples

You might want to start with the Filters Module.

Example: Butterworth filter

#include <Filters.h>

#include <AH/Timing/MillisMicrosTimer.hpp>
#include <Filters/Butterworth.hpp>

void setup() {
  Serial.begin(115200);
}

// Sampling frequency
const double f_s = 100; // Hz
// Cut-off frequency (-3 dB)
const double f_c = 40; // Hz
// Normalized cut-off frequency
const double f_n = 2 * f_c / f_s;

// Sample timer
Timer<micros> timer = std::round(1e6 / f_s);

// Sixth-order Butterworth filter
auto filter = butter<6>(f_n);

void loop() {
  if (timer)
    Serial.println(filter(analogRead(A0)));
}

Tools

The python folder contains some Python scripts to visualize the frequency response of the filters used in the examples.

Butterworth Filter

Butterworth.ino

FIR Notch Filter

FIRNotch.ino

Related Projects

This library uses the Arduino Helpers utility library

Supported boards

For each commit, the continuous integration tests compile the examples for the following boards:

  • Arduino UNO
  • Arduino Mega
  • Arduino Leonardo
  • Teensy 3.2
  • Teensy 4.1
  • Arduino Due
  • Arduino Nano 33 IoT
  • Arduino Nano 33 BLE
  • Arduino Nano Every
  • ESP8266
  • ESP32

This covers a very large part of the Arduino platform, and similar boards will also work (e.g. Arduino Nano, Arduino Mega, etc.).

If you have a board that's not supported, please open an issue and let me know!

Known limitations

The Arduino Due toolchain provided by Arduino is very old, and has some configuration problems. As a result, some math functions are not available.
There is nothing I can do about it in this library, it's a bug in the Arduino Due Core.

arduino-filters's People

Contributors

tttapa avatar

Watchers

 avatar  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.