ShawnHymel / ei-keyword-spotting

159 stars 51 forks source link

Using STM32F407G-DISC1 and onboard mic MP45DT02 for Keyword Spotting #10

Closed SamHui8868 closed 2 years ago

SamHui8868 commented 2 years ago

Hi, I have followed the instructions and successfully port Edge Impulse classifier to STM32CubeIDE by using CMSIS pack. My code is based on the project "adafruit-f405-keyword-spotting" with the same STM32CubeMX configurations. The only difference is I am using STM32F407G-DISC1 with onboard mic MP45DT02.

Problem: I have 4 class [ "noise" , "unknown" , "go" , "stop"] for my classifier. However, the confidence of "noise" keeps a very high value(80%-95%) no matter how loud I shout out the keyword "go" or "stop".

I have tested the model with Edge Impulse Live Classification on my mobile phone, laptop and desktop. My model can make correct predictions according to my voice. So I think I probably got something wrong with my MP45DT02 settings, but I don't know where to start with. It will be great if someone can tell me how to change the setting when using a onboard MEMs mic for this project. Thank you!!

Here is my Impulse (should be same with the instructions): image

SamHui8868 commented 2 years ago

I have solved the problem. The project used Adafruit-SPH0645LM4H I2S MEMs mic, which output PCM signal. However, MP45DT02 output PDM signal. So I need to convert the PDM signal to PCM signal by a PDM filter. Fortunately, PDM2PCM is available in STM32MX I can just use it. Then, things went right, thank you!! image