Hi Everyone,
I am wondering if anyone have done FFT with a nRF9160. I found discussion about FFT on nRF52, but nothing on nRF9160. Can it be done? An example would be nice. Thank you in advance.
Cheers,
Floyd
Hi Everyone,
I am wondering if anyone have done FFT with a nRF9160. I found discussion about FFT on nRF52, but nothing on nRF9160. Can it be done? An example would be nice. Thank you in advance.
Cheers,
Floyd
Hi Floyd,
I haven't seen it done so far, but it's certainly possible!
Among the nRF52-related discussion you found, you might have seen references to the CMSIS-DSP Library, which supports performing FFTs. The CMSIS libraries are available for many Cortex-M devices, including the Cortex-M33 in the nRF9160.
The CMSIS-DSP library had to be added manually before, but is now distributed with Zephyr.
First off, add the following to your prj.conf (taken from this case):
CONFIG_CMSIS_DSP=y CONFIG_NEWLIB_LIBC=y CONFIG_FPU=y #if printf should be able to print float CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
And then include:
#include "arm_math.h"
To make the functions available for use.
To keep space requirements low, some of the DSP functions might require setting additional Kconfig flags. You can browse those here: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#!CMSIS_DSP
For examples on how to perform FFT using the DSP library, I found the following links:
Practical FFT on microcontrollers using CMSIS DSP
ARM CMSIS DSP FFT Library - Youtube
https://www.keil.com/pack/doc/CMSIS/DSP/html/arm_fft_bin_example_f32_8c-example.html (example from the library itself)
Hope that helps!
Best regards,
Raoul
Thank you. Will give that a try.