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
umbeke
PostPosted: Dec 14, 2011 - 04:47 PM
Newbie


Joined: Dec 11, 2011
Posts: 9


Can I calculate FFT without using floating point numbers?

I have 8 or 10 bits samples coming from an Analog Digital Converter. They are unsigned integers.
I want to perform FFTs using an 8 bit AVR on blocks of 128 to 1024 samples.

Question: Can I evaluate those FFTs without using floating point variables, just signed or unsigned integers, to speed up calculations?

FFT algorithm in C: http://www.codeproject.com/KB/recipes/howtofft.aspx
 
 View user's profile Send private message  
Reply with quote Back to top
thygate
PostPosted: Dec 14, 2011 - 05:03 PM
Resident


Joined: Sep 19, 2005
Posts: 843
Location: Belgium

ChaN has a fixed point fft library written in assembler.
http://elm-chan.org/works/akilcd/report_e.html

Quote:
The FFT operations are done in 16-bit fixed-point. These 128 point FFT processes, applying window, butterfly operations and scalar output, could be executed in real-time (within 7.3 msec). The sampling frequency is 9.6 kHz
 
 View user's profile Send private message  
Reply with quote Back to top
theusch
PostPosted: Dec 14, 2011 - 05:35 PM
10k+ Postman


Joined: Feb 19, 2001
Posts: 29245
Location: Wisconsin USA

Hmmm--a Google search on 'FFT "integer only" ' gives some interesting hits. Several mention CORDIC which has been brought up here before.
 
 View user's profile Send private message  
Reply with quote Back to top
DO1THL
PostPosted: Dec 14, 2011 - 08:08 PM
Posting Freak


Joined: Aug 29, 2002
Posts: 1161
Location: Muenster, Germany

In my application i started with ChaN's fixed-point FFT implementation, but changed to another algorithm due to arithmetical reasons (incorrect results, i believe). Now i'm using an optimized Hartley algorithm to perform a floating-point-based 128 bin FFT on an array of ADC values. The FFT is done within about 23ms on a 12 MHz ATmega32.
 
 View user's profile Send private message  
Reply with quote Back to top
bobgardner
PostPosted: Dec 14, 2011 - 09:01 PM
10k+ Postman


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

There is a pc app called fixfft that might be port-able to an avr c compiler

_________________
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
dak664
PostPosted: Dec 14, 2011 - 09:16 PM
Posting Freak


Joined: Jun 15, 2008
Posts: 1977
Location: North Carolina USA

In the old days of 16 bit arithmetic you would subtract the DC component to get zero mean (this was called floating the buffer) and do an integer FFT. If overflows did occur you just divide everything by another power of two. That gives 16 bit precision in the AC frequencies, since there is no longer a DC component.
 
 View user's profile Send private message  
Reply with quote Back to top
MarioRivas
PostPosted: Dec 15, 2011 - 12:16 AM
Hangaround


Joined: Dec 29, 2010
Posts: 475


Here's a website having several algorithms in several languages : www.jjj.de/fft/fftpage.html
 
 View user's profile Send private message  
Reply with quote Back to top
zteshnik
PostPosted: Jan 09, 2012 - 07:28 PM
Rookie


Joined: Jan 05, 2011
Posts: 48
Location: Montreal

I did a couple projects with integer FFT. First one based on the code from www.jjj.de, and second is my own improved algorithm. 8-bit version about ~32msec with 512 FFT, arduino Uno board AtMega328p 16Mhz.
http://fftarduino.blogspot.com/2011/02/color-organ-spectrum-analyzer-on.html

http://musicalnoterecognition.blogspot.com/2011/09/arduino-musical-note-recognition.html#comment-form

_________________
http://coolarduino.wordpress.com/
 
 View user's profile Send private message Visit poster's website 
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