524 A Computational Introduction to Digital Image Processing, Second Edition
3. Butterfly the resulting elements four at a time, using the scaling factors 1, ω, ω
2
and
ω
3
, with ω = exp(2iπ/4)
4. Butterfly the resulting elements eight at a time, using the scaling factors 1, ω, ω
2
, . . . , ω
7
,
with ω = exp(2iπ/8)
5. And so on, until we butterfly all elements together using scaling factors ω
k
, with
ω = exp(2iπ/2
n
).
In practice, an FFT program will use a divide and conquer strategy: the initial vector is
broken up into smaller vectors, the algorithm is applied recursively to these smaller vectors,
and the results “butterflied” together.
There are many other forms of the FFT, but they all work by the same basic principle
of dividing the vector into shorter lengths. Clearly we will obtain the greatest speed f or
vectors whose lengths are a power of 2 (such as in the previous examples), but we can also
apply similar schemes to other lengths.