Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
rider_wakya
PostPosted: May 13, 2011 - 01:40 AM
Newbie


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...
 
 View user's profile Send private message  
Reply with quote Back to top
bobgardner
PostPosted: May 13, 2011 - 02:25 AM
10k+ Postman


Joined: Sep 04, 2002
Posts: 24107
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.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
RickB
PostPosted: May 13, 2011 - 04:11 AM
Posting Freak


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

Go to youtube and search for avr and fft. Lots of examples, some with links to the project. Many use the fft module from ChaN.

http://elm-chan.org/docs/avrlib/avrfft.zip
 
 View user's profile Send private message  
Reply with quote Back to top
rider_wakya
PostPosted: May 13, 2011 - 05:41 AM
Newbie


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
 
 View user's profile Send private message  
Reply with quote Back to top
rider_wakya
PostPosted: May 13, 2011 - 05:44 AM
Newbie


Joined: Nov 23, 2010
Posts: 10


is it possibe if i use ATmega32 as the controller of this?
 
 View user's profile Send private message  
Reply with quote Back to top
mckeemj
PostPosted: May 13, 2011 - 08:34 AM
Resident


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 real-valued, 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."
 
 View user's profile Send private message  
Reply with quote Back to top
mikrosen
PostPosted: May 19, 2011 - 09:43 AM
Newbie


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 real-valued, 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.
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: May 19, 2011 - 10:19 AM
10k+ Postman


Joined: Jul 18, 2005
Posts: 71849
Location: (using avr-gcc in) Finchingfield, Essex, England

Did you follow Rick's link. Did you see the page it comes from:

http://elm-chan.org/works/akilcd/report_e.html


_________________
 
 View user's profile Send private message  
Reply with quote Back to top
mikrosen
PostPosted: May 19, 2011 - 10:31 AM
Newbie


Joined: May 19, 2011
Posts: 2


i got some idea thanks for your reply. but i need the flow chart for the FFT algoritmh...
 
 View user's profile Send private message  
Reply with quote Back to top
RickB
PostPosted: May 19, 2011 - 04:17 PM
Posting Freak


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

Before you try to understand fft, learn how to use google.

http://www.dspguide.com/ch12/2.htm

http://www.syscompdesign.com/AppNotes/fourier-transform.pdf
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits