noise suppression with librespeaker in RespeakerCorev2

Moderators: violet, seth.welday

cinettoa
Pre-kindergarten
Pre-kindergarten
Posts: 30
Joined: Fri Jul 20, 2018 10:33 am

noise suppression with librespeaker in RespeakerCorev2

Post by cinettoa » Thu Oct 11, 2018 4:48 pm

Dear Service,
I am testing the librespeaker c++ library with a RespeakerCoreV2.
All the algorithms are working just fine exept for Noise Suppression.
I've tried to use the HybridNode::CreateNsOnly in many ways as showed in your documentation:
1- Before VepAecBeamformingNode (with various values for ns_level);
2- After Collector (with various values for ns_level);
3- After Selector (with various values for ns_level);

In any case the output of the block is highly distorced. My voice is not only metallic and unrecognizable but also speeded up.
Hence if I put a Hot Word recognition block after the noise suppression, the recognition performance drops.

Do you have any guidance on how to use this Noise Suppression block except those examples in http://respeaker.io/librespeaker_doc?

Thanks for your help

chdyejiewei
Pre-kindergarten
Pre-kindergarten
Posts: 17
Joined: Mon Oct 15, 2018 3:11 pm

Re: noise suppression with librespeaker in RespeakerCorev2

Post by chdyejiewei » Mon Oct 15, 2018 3:15 pm

Hi Cinettoa,

I am Jerry from Seeed. Could you post your code here? And which versions of librespeaker you are using?

chdyejiewei
Pre-kindergarten
Pre-kindergarten
Posts: 17
Joined: Mon Oct 15, 2018 3:11 pm

Re: noise suppression with librespeaker in RespeakerCorev2

Post by chdyejiewei » Mon Oct 15, 2018 6:40 pm

And also a test audio, please.
You can find the result of NS in the following 2 audios: one of them is the origin audio and another is the processed(ns_level=3) audio.
Attachments
record_with_noise.wav.zip
(1.68 MiB) Downloaded 20 times
ns-3.wav.zip
(1.41 MiB) Downloaded 18 times

cinettoa
Pre-kindergarten
Pre-kindergarten
Posts: 30
Joined: Fri Jul 20, 2018 10:33 am

Re: noise suppression with librespeaker in RespeakerCorev2

Post by cinettoa » Tue Oct 16, 2018 11:45 am

Hi Jerry,
According to dpkg I am using the librespeaker 2.0.0-build1.

here in attached you can find the two scripts and two recordings made with them. One with noise suppression (main_vep__nr_test.cc) and one without (main_vep_test.cc).
Attachments
main_vep_test.zip
(375.49 KiB) Downloaded 26 times
main_vep_nr_test.zip
(151.53 KiB) Downloaded 22 times

chdyejiewei
Pre-kindergarten
Pre-kindergarten
Posts: 17
Joined: Mon Oct 15, 2018 3:11 pm

Re: noise suppression with librespeaker in RespeakerCorev2

Post by chdyejiewei » Wed Oct 17, 2018 12:41 pm

Hi Cinettoa,

Thanks for your post, which helps us to find a bug in HybridNode. We have already fixed it and feel free to update the lib:

Code: Select all

sudo dpkg -i librespeaker_2.0.1-build181017_armhf.deb 
We will also merge the fix into our dev branch and release ASAP.
Attachments
librespeaker_2.0.1-build181017_armhf.deb.zip
(1.03 MiB) Downloaded 29 times

cinettoa
Pre-kindergarten
Pre-kindergarten
Posts: 30
Joined: Fri Jul 20, 2018 10:33 am

Re: noise suppression with librespeaker in RespeakerCorev2

Post by cinettoa » Wed Oct 17, 2018 2:20 pm

Hi Jerry,
I've removed the old librespeaker using "dpkg -r librespeaker" and then install the package you provided with "dpkg -i".
the package is correctly installed according to dpkg -l librespeaker.
I've a new issue.
The file /usr/local/include/librespeaker.so is not present anymore I couldn't compile my cc script using g++.
So, I've copied the file librespeaker.so.2.0.1 to librespeaker.so and I was eventually able to compile.
However after compiling the same cc script I've sent you yesterday, it returns an error right after launching it:

terminate called after throwing an instance of 'std::bad_array_new_length'
what(): std::bad_array_new_length.

Any support about this?

Thanks for your help

cinettoa
Pre-kindergarten
Pre-kindergarten
Posts: 30
Joined: Fri Jul 20, 2018 10:33 am

Re: noise suppression with librespeaker in RespeakerCorev2

Post by cinettoa » Wed Oct 17, 2018 2:30 pm

I attach a little output for troubleshooting.

(393ms)DEBUG -- record stream state: 1 [pulse_collector_node.cc:244]
(404ms)DEBUG -- record stream state: 1 [pulse_collector_node.cc:244]
(414ms)DEBUG -- record stream state: 1 [pulse_collector_node.cc:244]
(424ms)DEBUG -- record stream state: 1 [pulse_collector_node.cc:244]
(434ms)DEBUG -- record stream state: 2 [pulse_collector_node.cc:244]
(434ms)INFO -- Connected to PulseAudio server. [pulse_collector_node.cc:255]
(435ms)DEBUG -- PulseCollectorNode input: channels 8 rate 48000, output: channels 8 rate 16000 [pulse_collector_node.cc:274]
(435ms)INFO -- PulseCollectorNode thread started. [pulse_collector_node.cc:276]
(437ms)INFO -- HybridNode is accepting interleaved data. [hybrid_node.cc:171]
terminate called after throwing an instance of 'std::bad_array_new_length'
what(): std::bad_array_new_length
Aborted

chdyejiewei
Pre-kindergarten
Pre-kindergarten
Posts: 17
Joined: Mon Oct 15, 2018 3:11 pm

Re: noise suppression with librespeaker in RespeakerCorev2

Post by chdyejiewei » Wed Oct 17, 2018 4:19 pm

Have you added parameter "--std=c++11"? Please try this:

Code: Select all

g++ main_vep_nr_test.cc -o main_vep_nr_test -L/usr/local/lib -I/usr/local/include/respeaker -lrespeaker -lsndfile -fPIC -std=c++11 -fpermissive

cinettoa
Pre-kindergarten
Pre-kindergarten
Posts: 30
Joined: Fri Jul 20, 2018 10:33 am

Re: noise suppression with librespeaker in RespeakerCorev2

Post by cinettoa » Wed Oct 17, 2018 4:42 pm

Hi,
just tried but still the same error.
Just to double check, I've also tried to reinstall the librespeaker v2.0.0 and re-compile the same cc file. In this way it is working.

Any other suggestion or any additional info I can provide?

chdyejiewei
Pre-kindergarten
Pre-kindergarten
Posts: 17
Joined: Mon Oct 15, 2018 3:11 pm

Re: noise suppression with librespeaker in RespeakerCorev2

Post by chdyejiewei » Wed Oct 17, 2018 5:05 pm

Could you check the md5sum of the deb package? It should be

Code: Select all

b98d4bc263215f28162ff2c9a2df182b
.

Post Reply