This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

fpu-fft demo on nrf52840

Hi, engineer:

   I need to compute FFT on nrf52840, I used sdk-demo fpu-fft,  I tested the FFT operation time and found that it took 2 ms,That`s a long time,  Did I configure anywhere is wrong. I wonder how long it will take that 52840 to calculate the complex FFT of 256 points.  thanks!

Parents
  • Hi 

    What are you measuring? The time spend by the fft_process(..) function, or the time spent by the fft_generate_samples(..) function?

    I did a test myself and measured the fft_process(..) function to run in about 128us. 

    The fft_generate_samples(..) function spends closer to 2ms, but you can optimize this by replacing the call to the sin() function by sinf(). Most likely the developers made a small mistake and used the double version instead of the float version of the sin function. 

    Increasing the output length to 256 points increases the fft_process(..) runtime to 170us in my test. 

    Best regards
    Torbjørn

  • Hi, ovrebekk:

    I measured the fft_process(...) function, I modified the Demo to compute the complex number FFT-256

    , fft_process(...) function takes about 2.5ms.



    demo_project: nRF5_SDK_14.2.0_17b948a\examples\peripheral\fpu_fft\  fpu_fft_example_blank_pca10056_irq.uvprojx

    modify point:

    1.

    #define FFT_TEST_COMP_SAMPLES_LEN        512  //128 --> 512 

    2.

    nrf_gpio_pin_write(ARDUINO_13_PIN, 1);

    fft_process(m_fft_input_f32,
    &arm_cfft_sR_f32_len256,        //arm_cfft_sR_f32_len64 --> arm_cfft_sR_f32_len256
    m_fft_output_f32,
    FFT_TEST_OUT_SAMPLES_LEN);

    nrf_gpio_pin_write(ARDUINO_13_PIN, 0);

    measured method:

    I use an oscilloscope to check the IO pin status, The duration of pin state high level is about 2.5ms,I think the function takes 2.5ms to execute.

    Is there something I haven't modify corrected, what should I do,  Can you give me a correct example project, thanks very much!

  • Hi 

    Using the fpu_fft example  in nRF5 SDK v16.0.0 as a starting point I am getting a quite different result. 

    I changed the FFT type to len256 and the FFT_TEST_COMP_SAMPLES_LEN define to 512, and measure about 670us running time. 

    Which compiler and IDE are you using to test this?

    You will find my test example attached:
    244796_fpu_fft.zip

    Best regards
    Torbjørn

Reply Children
No Data
Related