All Projects → psykulsk → RpiANC

psykulsk / RpiANC

Licence: other
Active Noise Control on Raspberry Pi

Programming Languages

C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language
matlab
3953 projects
CMake
9771 projects
shell
77523 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to RpiANC

DTMF-Decoder
A Java program to implement a DMTF Decoder.
Stars: ✭ 28 (-42.86%)
Mutual labels:  signal-processing, dsp, digital-signal-processing
RTspice
A real-time netlist based audio circuit plugin
Stars: ✭ 51 (+4.08%)
Mutual labels:  signal-processing, dsp, digital-signal-processing
Audio Signal Processing
Audio or speech signal processing guide.
Stars: ✭ 45 (-8.16%)
Mutual labels:  signal-processing, digital-signal-processing
signals-and-systems
Interactive visualizations for Dr. Richard Baraniuk's open-source "Signals and Systems" textbook. R / Shiny.
Stars: ✭ 31 (-36.73%)
Mutual labels:  dsp, digital-signal-processing
juceSynths
Collection of JUCE synthesisers utilising the Maximilian library.
Stars: ✭ 78 (+59.18%)
Mutual labels:  signal-processing, dsp
YoloV3-ncnn-Raspberry-Pi-4
MobileNetV2_YOLOV3 for ncnn framework
Stars: ✭ 20 (-59.18%)
Mutual labels:  raspberry, raspberry-pi-3
motor-hat
Node Module to control Adafruits MotorHAT for the RaspberryPi
Stars: ✭ 28 (-42.86%)
Mutual labels:  raspberry, raspberry-pi-3
pedalevite
Pédale Vite — DIY multi-FX pedalboard for guitar/bass/etc.
Stars: ✭ 68 (+38.78%)
Mutual labels:  dsp, raspberry-pi-3
gitlab-runner
GitLab Runner (Docker image) for ARM devices, this is a mirror repository of
Stars: ✭ 17 (-65.31%)
Mutual labels:  raspberry, raspberry-pi-3
signalo
A DSP toolbox with focus on embedded environments written in Rust.
Stars: ✭ 71 (+44.9%)
Mutual labels:  dsp, digital-signal-processing
DAFx19-Gamelanizer
Accompanying material for the paper 'A Real-Time Audio Effect Plug-In Inspired by the Processes of Traditional Indonesian Gamelan Music'
Stars: ✭ 33 (-32.65%)
Mutual labels:  dsp, digital-signal-processing
dsp.rs
Digital Signal Processing
Stars: ✭ 60 (+22.45%)
Mutual labels:  dsp, digital-signal-processing
python-soxr
Fast and high quality sample-rate conversion library for Python
Stars: ✭ 25 (-48.98%)
Mutual labels:  signal-processing, dsp
dsp-theory
Theory of digital signal processing (DSP): signals, filtration (IIR, FIR, CIC, MAF), transforms (FFT, DFT, Hilbert, Z-transform) etc.
Stars: ✭ 643 (+1212.24%)
Mutual labels:  dsp, digital-signal-processing
dsp-kit
A digital signal processing library in Javascript
Stars: ✭ 32 (-34.69%)
Mutual labels:  dsp, digital-signal-processing
RPi-TELEBOT
Python based Telegram bot to monitor and control the raspberry pi
Stars: ✭ 19 (-61.22%)
Mutual labels:  raspberry, raspberry-pi-3
dsp-collection-java
A collection of Java classes for Digital Signal Processing
Stars: ✭ 41 (-16.33%)
Mutual labels:  signal-processing, dsp
dsp
Header only C++14 library containing various digital signal processing utilities.
Stars: ✭ 30 (-38.78%)
Mutual labels:  dsp, digital-signal-processing
Planeverb
Project Planeverb is a CPU based real-time wave-based acoustics engine for games. It comes with an integration with the Unity Engine.
Stars: ✭ 22 (-55.1%)
Mutual labels:  dsp, digital-signal-processing
math
Useful m-scripts for DSP (CIC, FIR, FFT, Fast convolution, Partial Filters etc.)
Stars: ✭ 15 (-69.39%)
Mutual labels:  dsp, digital-signal-processing

RpiANC

Implementation of Active Noise Control Algorithms for Raspberry Pi.

This is the accompanying code to the publication 'Adaptive Active Noise Cancelling System for Headphones on Raspberry Pi Platform' that has been presented at the Signal Processing Workshop 2020 conference https://mrweek.org/spw/

Link to the article: https://ieeexplore.ieee.org/document/9259141

Used hardware

Assembled system

System schematic

Build and run commands

Example:

mkdir build && cd build
cmake ../ && make all

Main binary that does feedforward active noise control:

./ffANC

Simple tests that show how LMS and FxLMS attenuate simulated noise on matplotlib plots:

./lmstest
./fxlmstest

Build dependencies

Builds tested on Ubuntu 18.04 and Raspbian distributions:

Cmake >= 3.7
Alsa library, so packages like: libasound2, libasound2-dev.
Python2.7 libraries (matplotlibcpp dependency) so packages like: python-dev
OpenMP directives (propably supported by your compiler)

Repository and code structure

Cmake and make commands build a few binaries. The main one, is the ffANC binary that executes tha main function from the feedforward_anc.cpp file. Inside this file you can define or remove the DEPLOYED_ON_RPI macro to change devices used for capture and playback. Define CAP_MEASUREMENTS macro to capture sample values and save them to files.

The main function of the ffANC target executes a specified number of loop iterations. During each iteration 3 main operations: capture of new samples, sample processing and playback of the calculated samples, are executed concurrently, in a fork-join model. Firstly, each of the 3 operations is executed in a separate thread. Then, output samples from each operation are exchanged. Most recently calculated output samples are moved to the input array of the playback function and newly captured samples are moved to the input array of the signal processing function.

In constants.h file, you can find the names of devices used on Raspberry Pi and other constants used in signal processing.

All signal processing is in the header files under the Headers and the processing.cpp source file.

Scripts directory contains python and bash scripts that automate measurements, gathering data, deploying code etc.

Results

Comparison of attenuation of a noise signal of a constant frequency between the created ANC system and Sennheiser HR 4.50 BTNC headphones.

Attenuation comparison

Disclaimer: this implementation worked on a specific hardware setup and attenuated a specific (constant frequency) type of noise. It is not guaranteed that it will work out of the box on a different setup. I've published the code on github so that when someone else is going to try to implement something similar this codebase can be used as a starting point or an inspiration.

Useful links, articles, etc.

Included third-party libraries

This software uses matplotlibcpp - see matplotlibcpp-license.txt

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