I am attempting to capture raw audio from the Nano 33 BLE Sense, so I can use it to train TensorFlow models. Currently I'm transferring raw PDM audio from the device back to the desktop, which I have achieved via Serial.print via an accumulated buffer of multiple PDM buffers. (Flipping between recording and transmitting, as they don't appear to be possible at the same time over Serial). Now I'm trying to decode the PDM data, into PCM.
The Arduino example project 'micro_speech' for the TensorFlow lite library, contains internal classes for both the Arduino Nano 33 BLE Sense and the Sparkfun Edge. However the Sparkfun edge data is PCM, whereas the Nano 33 BLE Sense is a PDM microphone. I can't see any circuitry in the Nano 33 BLE Sense which converts the PDM data, or operations which treat the raw audio data. The tensorflow micro_frontend doesn't convert the data as far as I can tell.
Furthermore there is, as many have commented on, a significant lack of documentation around the PDM library, example code which produces PCM audio, or any accompanying third party libraries which can be utilised to further process this data. I have found the mbed DSP library which supports getting a scalar unsigned RMS value for a PDM buffer, but not a signed PCM waveform.
Is anyone able to explain the processes used in the treatment of PDM audio data on the Nano 33 BLE Sense, to create PCM audio? Can anyone provide worked examples of how this should be achieved?
Can anyone advise what desktop libraries are helping them transfer data fast over BLE, using large byte arrays of data from a BLE characteristic? I believe it would make an excellent worked example for the broader community of the power of the Nano 33 BLE Sense.