This is: Active Noise Cancellation
Now for your Raspberry

This project is just proof-of-concept. Do not see it as complete daily-use application

Whole application is based on JUCE's DemoRunner application. This is because it is convienient to be able to change sound cards without changing the code. Also with this solition I could implement additions such as adaptive filter visualizer or FFT visualizer. To be able to reduct noise I used FxLMS algorithm. I based the algorithm on ARM CMSIS DSP functions but I need to modify them to work propelly.

Building application

Go to folder containing Makefile and run build

cd examples/DemoRunner/Build/LinuxMakefile make CONFIG=Release CXX=clang++

Dependencies

System Requirements

Building JUCE Projects

Required hardware

JUCE Dependencies under Linux

Install them by running

sudo apt-get install freeglut3-dev g++ libasound2-dev libcurl4-openssl-dev \ libfreetype6-dev libjack-jackd2-dev libx11-dev libxcomposite-dev \ libxcursor-dev libxinerama-dev libxrandr-dev mesa-common-dev \ webkit2gtk-4.0

Clang compiler

sudo apt-get install clang

LADSPA Plugins installed

To get rid of DC offset from microphones
Note: If you don't have any DC offset you don't need to do that

apt-get install ladspa-sdk

Then create a /etc/asound.conf file containing the following

pcm.plughp { type ladspa slave.pcm "plughw:X" path "/usr/lib/ladspa" capture_plugins [ { label hpf id 1042 input { contols [ 60 ] } } { label amp_mono id 1048 input { controls [ 30 ] } } ] } pcm.hp { type plug slave.pcm plughp }

Where plughw:X is your sound card containing microphones inputs. You can check it by running

arecord -l

Check of low latency capabilities - Realtime config quick scan

git clone git://github.com/raboof/realtimeconfigquickscan.git cd realtimeconfigquickscan perl ./realTimeConfigQuickScan.pl

Results

Application GUI

UML Diagram

Street noise

Metro noise

Cafe noise

Sine tone