Changing sampling frequency in firmware for nRF52840 DK / nRF5340 DK

Hello Guys
My model runs good on Arduino Nano 33 BLE Sense using arduino library, generated using Edge Impulse, with EI_CLASSIFIER_FREQUENCY 41667 which is used in PDM.

I have a nFR52840-DK board with an an external PDM microphone (the same which I’m using with arduino) connected to PDM_CLK_PIN = p1.04 and PDM_DIN_PIN = p1.05 like X-NUCLEO-IKS02A1 shield and would like to try to run the same model on this board.
I’m having trouble changing PDM sampling frequency in firmware for nRF52840 DK / nRF5340 DK example from here: https://github.com/edgeimpulse/firmware-nrf52840-5340-dk . I’ve edited ei_microphone.cpp like following:



I can see that my model reacts to sounds, but classification results are wrong, so I suspect that there is something wrong with the sampled audio data.
Settings in model_metadata.h :

Can you help me with this issue please? :slightly_smiling_face:

Hi @JuliusK,
First of all, I recommend adding your custom frequency to the list of supported frequencies.
Then check if captured data is correct on the studio side.

Best regards,
Matt

2 Likes