Search code examples
c++neural-networkembeddedsignal-processingstm32

How to compute the mel spectrogram on STM32?


I'm working with a STM32F4Discovery board, and I'm trying to run a neural network on it for sound classification.
I want to create the mel spectrogram directly on board from the sound recorded from the built-in microphone, which I already converted to PCM, and than give it as input to my neural network (trained with tensorflow, and generated with STM Cube AI).
The network's input is an image of 30x30x1.
Is there a C/C++ library that can I use to implement it? I've tried LibrosaCpp but it crash when calling Eigen functions.


Solution

  • It is possible to compute the mel spectrogram on STM32 boards by using CMSIS DSP Library provided by ARM alongside with the STM32_AI_AudioPreprocessing_Library included in the FP-AI-Sensing package.
    In the FP-AI-Sensing library there is also an example for the mel spectrogram computation.