I have read 3 different articles on guys implementing the Light on/off example and also seen the video here on Edge Impulse.
I have created a project and followed the instructions and also get very nice results, when tested the model, but when I try the model on my Arduino Nano 33 I get mixed results… It I don’t say anything and just watch what is going on sometimes, the Light turn on and then off for a while… If I say the “Light on” command, it sometimes work… I have tried to add morer noice and more “Light on” + “Light off” test data, but it doesn’t seems to do anything.
I have also tried with just one word like “Hi Hugo”, but I get the same results like, nice model testing in Edge Impulse, but poor performance on the Arduino.
In the Arduino sketch when the recording is starting, the microphone only record for about 1 sec. (I think) If you have a 2 sec. speech command it goes wrong, like my “Light on” command (all my commands is recorded in a 2 sec window)… also when the “Recording…” is shown in the serial monitor, you have to be fast and tell your command right away
I tried with yes/no commands and also recorded them in a 1 sec time slot… After some time and getting used to speak right away, when the “Recording…” is shown, it works perfect.
Now I would like to increase the microphone recording buffer to 2 sec and see if this helps on my “Light on” / “Light off” problem
yes/no (1 sec recording) speech + noise, nice model, window size = 1000ms, window increase = 500ms, just using the example nano_ble33_sense_microphone, works perfect.
“hey hugo” (2 sec recording), “yes” (1 sec) speech + noise (1 sec), nice model, window size = 2000ms, window increase = 500ms, zero pad data, everything looks very nice and data is nicely separate, but it doesn’t work
Have tried my own code, the nano_ble33_sense_microphone and the nano_ble33_sense_microphone_continuous example… In the serial monitor the model just returns numbers between 0.63 - 0.99 for the “hey hugo” key word, when I say nothing and just watch what happens.
“light on” (2 sec recording), “light off” (2 sec) speech + noise (1 sec), window size = 2000ms, window increase = 500ms, zero pad data, everything looks very nice and data is nicely separate.
Basically happens the same as in (2) just here the “light on” and “light off” alternate between 0.7 - 0.99…
I think it has something to do with the 2000ms window, but I am not sure?
I found some test noises online, but couldn’t make it work, but then it hit me that the sampling frequency maybe was wrong and it was so I changed it to 16 khz, split the file to 2 sec noise files and uploaded it to Edge Impulse… Now it works perfect…
So lesson learned… If you change your window size to 2000 (2 sec) and your test sound is 2 sec, then it looks like your noise files has to be 2 sec also… also it is important that the sampling frequency is 16khz