2014-02-05 11:41 PM
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); .. ..2014-02-06 02:08 AM
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 ?2014-02-06 04:17 AM
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)2014-02-06 04:36 AM
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.2014-02-07 10:10 PM
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.2014-02-08 07:25 AM
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).