Author 
Message 

Posted: May 13, 2011  01:40 AM 

Joined: Nov 23, 2010
Posts: 10


Hi,
i want to convert time based analog signal to frequency based signal (spectrum signal) by using microcontroller and display it on graphical LCD...,
i think method that i can used is FFT....but i haven't knew yet how to applied FFT method on microcontroller...
can you tell me the algorithm for FFT on microcontroller?
thanks before... 





Posted: May 13, 2011  02:25 AM 

Joined: Sep 04, 2002
Posts: 24113
Location: Orlando Florida


Lots of FFT source code on the web. You have any requirements? You want to analyze your stereo speakers? You need 20Hz to 20KHz. 20Hz has a period of 50ms. 20KHz freq resp means you need to take samples at 40KHz (every 25 usec) for 50ms. Thats about 1250 samples. FFT programs like to use a power of 2, so I'll suggest 1024 samples. You can take 8 bit samples or 10 bit samples with the AVR a/d converter. That will give you 36 dB or 54 dB range. (Looking for distortion needs a deep range. Just adjusting your room eq will do with the smaller range). Here's the problem: you need 1024 4 byte reals and 1024 4 byte imaginaries (that's 8K byte of ram needed). For this you need the new mega1284 with 16K of ram. 
_________________ I ain't nobody's uncle, so don't call me that.





Posted: May 13, 2011  04:11 AM 

Joined: Jan 30, 2005
Posts: 1039
Location: Junction City, OR USA





Posted: May 13, 2011  05:41 AM 

Joined: Nov 23, 2010
Posts: 10


i want to analyze range frequency signal until 160MHz...
I use mixer and DDS AD9951 to down converter this signal close to zero, then i do filtering using Max297 (LPF), then sampling using ADC 12 bits....
you say that i need real sample and imaginary samples,
can you tell me why we need real and imaginary sample on FFT method?
i still need more information about that...
thanks 





Posted: May 13, 2011  05:44 AM 

Joined: Nov 23, 2010
Posts: 10


is it possibe if i use ATmega32 as the controller of this? 





Posted: May 13, 2011  08:34 AM 

Joined: Jun 26, 2006
Posts: 852
Location: San Luis Valley, Colorado ( 2,318m )


You state the base frequency of your signal ( 160MHz ) and that you are down converting it, but you do not state what the necessary bandwidth of your sampling is  that is the important bit. Bob gave an excellent example of designing a FFT for a specific pass band ( in his case audio ); you will need to do something similar. If the bandwidth requirements and harmonic discrimination requirements ( FFT sample width ) are light enough, yes, it could be implemented with an AtMega32; but we do not have enough information to be able to say one way or the other.
As for the imaginary/real samples... perhaps you should read a bit about Fourier transforms  they are complex functions. You can store all real samples, and/or ignore any complex frequency components, but the function itself does work with them. There are optimizations for realvalued, symmetric, functions but, as I said, you really need to read about them for yourself.
Martin Jay McKee 
_________________ As with most things in engineering, the answer is an unabashed, "It depends."





Posted: May 19, 2011  09:43 AM 

Joined: May 19, 2011
Posts: 2


mckeemj wrote:
You state the base frequency of your signal ( 160MHz ) and that you are down converting it, but you do not state what the necessary bandwidth of your sampling is  that is the important bit. Bob gave an excellent example of designing a FFT for a specific pass band ( in his case audio ); you will need to do something similar. If the bandwidth requirements and harmonic discrimination requirements ( FFT sample width ) are light enough, yes, it could be implemented with an AtMega32; but we do not have enough information to be able to say one way or the other.
As for the imaginary/real samples... perhaps you should read a bit about Fourier transforms  they are complex functions. You can store all real samples, and/or ignore any complex frequency components, but the function itself does work with them. There are optimizations for realvalued, symmetric, functions but, as I said, you really need to read about them for yourself.
Martin Jay McKee
hi..
want to convert time based analog signal to frequency based signal (spectrum signal) by using multitasking computer tinytiger2 and display it on graphical LCD...,
i think method have to use is FFT....but i am not having any idea about FFT
can you tell me the algorithm for FFT In the form of flowchart or procedure it will help for me to understand. 





Posted: May 19, 2011  10:19 AM 

Joined: Jul 18, 2005
Posts: 71947
Location: (using avrgcc in) Finchingfield, Essex, England





Posted: May 19, 2011  10:31 AM 

Joined: May 19, 2011
Posts: 2


i got some idea thanks for your reply. but i need the flow chart for the FFT algoritmh... 





Posted: May 19, 2011  04:17 PM 

Joined: Jan 30, 2005
Posts: 1039
Location: Junction City, OR USA




