cancel
Showing results for 
Search instead for 
Did you mean: 

FFT function oddities

willschneider
Associate II
Posted on August 09, 2013 at 10:42

I'm using the ''arm_cfft_radix4_f32(&S, FFTData); '' function to obtain the FFT of an array and then inverse it back after some processing.

I have things working, to a point, but with some odd restrictions.

Firstly I want to do a 512 point FFT, but changing the size to 512 causes all my outputs to become zero. I can only get it to work for the size of 256.

I'm assuming that its failing because I'm giving it inputs of the wrong size, but I feel they 'should' be corret. I'm feeding the function an array of size 1024, with 512 real values and 512 complex values set as zero. Arranged as Real1[0] Imag1[1] Real2[2] Imag2[3].....

From the somewhat unhelpfull CMIS documentation, it appears that I need to be giving the function an array double the size of the fft size I want. 1024 = 2*512, so shouldn't that be correct?

Using the exact same input array, but changing the fft size to 256 does indeed give me a working FFT, however only half of the output array is filled, the extra 512 points remain untouched.

Am I missing something here?

Cheers, Will

Addition: Looking closer using the debugger, If I set the size to 512 the program just halts when it reaches the FFT function, ang goes no further. :S

10 REPLIES 10
crt2
Associate II
Posted on August 09, 2013 at 10:57

This sounds something like type limit probably inside function where something uses byte value to move around the array. Can you check if that is not the case?

willschneider
Associate II
Posted on August 09, 2013 at 11:08

Thanks for the reply, I don't quite understand what you mean though.

How should I check for this?

frankmeyer9
Associate II
Posted on August 09, 2013 at 11:40

Did you call the

arm_cfft_radix4_init_f32()

function before with a proper size value ?

willschneider
Associate II
Posted on August 09, 2013 at 12:22

Yes, I'm initiating it as I believe I should be -

status = ARM_MATH_SUCCESS;
/* Initialize the CFFT/CIFFT module */ 
status = arm_cfft_radix4_init_f32(&S, fftSize, ifftFlag, doBitReverse); 
//FFT 
arm_cfft_radix4_f32(&S, FFTData);

frankmeyer9
Associate II
Posted on August 09, 2013 at 13:40

Yes, I'm initiating it as I believe I should be -

 

Believing might be not enough ...

It works for me with 1024 points - there shouldn't be a problem with 512 points. Is your

fftSize

variable really 512 ?

willschneider
Associate II
Posted on August 09, 2013 at 13:50

Yes, definately. Leaving it as 256 works but simply changing it to 512 does not. Am I correct to be giving it an array of [1024] with 512 of both real and imaginary numbers?

crt2
Associate II
Posted on August 09, 2013 at 14:45

What type is fftSize (aka. how did you define it)? What is is byte, short unsigned int? Next thing is to check with debugger what are numbers in variables before you enter this function.

willschneider
Associate II
Posted on August 09, 2013 at 15:33

I just tried doubling again all my array sizes, to try for a 1024 size FFT. I wasn't expect it, but it works. This makes it even more confusing that I still cant get a 512 FFT to work.

zzdz2
Associate II
Posted on August 12, 2013 at 10:14

Rumor has it that radix-4 FFT only works with 

16, 64, 256, 1024 sizes.