In this project, Filtered-X Least Mean Square (FxLMS) algorithm is implemented in Teensy 3.6 microcontroller to reduce unwanted noise using a 20W speaker and MEMS microphone.
This feedback active noise cancelling system is based on FxLMS algorithm. Since only the feedback signal is picked up, the feedback system is mostly effective in cancelling narrow-band signals.
Figure 1: Physical Feedback System
Figure 2: Feedback System based on FxLMS
In the feedback system, there is only error sensor(microphone) and a secondary source(speaker). The difference between the detected and predicted error is then feed into the system to update the filter weights.
The microcontroller used in this project is Teensy 3.6, a complete USB-based microcontroller development system by PJRC. With a 32 bit MHz ARM Cortex-M4 processor which comes with a floating point unit, it allows faster floating point computation.
Figure 3: Teensy 3.6 Pinout
Audio amplifier: Adafruit 20W MAX9744 is selected for this project.
Microphone: SparkFun MEMS Microphone Breakout – INMP401
The code is written using Arduino IDE with Teensyduino. In the code, ARM math library is used to decrease the time used for floating point matrix calculation. DMA channel is also utilized in the code to achieve higher sampling frequency.
The secondary path file is first run to determine the secondary path coefficients offline. After acquiring the secondary path coefficients, they are then pasted into the main ANC file. With the acoustic path coefficients determined offline, the main file can now be run to reduce noise.
Figures 1,2 are from paper by Edgar Lopez-Caudana
Feedback FxLMS MATLAB code by Augustinus Oey