All Projects → tttapa → Filters

tttapa / Filters

Licence: GPL-3.0 license
An Arduino finite impulse response and infinite impulse response filter library.

Programming Languages

C++
36643 projects - #6 most used programming language
matlab
3953 projects
Makefile
30231 projects

Projects that are alternatives of or similar to Filters

dsp-theory
Theory of digital signal processing (DSP): signals, filtration (IIR, FIR, CIC, MAF), transforms (FFT, DFT, Hilbert, Z-transform) etc.
Stars: ✭ 643 (+1686.11%)
Mutual labels:  dsp, fir, finite-impulse-response
Ewma
Exponentially Weighted Moving Average Filter
Stars: ✭ 21 (-41.67%)
Mutual labels:  filter, arduino-library
iirj
An efficient IIR filter library written in JAVA
Stars: ✭ 95 (+163.89%)
Mutual labels:  filter, iir
SOUL-VA
The SOUL Virtual Analog Library
Stars: ✭ 45 (+25%)
Mutual labels:  dsp, filter
matchering-cli
🎚️ Simple Matchering 2.0 Command Line Application
Stars: ✭ 28 (-22.22%)
Mutual labels:  dsp, filter
math
Useful m-scripts for DSP (CIC, FIR, FFT, Fast convolution, Partial Filters etc.)
Stars: ✭ 15 (-58.33%)
Mutual labels:  dsp, fir
matchering-web
🎚️ Self-Hosted LANDR / eMastered Alternative
Stars: ✭ 25 (-30.56%)
Mutual labels:  dsp, filter
Sigmadsp
A versatile Arduino library for interfacing with the ADAU1701 audio DSP
Stars: ✭ 30 (-16.67%)
Mutual labels:  dsp, arduino-library
SI4844
Silicon Labs SI4844 (BROADCAST ANALOG TUNING DIGITAL DISPLAY AM/FM/SW RADIO RECEIVER) Library
Stars: ✭ 16 (-55.56%)
Mutual labels:  dsp, arduino-library
Audio-Digital-Processing
数字信号处理大作业:Matlab实现语音分析:加噪声,频谱分析,滤波器等等(内附报告)【Matlab for speech analysis: add noise, spectrum analysis, filter, etc】
Stars: ✭ 40 (+11.11%)
Mutual labels:  dsp, filter
Matchering
🎚️ Open Source Audio Matching and Mastering
Stars: ✭ 398 (+1005.56%)
Mutual labels:  dsp, filter
Dsp.jl
Filter design, periodograms, window functions, and other digital signal processing functionality
Stars: ✭ 226 (+527.78%)
Mutual labels:  dsp, filter
ArduBadge
ArduBadge gives you GitHub Badges for you Arduino Libraries. The badge shows the latest version available and custom installation instructions.
Stars: ✭ 24 (-33.33%)
Mutual labels:  arduino-library
DtBlkFx
Fast-Fourier-Transform (FFT) based VST plug-in
Stars: ✭ 99 (+175%)
Mutual labels:  dsp
WiFiEspAT
Arduino networking library. Standard Arduino WiFi networking API over ESP8266 or ESP32 AT commands.
Stars: ✭ 178 (+394.44%)
Mutual labels:  arduino-library
pyreports
pyreports is a python library that allows you to create complex report from various sources
Stars: ✭ 78 (+116.67%)
Mutual labels:  filter
esp-homekit-arduino-sdk
Arduino wrapper for ESP-IDF HomeKit library
Stars: ✭ 34 (-5.56%)
Mutual labels:  arduino-library
ZMPT101B-arduino
Arduino library for ZMPT101B voltage sensor.
Stars: ✭ 34 (-5.56%)
Mutual labels:  arduino-library
laminas-i18n
Provide translations for your application, and filter and validate internationalized values
Stars: ✭ 40 (+11.11%)
Mutual labels:  filter
spafe
🔉 spafe: Simplified Python Audio Features Extraction
Stars: ✭ 310 (+761.11%)
Mutual labels:  dsp

Filters

An Arduino finite impulse response and infinite impulse response filter library.

New, Improved Arduino-Filters library

I created a new repository with an updated and improved version of this library.
You can find it here: Arduino-Filters.

Digital filters

This library implements digital finite impulse response filters (FIR) and infinite impulse response filters (IIR). Double precision floating point arithmetic is used.

FIR

The difference equation for FIR filters is given by
FIR difference equation
To initialize it in code, you can use:

const double b_coefficients[] = { b_0, b_1, b_2, ... , b_N };
FIRFilter fir(b_coefficients);

IIR

The difference equation for IIR filters is given by
IIR difference equation

const double b_coefficients[] = { b_0, b_1, b_2, ... , b_P };
const double a_coefficients[] = { a_0, a_1, a_2, ... , a_Q };
IIRFilter iir(b_coefficients, a_coefficients);

BiQuad Filters

When dealing with high-order IIR filters, they can get unstable.
To prevent this, BiQuadratic filters (second order) are used.

Both Direct Form 1 and 2 are implemented.

const double b_coefficients[] = { b_0, b_1, b_2 };
const double a_coefficients[] = { a_0, a_1, a_2 };
BiQuadFilterDF1 biquad1(b_coefficients, a_coefficients);
BiQuadFilterDF2 biquad2(b_coefficients, a_coefficients);

Optionally, you can specify a gain:

const double b_coefficients[] = { b_0, b_1, b_2 };
const double a_coefficients[] = { a_0, a_1, a_2 };
const double gain = 1;
BiQuadFilterDF1 biquad1(b_coefficients, a_coefficients, gain);
BiQuadFilterDF2 biquad2(b_coefficients, a_coefficients, gain);

Second Order Sections

Instead of manually cascading BiQuad filters, you can use a Second Order Sections filter (SOS).

const double sosmatrix[][6] = {
    {b1_0, b1_1, b1_2,  a1_0, a1_1, a1_2 },
    {b2_0, b2_1, b2_2,  a2_0, a2_1, a2_2 }
};
const double gainarray[] = {1, 1};
SOSFilter<2> filter(sosmatrix, gainarray);

Here, <2> is the number of BiQuad filters in the SOS filter.

Cascades of filters

You can apply multiple filters together in a cascade:

Cascade<N> cascade({&filter1, &filter2, ..., &filterN});

Usage

The library provides a Filter interface with a filter method that takes the new (raw) value as an intput, and outputs the new (filtered) value.

double raw_value = getRawValue();
double filtered_value = fir.filter(raw_value);

You can use multiple filters on the input.

double filtered_value = fir.filter(iir.filter(raw_value));
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].