Nrf9160 PDM Microphone Use

build environment:
Mac

arm-toolchain:
export GNUARMEMB_TOOLCHAIN_PATH="~/opt/gnuarmemb/gcc-arm-none-eabi-9-2019-q4-major"

nrf-sdk:
v1.6.0

Project links:


I’ve generated the cpp library and replaced:

  • edge-impulse-sdk
  • model-parameters
  • tflite-model

The project compiles fine but when I try to run the classifier I get this “Failed to setup audio sampling” error. Any idea what the issue could be? Perhaps the sample length is too long? Thanks

AT+RUNIMPULSE
Inferencing settings:
Interval: 0.06249ms.
Frame size: 80000
Sample length: 5000 ms.
No. of classes: 4
ERR: Failed to setup audio sampling

AT+RUNIMPULSECONT
Inferencing settings:
Interval: 0.06249ms.
Frame size: 80000
Sample length: 5000 ms.
No. of classes: 4
Starting inferencing, press 'b' to break
ERR: frame_length (0.050000) cannot be lower than frame_stride (0.140000) for continuous classification
ERR: Failed to run DSP process (-1008)
ERR: Failed to run classifier (-5)

@mcallistertad Yeah, we have a ticket to improve the error message here, but in non-continuous mode we allocate a full audio buffer (80,000 int16 values => 160K) in RAM. Continuous audio does not do this, but the error there is valid, you should either up your frame length or lower frame stride (requirement to stitch together the spectrograms on the fly).

1 Like

Thanks @janjongboom! I will try this as suggested. Do you have any recommendations of sensible frame length/ stride values?

Frame stride a bit smaller than frame length works typically, e.g. 0.03 length, 0.02 stride.

1 Like