I wanted to sample Arduino Nano 33 sense board at 4kHz instead of 16kHz.
I changed the value in ei_microphone.cpp from 4000 to 16000 in line 36
AUDIO_SAMPLING_FREQUENCY 16000
And also changed the values in file - /src/ingestion-sdk-platform/nano-ble33/ei_device_nano_ble33.cpp
from 16000 to 4000 in these two lines -
sensors[MICROPHONE].max_sample_length_s = available_bytes / (16000 * 2);
sensors[MICROPHONE].frequencies[0] = 16000.0f;
On starting sampling, the row hangs on “Sampling… (1s left)” and the error is-
Sampling failed : Timeout when waiting for > (timeout: 4000) AT+SAMPLESTART = Built-in microphone
Should I change any other values in the firmware before building it?
Down sampling will be supported for targets using a Nordic processor somewhere this week.
This includes the Arduino Nano 33 BLE Sense board. Default frequencies will be 16kHz, 8KHz and 4KHz.
Hi, @Arjan. Thank you.
I looked through the changes in the code and flashed my code with the current version. There were no options given on edge impulse website to change the sampling frequency while collecting the data so I assume we need to change the code to do it.
In the ei_microphone.cpp file, I changed static uint32_t audio_sampling_frequency = 16000 -> static uint32_t audio_sampling_frequency = 8000
I also made changes in ei_device_nano_ble33.cpp file sensors[MICROPHONE].max_sample_length_s = available_bytes / (16000 * 2); -> sensors[MICROPHONE].max_sample_length_s = available_bytes / (8000 * 2);
Still I the microphone did not sample at 8000Hz. I request you to let me know what changes I need to make in the code to downsample the audio.