Sampling failed : Timeout - on changing sampling frequency

I wanted to sample Arduino Nano 33 sense board at 4kHz instead of 16kHz.

  1. I changed the value in ei_microphone.cpp from 4000 to 16000 in line 36
    AUDIO_SAMPLING_FREQUENCY 16000

  2. 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?

Hi @dhruvilodhavia, after doing some research, I am not sure if it is possible. I experienced the same thing as you and found this: https://github.com/arduino/ArduinoCore-nRF528x-mbedos/blob/master/libraries/PDM/src/PDM.cpp, which seems to suggest that the sampling rate is limited. Doing some other web searches I did not find a solution for attempting to sample at 4kHz. This appears to be related to the PDM driver.

Hi @dhruvilodhavia,

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.

I’ll let you know when this feature is live.