This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem with arm_cfft_f32()

Note: This was originally posted on 27th August 2013 at http://forums.arm.com

Hello,

I'm new in the field of ARM and I need some help. I try to make a FFT on a Cortex-M4 with fpu. I tried two examples given with the CMSIS library, an old one which uses arm_cfft_radix4_f32() and a new one with arm_cfft_f32(). The two examples compile well. The old code with arm_cfft_radix4_f32() works quite good. That function is deprecated so I would like to use arm_cfft_f32() but I don't get the right data at the end.

The program makes a FFT of a given signal and should detect the peak in magnitude at refIndex = 213. It's ok with the deprecated function arm_cfft_radix4_f32() but not with arm_cfft_f32(). I get refIndex = 861. I tried to change the 'doBitReverse' value from 1 to 0 but nothing changed I have exactly the same result at the output of arm_cfft_f32().

I didn't find the same issue on the web. Is there a known problem with arm_cfft_f32() ? Could someone explain me what I'm doing wrong ?

Thanks,
Pierre.


Parents
  • I discovered this problem yesterday as well. There are a couple other solutions that may be easier than recompiling the library. The biggest problem with recompiling it is that you must then maintain it. When a new version comes out you can't just use it. You must recompile it as well, unless the bug gets fixed in the next release.

    1. You can fix the error in arm_bitreversal2.S as described in your post and include that file as part of your project. As long as it gets linked in prior to the library, the version inside the library gets ignored.

    2. An even less intrusive method is to add the section text to the linker script. My addition is highlighted in red below.

    ...

      /* The program code and other data goes into FLASH */

      .text :

      {

        . = ALIGN(4);

        *(.text)          /* .text sections (code) */

        *(.text*)         /* .text* sections (code) */

        *(text)           /* workaround for CMSIS library bug */

        *(.rodata)        /* .rodata sections (constants, strings, etc.) */

        *(.rodata*)       /* .rodata* sections (constants, strings, etc.) */

    ...

    I believe this is the best workaround until the bug is fixed in the CMSIS distribution. Is ARM aware of the problem?

    - Greg

Reply
  • I discovered this problem yesterday as well. There are a couple other solutions that may be easier than recompiling the library. The biggest problem with recompiling it is that you must then maintain it. When a new version comes out you can't just use it. You must recompile it as well, unless the bug gets fixed in the next release.

    1. You can fix the error in arm_bitreversal2.S as described in your post and include that file as part of your project. As long as it gets linked in prior to the library, the version inside the library gets ignored.

    2. An even less intrusive method is to add the section text to the linker script. My addition is highlighted in red below.

    ...

      /* The program code and other data goes into FLASH */

      .text :

      {

        . = ALIGN(4);

        *(.text)          /* .text sections (code) */

        *(.text*)         /* .text* sections (code) */

        *(text)           /* workaround for CMSIS library bug */

        *(.rodata)        /* .rodata sections (constants, strings, etc.) */

        *(.rodata*)       /* .rodata* sections (constants, strings, etc.) */

    ...

    I believe this is the best workaround until the bug is fixed in the CMSIS distribution. Is ARM aware of the problem?

    - Greg

Children
No data