Newsgroups: comp.dsp,sci.image.processing
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!udel!gatech!swrinde!howland.reston.ans.net!ix.netcom.com!netcom.com!slwork
From: slwork@netcom.com (Steven L. Work)
Subject: Re: Arbitrary N FFT code
Message-ID: <slworkD30u4n.GMM@netcom.com>
Followup-To: comp.dsp,sci.image.processing
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
X-Newsreader: TIN [version 1.2 PL1]
References: <3fopac$n63@news.iastate.edu> <790963413snz@jkms.demon.co.uk>
Date: Thu, 26 Jan 1995 16:36:22 GMT
Lines: 30
Xref: glinda.oz.cs.cmu.edu comp.dsp:16207 sci.image.processing:12178

Mike Seabrook (mike@jkms.demon.co.uk) wrote:
: In article <3fopac$n63@news.iastate.edu>
:            dickw@iastate.edu "Richard Wallingford" writes:

: > Does anybody have a reference to some source code for an
: > arbitrary length FFT?

: The underlying trick of an FFT is to divide data repeatedly in half, until
: all that is left is a bunch of DFTs with just 2 points each.  That means
: that by definition you need to start with 2^N points (N integer).

Actually, an FFT can be done on any composite length sequence.  There is 
no requirement that the length be a power of two.  It's just that 
power-of-two sequences are the most efficient.  Also, most existing code 
is written for power-of-two FFT's and these are the lengths that most 
people understand and work with.

The best way to get an understanding of this is to look at how the 
length-18 FFT is done in Oppenheim & Schafer.

I did once write a program which would take any arbitrary length, factor 
it, and do an FFT in stages based on the prime factors.  A prime length 
transform would degenerate to a direct DFT.  For example, a 1024 point 
transform would take 20 milliseconds.  A 1023-point one (prime) would 
take 10 seconds.  Numbers with a lot of small factors do the best (i.e. 
648,729,768,800,864, etc.).

Unfortunately, I very likely will not be able to find this program or I 
would post it.  However, it's something that could be written in a couple 
of days by someone who understands FFT theory.
