cancel
Showing results for 
Search instead for 
Did you mean: 

FFT_4096

arash63f
Associate II
Posted on June 23, 2009 at 14:53

FFT_4096

9 REPLIES 9
arash63f
Associate II
Posted on May 17, 2011 at 13:13

hi

I am working on STM32f103xxx series and really need FFT_4096 point with FIR or IIR with windowing(hanning , hamming , ...) on my project , i work with ride7 compiler , and my project have been held because of this code.

can anyone help me ?

picguy
Associate II
Posted on May 17, 2011 at 13:13

Sorry, I don’t have code for you. But I do have questions that you have not answered in your post.

Can you use 32-bit floating point? Emulated FP was fast enough for my DTMF decode. (I used IAR tools.) What speed do you need? Careful scaling of integer values is more work (my guess WAY more work) but may be needed if you have serious timing constraints.

At 8 bytes (real, imag) * 4096 = 32K RAM. Do you have enough RAM?

Writing an FFT in C from info gleaned from the web should not be a problem. Use sin() functions to generate test data.

imellen
Associate II
Posted on May 17, 2011 at 13:13

I've posted FFT code including complex 4096 points FFT year ago - see

''hand optimized FFT/IFFT for Cortex-M3 attached'' from March 29 2008.

However, 4096 points is pushing 16 bit integer arithmetics to its limits due to required dynamic range.

Ivan

arash63f
Associate II
Posted on May 17, 2011 at 13:13

about RAM , yes , i have enough RAM to do this, i use stm32f103vet6 .

it has 64k RAM.

about 4098 point hand optimized code that have been sent, i have tested it, but it doesn't seem work properly , i use ride 7 for compile it but during compiling i faced with several errors ! i try to compile it with IAR , but i cant do it(i'm not so familiar with IAR) , but i prefer to do it in ride , can you help me about this ? thanks a lot

imellen
Associate II
Posted on May 17, 2011 at 13:13

Posted FFT routine was tested with Rowley Crossworks.

It is using gcc, so ride7 should compile it as it is.

Which kind of errors was it generating?

Ivan

st3
Associate II
Posted on May 17, 2011 at 13:13

Quote:

i have tested it, but it doesn't seem work properly

How can you have ''tested'' it if you can't even compile it?! :-?

Quote:

during compiling i faced with several errors ... can you help me about this ?

How do you expect anyone to be able to help unless you say specifically what errors you actually got??! :-?

arash63f
Associate II
Posted on May 17, 2011 at 13:13

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6YY&d=%2Fa%2F0X0000000bqe%2F_HWY4ram5ymMBDL.e.Cy9MnHxY.o_HhHan9C17fqLns&asPdf=false
imellen
Associate II
Posted on May 17, 2011 at 13:13

The reason for most (if not all) these errors is that C preprocessor is not active. These are the main consequences:

// marked comments are not removed

#define ignored -> symbolic register names not replaced

Try to enable C preprocessor for assembler files. I do not know how to do it in Ride 7. It is working in Rowley Crossworks by default.

I've meanwhile switched to KEIL MDK toolset, but I haven't converted FFT routine yet. When I'll do it I post KEIL version.

If you want to use it without C preprocessor you have to perform preprocessor functionality in text editor:

- delete all comments

- replace #define definitions (e.g. replace all x0r by R4)

- delete one of code optional sections (line 276-284, LATENCY2 conditional compile)

Ivan

kutnickg
Associate II
Posted on May 17, 2011 at 13:13

If GCC is being invoked to assemble the file then the preprocessor will be applied by default, but if GAS (GNU assembler) is being invoked instead then the preprocessor won't be applied. I haven't used any of the IDEs being discussed here, but if they're generating makefiles then maybe changing AS to be the same as whatever CC is would help.

Otherwise, you can get GCC to preprocess for you, as opposed to manually performing the substitutions in an editor. It can be done like this:

gcc file.s -E -o file2.s

It should work in any version of gcc targeting any platform, since it's just running the preprocessor.