Hello!
I have an audio model deployment running wonderfully on my Arduino Nano 33, and I have two questions:
1: Prior to deployment, what defines how long the code will record (once deployed)? Is this taken from the window length in Edge Impulse?
2: How might one go about manually adjusting the length of recording from within the Arduino deployment? Having trouble figuring this out.
Thanks!
With some tinkering I found that if I manually increase n_samples
in the microphone_inference_start()
function, I can get longer record times. This seems to damage the classification though.
static bool microphone_inference_start(uint32_t n_samples)
{
n_samples = 40000;
// . . .
}
louis
June 4, 2021, 7:40am
#3
Hello @avielbr ,
1: Prior to deployment, what defines how long the code will record (once deployed)? Is this taken from the window length in Edge Impulse?
What define the length is the frequency (number of samples per second).
2: How might one go about manually adjusting the length of recording from within the Arduino deployment? Having trouble figuring this out
Are the frequencies of your recording on your training set and the ones during the inference the same?
If not you can use sox
to perform a downsampling and make sure that the two frequencies match:
Hi @mu234 , we currently only have downsampling in our enterprise version - not in the free projects for now. But if you’re using your phone you can test at 44KHz:
[image]
You’ll probably want downsample with e.g. sox and retrain at 16KHz, e.g. by:
Export your raw data (Dashboard > Export, and selecting WAV files).
Convert everything:
cd whereeveryouexporteddata
mkdir -p 16khz/training
find training -maxdepth 1 -type f -exec sox {} -r 16000 16khz/{} \;
mkdir -p 16khz/testing
find testing -ma…
I hope this helps,
Regards,
Louis
@avielbr The length is determined by the window length
set on the Create Impulse screen. If you change it there (and your samples are long enough) you can just redeploy on Arduino and it’ll record longer.