Code Monkey home page Code Monkey logo

rpianc's Introduction

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

rpianc's People

Contributors

psykulsk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

rpianc's Issues

offline secondary_path_identification issue

Thanks for your sharing about ANC and I have a question.

In Mains/offline_sec_path_modelling.cpp
—————————————————————————————————————————————————-
secondary_path_identification(processing_buffer.data(), reference_generated_for_processing.data(),
BUFFER_SAMPLE_SIZE, secondary_path_estimation_filter);

void secondary_path_identification(fixed_sample_type *samples_buffer, fixed_sample_type *ref_for_processing, long unsigned int buffer_length,
LMSFilter<FX_FILTER_LENGTH> &sec_path_estimation_filter){
for (unsigned long i = 1; i < buffer_length; i += 2) {
sample_type error_sample = signed_fixed_to_floating(samples_buffer[i]);
sample_type reference_sample =signed_fixed_to_floating(ref_for_processing[i - 1]);
sec_path_estimation_filter.lms_step(reference_sample, error_sample, reference_sample);
}
}
—————————————————————————————————————————————————-

reference_generated_for_processing is the white noise playback signal, processing_buffer is the error mic signal. I think LMS should not use error mic data as error_sample. The error_sample should be ‘d(n)(error mic data)-y(n)(filter data)’ .

Scripts/OctaveCode/lms1.m
—————————————————————————————————————————————————-
y(n) = f_n.'x_n;
e(n) = d(n) - y(n);
f_n = f_n + alpha
e(n)*x_n;
—————————————————————————————————————————————————-

Look forword for your reply.

raspberry pi xrun issue

Hello, thank you very much for your work. After compiling on the Raspberry Pi, I found that there would be a problem with xrun. At first I thought it was a problem with the capture playback or buffer setting, but this problem still occurred after I adjusted it to a small value. Later, I checked the cpu when it was running, and found that the cpu would reach 130% when it was running, which seemed to be overloaded. I wonder if it is a multi-threaded setting. Looking forward for your response, thank you!
Here is error and cpu info:
image

installation

hello, a friend of mine wants to use this to do more research on active noise control, she downloaded the repository to her pi but does not know how to install/run your program, can you help?

performance issue on Raspberry 3A+ or 4B, "capture overrun occurred" and "playback underrun occurred" printed

As a newcomer to noise cancellation, I've encountered some issues while using your impressive project. Specifically, I've noticed frequent occurrences of "capture overrun" and "playback underrun" messages during processing.

I understand that it has been some time since you completed this project, but I am still hopeful for your kindly help.

Following is my environment setup:

  • Raspberry Pi 3A+ (and also Raspberry Pi 4B 2GB)
  • OS: raspbian-2020-02-14, latest distribution since the old distributions were out of maintenace
  • 2 * I2S micrphones, same model and wire connected, installed driver version: 1:2.20.1
  • CMake: 3.16.3
  • libasound2 and libasound2-dev are installed, version: 1.1.8-1+rpt2
  • test app: ffANC

The first issue I met is the minimum period size of device is much larger than the value in constants.h, the log shows:

pi@raspberrypi:~/works/RpiANC/build $ ./ffANC
Capture params: Capture rate: 44100 Period size: 32 Min period size: 32
Playback params: Playback rate: 44100 Period size: 444 Play min period size: 443 Buffer size: 4096
access type = RW_INTERLEAVED
subformat = 'STD' (Standard)
channels = 2
rate = 44100 bps
period time = 10068 us
period size = 444 frames
period size = 3552 bytes
buffer time = 10068 us
buffer size = 4096 frames
periods per buffer = 9 frames
 min period size = 444 frames
 min buffer size = 4096 frames
exact rate = 44101/1 bps
significant bits = 32
is batch = 0
is block transfer = 1
is double = 0
is half duplex = 0
is joint duplex = 0
can overrange = 0
can mmap = 0
can pause = 0
can resume = 0
can sync start = 0
Number of play frames per period ( 444 ) then configuration ( 32 )

It passes after I modified the value to 444 on both capture and playback, but I don't know if this modification is correct.

The second issue is the debug message prints frequently, it seems reporting the performance down:

pi@raspberrypi:~/works/RpiANC/build $ ./ffANC
Capture params: Capture rate: 44100 Period size: 444 Min period size: 32
Playback params: Playback rate: 44101 Period size: 444 Play min period size: 443 Buffer size: 31080
access type = RW_INTERLEAVED
subformat = 'STD' (Standard)
channels = 2
rate = 44101 bps
period time = 10068 us
period size = 444 frames
period size = 3552 bytes
buffer time = 10068 us
buffer size = 31080 frames
periods per buffer = 69 frames
 min period size = 444 frames
 min buffer size = 31080 frames
exact rate = 44101/1 bps
significant bits = 32
is batch = 0
is block transfer = 1
is double = 0
is half duplex = 0
is joint duplex = 0
can overrange = 0
can mmap = 0
can pause = 0
can resume = 0
can sync start = 0
playback underrun occurred
playback underrun occurred
playback underrun occurred
playback underrun occurred
capture overrun occurred
playback underrun occurred
playback underrun occurred
playback underrun occurred
playback underrun occurred
capture overrun occurred
playback underrun occurred
playback underrun occurred
playback underrun occurred
playback underrun occurred
playback underrun occurred
capture overrun occurred
playback underrun occurred

repeating...

playback underrun occurred
Cap time
Average: 8650.68
proc time
Average: 58917.6
play time
Average: 390.66
total time
Average: 63423.4
ffANC: /home/pi/works/RpiANC/Sources/common.cpp:22: void save_vector_to_file(const string&, const std::vector<long int>&): Assertion `file.is_open()' failed.
Aborted

During processing, htop shows two cores are about 60% to 80% usage, another two are in low usage. (seems OpenMP works fine).

And the log shows the processing time is much more than required: 58.9ms vs. 10ms(444 samples in 44.1Khz)

I would greatly appreciate your help in resolving these issues. Thank you!

Playback underruns and capture overruns

Hi psykulsk,

Thank you for your build! I was trying to implement your build in an Raspberry Pi 4B+ to try my hands on the RPi ANC for the 64bit Raspberry Pi OS (w Desktop). I can successfully build this on the Pi 4B+. While trying to run ./ffANC in the build directory, I am getting playback underruns and capture overruns on my playback/capture device. Is there a way around this?

Excuse me, how to adjust my parameters

pi@raspberrypi:~/RpiANC-master/build $ ./ffANC
xcb_connection_has_error() returned true
Capture params: Capture rate: 44100 Period size: 32 Min period size: 32
Playback params: Playback rate: 44101 Period size: 444 Play min period size: 443 Buffer size: 32768
access type = RW_INTERLEAVED
subformat = 'STD' (Standard)
channels = 2
rate = 44101 bps
period time = 10068 us
period size = 444 frames
period size = 3552 bytes
buffer time = 10068 us
buffer size = 32768 frames
periods per buffer = 73 frames
min period size = 444 frames
min buffer size = 32768 frames
exact rate = 44101/1 bps
significant bits = 32
is batch = 1
is block transfer = 1
is double = 0
is half duplex = 0
is joint duplex = 0
can overrange = 0
can mmap = 0
can pause = 0
can resume = 0
can sync start = 0
Number of play frames per device buffer( 32768 ) then configuration ( 32856 )

Link error inquire

Hi, sir,

I downloaded your code and tried to construct the project. But some errors appeared as following, seems that there are problems in linking with the python lib. So will you please give me some instructions to solve the problem? Thank you!

pi@raspberrypi:/RpiANC $ make
[ 1%] Linking CXX executable fxlmstest
/usr/bin/ld: CMakeFiles/fxlmstest.dir/Mains/fxlmstest.cpp.o: in function matplotlibcpp::detail::_interpreter::_interpreter()': fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x2c): undefined reference to Py_SetProgramName'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x30): undefined reference to Py_Initialize' /usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x38): undefined reference to PyString_FromString'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x48): undefined reference to PyString_FromString' /usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x58): undefined reference to PyString_FromString'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0xbc): undefined reference to PyImport_Import' /usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x178): undefined reference to PyObject_CallMethod'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x184): undefined reference to PyImport_Import' /usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x214): undefined reference to PyImport_Import'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x2a4): undefined reference to PyObject_GetAttrString' /usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x2bc): undefined reference to PyObject_GetAttrString'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x2d4): undefined reference to PyObject_GetAttrString' /usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x2ec): undefined reference to PyObject_GetAttrString'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x304): undefined reference to PyObject_GetAttrString' /usr/bin/ld: CMakeFiles/fxlmstest.dir/Mains/fxlmstest.cpp.o:fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x31c): more undefined references to PyObject_GetAttrString' follow
/usr/bin/ld: CMakeFiles/fxlmstest.dir/Mains/fxlmstest.cpp.o: in function matplotlibcpp::detail::_interpreter::_interpreter()': fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0x9e0): undefined reference to PyTuple_New'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterC2Ev[_ZN13matplotlibcpp6detail12_interpreterC5Ev]+0xaf4): undefined reference to PyFunction_Type' /usr/bin/ld: CMakeFiles/fxlmstest.dir/Mains/fxlmstest.cpp.o: in function matplotlibcpp::detail::_interpreter::
_interpreter()':
fxlmstest.cpp:(.text._ZN13matplotlibcpp6detail12_interpreterD2Ev[_ZN13matplotlibcpp6detail12_interpreterD5Ev]+0x10): undefined reference to Py_Finalize' /usr/bin/ld: CMakeFiles/fxlmstest.dir/Mains/fxlmstest.cpp.o: in function matplotlibcpp::subplot(long, long, long)':
fxlmstest.cpp:(.text._ZN13matplotlibcpp7subplotElll[_ZN13matplotlibcpp7subplotElll]+0x1c): undefined reference to PyTuple_New' /usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp7subplotElll[_ZN13matplotlibcpp7subplotElll]+0x3c): undefined reference to PyFloat_FromDouble'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp7subplotElll[_ZN13matplotlibcpp7subplotElll]+0x50): undefined reference to PyTuple_SetItem' /usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp7subplotElll[_ZN13matplotlibcpp7subplotElll]+0x68): undefined reference to PyFloat_FromDouble'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp7subplotElll[_ZN13matplotlibcpp7subplotElll]+0x7c): undefined reference to PyTuple_SetItem' /usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp7subplotElll[_ZN13matplotlibcpp7subplotElll]+0x94): undefined reference to PyFloat_FromDouble'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp7subplotElll[_ZN13matplotlibcpp7subplotElll]+0xa8): undefined reference to PyTuple_SetItem' /usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp7subplotElll[_ZN13matplotlibcpp7subplotElll]+0xc4): undefined reference to PyObject_CallObject'
/usr/bin/ld: CMakeFiles/fxlmstest.dir/Mains/fxlmstest.cpp.o: in function matplotlibcpp::title(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': fxlmstest.cpp:(.text._ZN13matplotlibcpp5titleERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp5titleERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x20): undefined reference to PyString_FromString'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp5titleERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp5titleERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x30): undefined reference to PyTuple_New' /usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp5titleERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp5titleERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x4c): undefined reference to PyTuple_SetItem'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp5titleERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp5titleERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x68): undefined reference to PyObject_CallObject' /usr/bin/ld: CMakeFiles/fxlmstest.dir/Mains/fxlmstest.cpp.o: in function matplotlibcpp::show(bool)':
fxlmstest.cpp:(.text._ZN13matplotlibcpp4showEb[_ZN13matplotlibcpp4showEb]+0x40): undefined reference to PyObject_CallObject' /usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp4showEb[_ZN13matplotlibcpp4showEb]+0x50): undefined reference to PyDict_New'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp4showEb[_ZN13matplotlibcpp4showEb]+0x6c): undefined reference to PyDict_SetItemString' /usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp4showEb[_ZN13matplotlibcpp4showEb]+0x94): undefined reference to PyObject_Call'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp4showEb[_ZN13matplotlibcpp4showEb]+0x17c): undefined reference to _Py_ZeroStruct' /usr/bin/ld: CMakeFiles/fxlmstest.dir/Mains/fxlmstest.cpp.o: in function bool matplotlibcpp::semilogy<float, float>(std::vector<float, std::allocator > const&, std::vector<float, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)':
fxlmstest.cpp:(.text._ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x7c): undefined reference to PyString_FromString' /usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x8c): undefined reference to PyTuple_New'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0xa8): undefined reference to PyTuple_SetItem' /usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0xbc): undefined reference to PyTuple_SetItem'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0xd0): undefined reference to PyTuple_SetItem' /usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp8semilogyIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0xec): undefined reference to PyObject_CallObject'
/usr/bin/ld: CMakeFiles/fxlmstest.dir/Mains/fxlmstest.cpp.o: in function bool matplotlibcpp::plot<float, float>(std::vector<float, std::allocator<float> > const&, std::vector<float, std::allocator<float> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': fxlmstest.cpp:(.text._ZN13matplotlibcpp4plotIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp4plotIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x7c): undefined reference to PyString_FromString'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp4plotIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp4plotIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x8c): undefined reference to PyTuple_New' /usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp4plotIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp4plotIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0xa8): undefined reference to PyTuple_SetItem'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp4plotIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp4plotIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0xbc): undefined reference to PyTuple_SetItem' /usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp4plotIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp4plotIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0xd0): undefined reference to PyTuple_SetItem'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp4plotIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp4plotIffEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0xec): undefined reference to PyObject_CallObject' /usr/bin/ld: CMakeFiles/fxlmstest.dir/Mains/fxlmstest.cpp.o: in function _object* matplotlibcpp::get_array(std::vector<float, std::allocator > const&)':
fxlmstest.cpp:(.text._ZN13matplotlibcpp9get_arrayIfEEP7_objectRKSt6vectorIT_SaIS4_EE[_ZN13matplotlibcpp9get_arrayIfEEP7_objectRKSt6vectorIT_SaIS4_EE]+0x20): undefined reference to PyList_New' /usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp9get_arrayIfEEP7_objectRKSt6vectorIT_SaIS4_EE[_ZN13matplotlibcpp9get_arrayIfEEP7_objectRKSt6vectorIT_SaIS4_EE]+0x7c): undefined reference to PyFloat_FromDouble'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp9get_arrayIfEEP7_objectRKSt6vectorIT_SaIS4_EE[_ZN13matplotlibcpp9get_arrayIfEEP7_objectRKSt6vectorIT_SaIS4_EE]+0x90): undefined reference to PyList_SetItem' /usr/bin/ld: CMakeFiles/fxlmstest.dir/Mains/fxlmstest.cpp.o: in function bool matplotlibcpp::plot<int, int>(std::vector<int, std::allocator > const&, std::vector<int, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)':
fxlmstest.cpp:(.text._ZN13matplotlibcpp4plotIiiEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp4plotIiiEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x7c): undefined reference to PyString_FromString' /usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp4plotIiiEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp4plotIiiEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x8c): undefined reference to PyTuple_New'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp4plotIiiEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp4plotIiiEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0xa8): undefined reference to PyTuple_SetItem' /usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp4plotIiiEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp4plotIiiEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0xbc): undefined reference to PyTuple_SetItem'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp4plotIiiEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp4plotIiiEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0xd0): undefined reference to PyTuple_SetItem' /usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp4plotIiiEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN13matplotlibcpp4plotIiiEEbRKSt6vectorIT_SaIS2_EERKS1_IT0_SaIS7_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0xec): undefined reference to PyObject_CallObject'
/usr/bin/ld: CMakeFiles/fxlmstest.dir/Mains/fxlmstest.cpp.o: in function _object* matplotlibcpp::get_array<int>(std::vector<int, std::allocator<int> > const&)': fxlmstest.cpp:(.text._ZN13matplotlibcpp9get_arrayIiEEP7_objectRKSt6vectorIT_SaIS4_EE[_ZN13matplotlibcpp9get_arrayIiEEP7_objectRKSt6vectorIT_SaIS4_EE]+0x20): undefined reference to PyList_New'
/usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp9get_arrayIiEEP7_objectRKSt6vectorIT_SaIS4_EE[_ZN13matplotlibcpp9get_arrayIiEEP7_objectRKSt6vectorIT_SaIS4_EE]+0x80): undefined reference to PyFloat_FromDouble' /usr/bin/ld: fxlmstest.cpp:(.text._ZN13matplotlibcpp9get_arrayIiEEP7_objectRKSt6vectorIT_SaIS4_EE[_ZN13matplotlibcpp9get_arrayIiEEP7_objectRKSt6vectorIT_SaIS4_EE]+0x94): undefined reference to PyList_SetItem'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/fxlmstest.dir/build.make:178: fxlmstest] Error 1
make[1]: *** [CMakeFiles/Makefile2:109: CMakeFiles/fxlmstest.dir/all] Error 2
make: *** [Makefile:103: all] Error 2

Here is the info about python2.7 in my raspberry:
pi@raspberrypi:/usr $ ls /usr/lib/python2.7
_abcoll.py cgi.pyc dbhash.py future.py io.pyc multifile.py platform.py rfc822.py sre_compile.py tabnanny.pyc UserList.py
_abcoll.pyc cgitb.py dbhash.pyc future.pyc json multifile.pyc platform.pyc rfc822.pyc sre_compile.pyc tarfile.py UserList.pyc
abc.py cgitb.pyc decimal.py genericpath.py keyword.py multiprocessing plistlib.py rlcompleter.py sre_constants.py tarfile.pyc user.py
abc.pyc chunk.py decimal.pyc genericpath.pyc keyword.pyc mutex.py plistlib.pyc rlcompleter.pyc sre_constants.pyc telnetlib.py user.pyc
aifc.py chunk.pyc difflib.py getopt.py lib2to3 mutex.pyc popen2.py robotparser.py sre_parse.py telnetlib.pyc UserString.py
aifc.pyc cmd.py difflib.pyc getopt.pyc lib-dynload netrc.py popen2.pyc robotparser.pyc sre_parse.pyc tempfile.py UserString.pyc
antigravity.py cmd.pyc dircache.py getpass.py lib-tk netrc.pyc poplib.py runpy.py sre.py tempfile.pyc uuid.py
antigravity.pyc codecs.py dircache.pyc getpass.pyc LICENSE.txt new.py poplib.pyc runpy.pyc sre.pyc test uuid.pyc
anydbm.py codecs.pyc dis.py gettext.py linecache.py new.pyc posixfile.py sched.py ssl.py textwrap.py uu.py
anydbm.pyc codeop.py dis.pyc gettext.pyc linecache.pyc nntplib.py posixfile.pyc sched.pyc ssl.pyc textwrap.pyc uu.pyc
argparse.egg-info codeop.pyc dist-packages glob.py locale.py nntplib.pyc posixpath.py sets.py stat.py this.py warnings.py
argparse.py code.py distutils glob.pyc locale.pyc ntpath.py posixpath.pyc sets.pyc stat.pyc this.pyc warnings.pyc
argparse.pyc code.pyc doctest.py gzip.py logging ntpath.pyc pprint.py sgmllib.py statvfs.py _threading_local.py wave.py
ast.py collections.py doctest.pyc gzip.pyc _LWPCookieJar.py nturl2path.py pprint.pyc sgmllib.pyc statvfs.pyc _threading_local.pyc wave.pyc
ast.pyc collections.pyc DocXMLRPCServer.py hashlib.py _LWPCookieJar.pyc nturl2path.pyc profile.py sha.py StringIO.py threading.py weakref.py
asynchat.py colorsys.py DocXMLRPCServer.pyc hashlib.pyc macpath.py numbers.py profile.pyc sha.pyc StringIO.pyc threading.pyc weakref.pyc
asynchat.pyc colorsys.pyc dumbdbm.py heapq.py macpath.pyc numbers.pyc pstats.py shelve.py stringold.py timeit.py _weakrefset.py
asyncore.py commands.py dumbdbm.pyc heapq.pyc macurl2path.py opcode.py pstats.pyc shelve.pyc stringold.pyc timeit.pyc _weakrefset.pyc
asyncore.pyc commands.pyc dummy_threading.py hmac.py macurl2path.pyc opcode.pyc pty.py shlex.py stringprep.py toaiff.py webbrowser.py
atexit.py compileall.py dummy_threading.pyc hmac.pyc mailbox.py optparse.py pty.pyc shlex.pyc stringprep.pyc toaiff.pyc webbrowser.pyc
atexit.pyc compileall.pyc dummy_thread.py hotshot mailbox.pyc optparse.pyc pyclbr.py shutil.py string.py tokenize.py whichdb.py
audiodev.py compiler dummy_thread.pyc htmlentitydefs.py mailcap.py os2emxpath.py pyclbr.pyc shutil.pyc string.pyc tokenize.pyc whichdb.pyc
audiodev.pyc config-arm-linux-gnueabihf email htmlentitydefs.pyc mailcap.pyc os2emxpath.pyc py_compile.py SimpleHTTPServer.py _strptime.py token.py wsgiref
base64.py ConfigParser.py encodings htmllib.py markupbase.py os.py py_compile.pyc SimpleHTTPServer.pyc _strptime.pyc token.pyc wsgiref.egg-info
base64.pyc ConfigParser.pyc ensurepip htmllib.pyc markupbase.pyc os.pyc pydoc_data SimpleXMLRPCServer.py struct.py traceback.py xdrlib.py
BaseHTTPServer.py contextlib.py filecmp.py HTMLParser.py md5.py _osx_support.py pydoc.py SimpleXMLRPCServer.pyc struct.pyc traceback.pyc xdrlib.pyc
BaseHTTPServer.pyc contextlib.pyc filecmp.pyc HTMLParser.pyc md5.pyc _osx_support.pyc pydoc.pyc sitecustomize.py subprocess.py trace.py xml
Bastion.py cookielib.py fileinput.py httplib.py mhlib.py pdb.doc _pyio.py sitecustomize.pyc subprocess.pyc trace.pyc xmllib.py
Bastion.pyc cookielib.pyc fileinput.pyc httplib.pyc mhlib.pyc pdb.py _pyio.pyc site.py sunaudio.py tty.py xmllib.pyc
bdb.py Cookie.py fnmatch.py ihooks.py mimetools.py pdb.pyc Queue.py site.pyc sunaudio.pyc tty.pyc xmlrpclib.py
bdb.pyc Cookie.pyc fnmatch.pyc ihooks.pyc mimetools.pyc phello.foo.py Queue.pyc smtpd.py sunau.py types.py xmlrpclib.pyc
binhex.py copy.py formatter.py imaplib.py mimetypes.py phello.foo.pyc quopri.py smtpd.pyc sunau.pyc types.pyc zipfile.py
binhex.pyc copy.pyc formatter.pyc imaplib.pyc mimetypes.pyc pickle.py quopri.pyc smtplib.py symbol.py unittest zipfile.pyc
bisect.py copy_reg.py fpformat.py imghdr.py MimeWriter.py pickle.pyc random.py smtplib.pyc symbol.pyc urllib2.py
bisect.pyc copy_reg.pyc fpformat.pyc imghdr.pyc MimeWriter.pyc pickletools.py random.pyc sndhdr.py symtable.py urllib2.pyc
bsddb cProfile.py fractions.py importlib mimify.py pickletools.pyc repr.py sndhdr.pyc symtable.pyc urllib.py
calendar.py cProfile.pyc fractions.pyc imputil.py mimify.pyc pipes.py repr.pyc socket.py _sysconfigdata.py urllib.pyc
calendar.pyc csv.py ftplib.py imputil.pyc modulefinder.py pipes.pyc re.py socket.pyc _sysconfigdata.pyc urlparse.py
CGIHTTPServer.py csv.pyc ftplib.pyc inspect.py modulefinder.pyc pkgutil.py re.pyc SocketServer.py sysconfig.py urlparse.pyc
CGIHTTPServer.pyc ctypes functools.py inspect.pyc _MozillaCookieJar.py pkgutil.pyc rexec.py SocketServer.pyc sysconfig.pyc UserDict.py
cgi.py curses functools.pyc io.py _MozillaCookieJar.pyc plat-arm-linux-gnueabihf rexec.pyc sqlite3 tabnanny.py UserDict.pyc

Using the project in a room instead of in the headphone

Hi.

I found your project after thinking to try this noise canceling idea for a room instead of in a headphone.

Do you have any idea if this idea could possibly work?

Also, since it is a small room, I could put the feedback mic close to the speaker and the main mic close to the noise source. Or maybe using a single mic without the feedback one.

Do you have any idea if your tool os going to work with only one microphone?

I'm still checking if I have everything to test this idea. Your project looks really good. Thanks for sharing it.

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.