@crumble said in Lopy4 FFT (spectrum analysis) micropython, adding C code?: @KenM ESP32 has some nasty memory problems when using both cores. This is fixed in freeRTOS by software. pycom updated it during rc0 and rc8 2 times. Float has a high memory load, so this may explain the speed difference, because it has to run through these fixes on each operation. Better slow as faulty. Even better would be an implementation with a lower memory load. It would take less memory, be much faster and allow more applications even audio analyzing if the basic DSP library that exist could be added. (https://github.com/espressif/esp-dsp/) (the library contains an int and float version in c and assembler for ESP32) But I don't know how to make it available in micropython (that general link wasn't very helpful) If PYCOM could make a guide how to add a new micropython function that gets an array and returns an array that would be very helpful!! EDIT from Pycom: To create a micropython module is pretty straightforward. In the respository Repo: Go to the mods folder in pycom-micropython-sigfox/esp32/mods and create 2 files: modfft.c and modfft.h Add the modfft.c file to application.mk. Add it to APP_MODS_SRC_C Create the micropython fft type like mp_module_uqueue and add it to esp32/mpconfigport.h As examples you can look at moduqueue.c, moduhashlib.c, etc.