matrix-io / matrix-creator-hal

Hardware Abstraction Layer for MATRIX Creator & MATRIX Voice
https://matrix-io.github.io/matrix-documentation/matrix-hal/overview/
GNU General Public License v3.0
70 stars 50 forks source link

algorithm problem in mic_demo.cpp #25

Closed arllllll10 closed 6 years ago

arllllll10 commented 7 years ago

Hi, I'm confused about the algorithm. in matrix-creator-hal/demos/mic_demo.cpp at line 60 and line 61, the code is

   float x = filter_bank_hp[c].Filter(mics.At(s, c));
   magnitude[c] += filter_bank_lp[c].Filter(x * x);

this piece of code seems like first pass the value into high-pass filter with corresponding high-pass coefficient, and then pass the result into low-pass filter with power of 2.

Is there anyone can tell me what is the purpose of x * x? And why not directly pass the signal into a band-pass filter?

kdpatino commented 6 years ago

Hello @arleneF, Thank you for your feedback! We just change the filters to one passband filter as you suggested us. https://github.com/matrix-io/matrix-creator-hal/pull/64

Regards, Kevin Patino