cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with arm_rfft_q15 in STM32F407

ali
Associate II
Posted on February 06, 2014 at 08:41

Hi,

I have a problem in using arm_rfft_q15. When I use this instruction in my application, some of buffers in my application were changed. I defined all other variables globally. In my application, I want to perform 512-Point FFT conversion. Definitions and code are as below:

//variables

arm_rfft_instance_q15  S;

arm_cfft_radix4_instance_q15  S_CFFT;

signed short FFT_Input[1024];

signed short FFT_Output[512];

..

..

arm_rfft_init_q15(&S, &S_CFFT, 512, 0, 1);

arm_rfft_q15(&S, FFT_Input, FFT_Output);

..

..

5 REPLIES 5
frankmeyer9
Associate II
Posted on February 06, 2014 at 11:08

I'm using the float version of said function without problems, so I assume it has to do with your code.

However, there are not too much details revealed. Perhaps a heap-stack collision, or a array index overflow in your code ?

Have you had a look at the map file ?

Have you tried a debugger, perhaps setting a data breakpoint on the thrashed array ?

ali
Associate II
Posted on February 06, 2014 at 13:17

Dear fm,

Thank you for your answer.

As I said before, all of the variables regarding to FFT are defined globally. Also I extended stack size from 0x400 to 0x800. When I comment arm_rfft_q15 instruction, my code works fine but in presence of this instruction, I see some errors. Without any logical reasons I saw some variables became QNaN. I didn't use any divisions or any other specific functions (just add and minus to those variables)

frankmeyer9
Associate II
Posted on February 06, 2014 at 13:36

I cannot exclude that the q15 implementation in the current DSP_Lib may indeed contain bugs.

I only used the floating point variant, based on CMSIS 2 (AFAIK, V2.1).

Correct me if I'm wrong, but the STM32 has no natural q15 or q31 support (in difference to lots of DSPs), in contrast to the single FP support according to IEEE 754, when using the FPU.

You can try to nail down the issue with the debugger, and verify that you don't feed incorrect parameters to DSP_Lib calls.

ali
Associate II
Posted on February 08, 2014 at 07:10

Dear fm,

Thank you for your responses. As you guessed correctly, the problem is related to buffer indices. I chose FFT output length wrong. It should be 1024 samples instead of 512 samples.

frankmeyer9
Associate II
Posted on February 08, 2014 at 16:25

By the way, I don't know why you want to use the q15 implementation.

I don't expect any significant performance advantage compared to the float implementation, assuming you are using the FPU (which the STM32F4 has).