Re: FFT for N Not a Power of 2
- From: "Steven G. Johnson" <stevenj@xxxxxxxxxxxx>
- Date: Sat, 22 Nov 2008 09:34:26 -0800 (PST)
On Nov 21, 12:36 pm, Phil Hobbs
<pcdhSpamMeSensel...@xxxxxxxxxxxxxxxxxx> wrote:
You're only stuffed if you're Tukey. ;) The fast algorithsm for prime N
iiuc involve taking two different chirp-Z transforms in a row, but
they're still N log N algorithms, like the Cooley-Tukey and Sande-Tukey
algorithms.
Actually, the chirp-Z algorithm is not a transform, it is an algorithm
to express either a DFT or a more general Z transform in terms of a
convolution of the same length, which can then be zero-padded and
evaluated via a pair of FFTs of longer composite length. (Google
"Bluestein's FFT algorithm"). There is also Rader's algorithm for
DFTs of prime N, which turn it into a convolution of (composite) size
N-1, via some number theory on the indices (google "Rader's FFT
algorithm"). But you're right that these algorithms, while O(N log
N), are typically several times slower than algorithms for nearby
highly-composite sizes.
As another poster pointed out, if N is a power of 2, the fastest
implementations (at least on general-purpose CPUs with caches etc)
typically do not use a classic radix-2 algorithm, but instead use
larger radices (see http://cnx.org/content/m16336/latest/ for some
explanations of why). Also, it is no longer the case that power-of-
two N's are necessarily the most efficient; any highly-composite Ns
(with prime factors < 10, say) can be transformed with similar
efficiency with an optimized library, so padding to a power of two is
not necessarily desirable. e.g. with FFTW on my Intel Core 2, n=3840
is faster than n=4096.
But I agree that this is all probably off-topic relative to the OP's
problem.
Regards,
Steven G. Johnson
.
- References:
- FFT for N Not a Power of 2
- From: W. eWatson
- Re: FFT for N Not a Power of 2
- From: Phil Hobbs
- Re: FFT for N Not a Power of 2
- From: Bill Davy
- Re: FFT for N Not a Power of 2
- From: Phil Hobbs
- FFT for N Not a Power of 2
- Prev by Date: Re: FFT for N Not a Power of 2
- Next by Date: Re: Joulu juttu
- Previous by thread: Re: FFT for N Not a Power of 2
- Next by thread: Re: FFT for N Not a Power of 2
- Index(es):
Relevant Pages
|