Butterfly (FFT Algorithm)
   HOME

TheInfoList



OR:

In the context of
fast Fourier transform A fast Fourier transform (FFT) is an algorithm that computes the discrete Fourier transform (DFT) of a sequence, or its inverse (IDFT). A Fourier transform converts a signal from its original domain (often time or space) to a representation in ...
algorithms, a butterfly is a portion of the computation that combines the results of smaller
discrete Fourier transform In mathematics, the discrete Fourier transform (DFT) converts a finite sequence of equally-spaced Sampling (signal processing), samples of a function (mathematics), function into a same-length sequence of equally-spaced samples of the discre ...
s (DFTs) into a larger DFT, or vice versa (breaking a larger DFT up into subtransforms). The name "butterfly" comes from the shape of the
data-flow diagram A data-flow diagram is a way of representing a flow of data through a process or a system (usually an information system). The DFD also provides information about the outputs and inputs of each entity and the process itself. A data-flow diagram ha ...
in the radix-2 case, as described below.Alan V. Oppenheim, Ronald W. Schafer, and John R. Buck, ''Discrete-Time Signal Processing'', 2nd edition (Upper Saddle River, NJ: Prentice Hall, 1989) The earliest occurrence in print of the term is thought to be in a 1969
MIT The Massachusetts Institute of Technology (MIT) is a private research university in Cambridge, Massachusetts, United States. Established in 1861, MIT has played a significant role in the development of many areas of modern technology and sc ...
technical report. The same structure can also be found in the
Viterbi algorithm The Viterbi algorithm is a dynamic programming algorithm for obtaining the maximum a posteriori probability estimate of the most likely sequence of hidden states—called the Viterbi path—that results in a sequence of observed events. This i ...
, used for finding the most likely sequence of hidden states. Most commonly, the term "butterfly" appears in the context of the
Cooley–Tukey FFT algorithm The Cooley–Tukey algorithm, named after James Cooley, J. W. Cooley and John Tukey, is the most common fast Fourier transform (FFT) algorithm. It re-expresses the discrete Fourier transform (DFT) of an arbitrary composite number, composite size ...
, which
recursively Recursion occurs when the definition of a concept or process depends on a simpler or previous version of itself. Recursion is used in a variety of disciplines ranging from linguistics to logic. The most common application of recursion is in m ...
breaks down a DFT of
composite Composite or compositing may refer to: Materials * Composite material, a material that is made from several different substances ** Metal matrix composite, composed of metal and other parts ** Cermet, a composite of ceramic and metallic material ...
size ''n'' = ''rm'' into ''r'' smaller transforms of size ''m'' where ''r'' is the "radix" of the transform. These smaller DFTs are then combined via size-''r'' butterflies, which themselves are DFTs of size ''r'' (performed ''m'' times on corresponding outputs of the sub-transforms) pre-multiplied by
roots of unity In mathematics, a root of unity is any complex number that yields 1 when raised to some positive integer power . Roots of unity are used in many branches of mathematics, and are especially important in number theory, the theory of group char ...
(known as
twiddle factor A twiddle factor, in fast Fourier transform (FFT) algorithms, is any of the trigonometric constant coefficients that are multiplied by the data in the course of the algorithm. This term was apparently coined by Gentleman & Sande in 1966, and has ...
s). (This is the "decimation in time" case; one can also perform the steps in reverse, known as "decimation in frequency", where the butterflies come first and are post-multiplied by twiddle factors. See also the Cooley–Tukey FFT article.)


Radix-2 butterfly diagram

In the case of the radix-2 Cooley–Tukey algorithm, the butterfly is simply a DFT of size-2 that takes two inputs (''x''0, ''x''1) (corresponding outputs of the two sub-transforms) and gives two outputs (''y''0, ''y''1) by the formula (not including
twiddle factor A twiddle factor, in fast Fourier transform (FFT) algorithms, is any of the trigonometric constant coefficients that are multiplied by the data in the course of the algorithm. This term was apparently coined by Gentleman & Sande in 1966, and has ...
s): :y_0 = x_0 + x_1 \, :y_1 = x_0 - x_1. \, If one draws the data-flow diagram for this pair of operations, the (''x''0, ''x''1) to (''y''0, ''y''1) lines cross and resemble the wings of a
butterfly Butterflies are winged insects from the lepidopteran superfamily Papilionoidea, characterized by large, often brightly coloured wings that often fold together when at rest, and a conspicuous, fluttering flight. The oldest butterfly fossi ...
, hence the name (see also the illustration at right). More specifically, a radix-2 decimation-in-time FFT algorithm on ''n'' = 2 ''p'' inputs with respect to a primitive ''n''-th root of unity \omega^k_n = e^ relies on O(''n'' log2 ''n'') butterflies of the form: :y_0 = x_0 + x_1 \omega^k_n \, :y_1 = x_0 - x_1 \omega^k_n, \, where ''k'' is an
integer An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
depending on the part of the transform being computed. Whereas the corresponding inverse transform can mathematically be performed by replacing ''ω'' with ''ω''−1 (and possibly multiplying by an overall scale factor, depending on the normalization convention), one may also directly invert the butterflies: :x_0 = \frac (y_0 + y_1) \, :x_1 = \frac (y_0 - y_1), \, corresponding to a decimation-in-frequency FFT algorithm.


Other uses

The butterfly can also be used to improve the randomness of large arrays of partially random numbers, by bringing every 32 or 64 bit word into causal contact with every other word through a desired hashing algorithm, so that a change in any one bit has the possibility of changing all the bits in the large array.{{Citation , title=Numerical Recipes: The Art of Scientific Computing , last=Press , first=William H. , year=2007 , pages=358 , url=https://www.cambridge.org/ru/universitypress/subjects/mathematics/numerical-recipes/numerical-recipes-art-scientific-computing-3rd-edition , place=New York , publisher=Cambridge University Press , chapter=Section 7.2 Completely Hashing a Large Array , edition=3rd , isbn=978-0-521-88068-8 , last2=Teukolsky , first2=Saul A. , last3=Vetterling , first3=William T. , last4=Flannery , first4=Brian P.


See also

*
Mathematical diagram Mathematical diagrams, such as charts and graphs, are mainly designed to convey mathematical relationships—for example, comparisons over time. Specific types of mathematical diagrams Argand diagram A complex number can be visually repres ...
*
Zassenhaus lemma In mathematics, the butterfly lemma or Zassenhaus lemma, named after Hans Zassenhaus, is a technical result on the lattice of subgroups of a group (mathematics), group or the lattice of submodules of a module (mathematics), module, or more genera ...
*
Signal-flow graph A signal-flow graph or signal-flowgraph (SFG), invented by Claude Shannon, but often called a Mason graph after Samuel Jefferson Mason who coined the term, is a specialized Flow graph (mathematics), flow graph, a directed graph in which nodes rep ...


References


External links


explanation of the FFT and butterfly diagrams


FFT algorithms Diagrams