An Algorithm for the Machine Calculation of Complex Fourier Series

About this paperTiếng Việt中文

This paper is under a licence that does not allow it to be reproduced, so what is here is its front matter and a short abstract. Read it at the publisher's page.

English
日本語

By James W. Cooley and John W. Tukey

An efficient method for the calculation of the interactions of a 2m2^m factorial experiment was introduced by Yates and is widely known by his name. The generalization to 3m3^m was given by Box et al. [1]. Good [2] generalized these methods and gave elegant algorithms for which one class of applications is the calculation of Fourier series. In their full generality, Good’s methods are applicable to certain problems in which one must multiply an NN-vector by an N×NN \times N matrix which can be factored into mm sparse matrices, where mm is proportional to log⁡N\log N. This results in a procedure requiring a number of operations proportional to Nlog⁡NN \log N rather than N2N^2. These methods are applied here to the calculation of complex Fourier series. They are useful in situations where the number of data points is, or can be chosen to be, a highly composite number. The algorithm is here derived and presented in a rather different form. Attention is given to the choice of NN. It is also shown how special advantage can be obtained in the use of a binary computer with N=2mN = 2^m and how the entire calculation can be performed within the array of NN data storage locations used for the given Fourier coefficients.

Consider the problem of calculating the complex Fourier series

X(j)=∑k=0N−1A(k)⋅Wjk,j=0,1,⋯ ,N−1,X(j) = \sum_{k=0}^{N-1} A(k) \cdot W^{jk}, \qquad j = 0, 1, \cdots, N - 1,

where the given Fourier coefficients A(k)A(k) are complex and WW is the principal NNth root of unity,

W=e2πi/N.W = e^{2\pi i / N}.

A straightforward calculation using (1) would require N2N^2 operations where “operation” means, as it will throughout this note, a complex multiplication followed by a complex addition.

The algorithm described here iterates on the array of given complex Fourier amplitudes and yields the result in less than 2Nlog⁡2N2N \log_2 N operations without requiring more data storage than is required for the given array AA. To derive the algorithm, suppose NN is a composite, i.e., N=r1⋅r2N = r_1 \cdot r_2. Then let the indices in (1) be expressed

j=j1r1+j0,j0=0,1,⋯ ,r1−1,j1=0,1,⋯ ,r2−1,j = j_1 r_1 + j_0, \qquad j_0 = 0, 1, \cdots, r_1 - 1, \qquad j_1 = 0, 1, \cdots, r_2 - 1,
k=k1r2+k0,k0=0,1,⋯ ,r2−1,k1=0,1,⋯ ,r1−1.k = k_1 r_2 + k_0, \qquad k_0 = 0, 1, \cdots, r_2 - 1, \qquad k_1 = 0, 1, \cdots, r_1 - 1.

Then, one can write

X(j1,j0)=∑k0∑k1A(k1,k0)⋅Wj1r2Wj0k0.X(j_1, j_0) = \sum_{k_0} \sum_{k_1} A(k_1, k_0) \cdot W^{j_1 r_2} W^{j_0 k_0}.

Received August 17, 1964. Research in part at Princeton University under the sponsorship of the Army Research Office (Durham). The authors wish to thank Richard Garwin for his essential role in communication and encouragement.

Since

Wjk1r2=Wj0k1r2,W^{j k_1 r_2} = W^{j_0 k_1 r_2},

the inner sum, over k1k_1, depends only on j0j_0 and k0k_0 and can be defined as a new array,

A1(j0,k0)=∑k1A(k1,k0)⋅Wj0k1r2.A_1(j_0, k_0) = \sum_{k_1} A(k_1, k_0) \cdot W^{j_0 k_1 r_2}.

The result can then be written

X(j1,j0)=∑k0A1(j0,k0)⋅W(j1r1+j0)k0.X(j_1, j_0) = \sum_{k_0} A_1(j_0, k_0) \cdot W^{(j_1 r_1 + j_0) k_0}.

There are NN elements in the array A1A_1, each requiring r1r_1 operations, giving a total of Nr1Nr_1 operations to obtain A1A_1. Similarly, it takes Nr2Nr_2 operations to calculate XX from A1A_1. Therefore, this two-step algorithm, given by (6) and (7), requires a total of

T=N(r1+r2)T = N(r_1 + r_2)

operations.

It is easy to see how successive applications of the above procedure, starting with its application to (6), give an mm-step algorithm requiring

T=N(r1+r2+⋯+rm)T = N(r_1 + r_2 + \cdots + r_m)

operations, where

N=r1⋅r2⋯rm.N = r_1 \cdot r_2 \cdots r_m.

If rj=sjtjr_j = s_j t_j with sj,tj>1s_j, t_j > 1, then sj+tj<rjs_j + t_j < r_j unless sj=tj=2s_j = t_j = 2, when sj+tj=rjs_j + t_j = r_j.

In general, then, using as many factors as possible provides a minimum to (9), but factors of 2 can be combined in pairs without loss. If we are able to choose NN to be highly composite, we may make very real gains. If all rjr_j are equal to rr, then, from (10) we have

m=log⁡rNm = \log_r N

and the total number of operations is

T(r)=rNlog⁡rN.T(r) = rN \log_r N.

If N=rmsntp⋯N = r^m s^n t^p \cdots, then we find that

TN=m⋅r+n⋅s+p⋅t+⋯ ,\frac{T}{N} = m \cdot r + n \cdot s + p \cdot t + \cdots,
log⁡2N=m⋅log⁡2r+n⋅log⁡2s+p⋅log⁡2t+⋯ ,\log_2 N = m \cdot \log_2 r + n \cdot \log_2 s + p \cdot \log_2 t + \cdots,

so that

TNlog⁡2N\frac{T}{N \log_2 N}

is a weighted mean of the quantities

rlog⁡2r,slog⁡2s,tlog⁡2t,⋯ ,\frac{r}{\log_2 r}, \quad \frac{s}{\log_2 s}, \quad \frac{t}{\log_2 t}, \cdots,

whose values run as follows

rrlog⁡2r\frac{r}{\log_2 r}
22.00
31.88
42.00
52.15
62.31
72.49
82.67
92.82
103.01.

The use of rj=3r_j = 3 is formally most efficient, but the gain is only about 6% over the use of 2 or 4, which have other advantages. If necessary, the use of rjr_j up to 10 can increase the number of computations by no more than 50%. Accordingly, we can find "highly composite" values of NN within a few percent of any given large number.

Whenever possible, the use of N=rmN = r^m with r=2r = 2 or 4 offers important advantages for computers with binary arithmetic, both in addressing and in multiplication economy.

The algorithm with r=2r = 2 is derived by expressing the indices in the form

j=jm−1⋅2m−1+⋯+j1⋅2+j0,j = j_{m-1} \cdot 2^{m-1} + \cdots + j_1 \cdot 2 + j_0,
k=km−1⋅2m−1+⋯+k1⋅2+k0,k = k_{m-1} \cdot 2^{m-1} + \cdots + k_1 \cdot 2 + k_0,

where jvj_v and kvk_v are equal to 0 or 1 and are the contents of the respective bit positions in the binary representation of jj and kk. All arrays will now be written as functions of the bits of their indices. With this convention (1) is written

X(jm−1,⋯ ,j0)=∑k0∑k1⋯∑km−1A(km−1,⋯ ,k0)⋅Wjkm−1⋅2m−1+⋯+jk0,X(j_{m-1}, \cdots, j_0) = \sum_{k_0} \sum_{k_1} \cdots \sum_{k_{m-1}} A(k_{m-1}, \cdots, k_0) \cdot W^{jk_{m-1} \cdot 2^{m-1} + \cdots + jk_0},

where the sums are over kv=0,1k_v = 0, 1. Since

Wjkm−1⋅2m−1=Wj0km−1⋅2m−1,W^{jk_{m-1} \cdot 2^{m-1}} = W^{j_0 k_{m-1} \cdot 2^{m-1}},

the innermost sum of (15), over km−1k_{m-1}, depends only on j0,km−2,⋯ ,k0j_0, k_{m-2}, \cdots, k_0 and can be written

A1(j0,km−2,⋯ ,k0)=∑km−1A(km−1,⋯ ,k0)⋅Wj0km−1⋅2m−1.A_1(j_0, k_{m-2}, \cdots, k_0) = \sum_{k_{m-1}} A(k_{m-1}, \cdots, k_0) \cdot W^{j_0 k_{m-1} \cdot 2^{m-1}}.

Proceeding to the next innermost sum, over km−2k_{m-2}, and so on, and using

Wj⋅km−l⋅2m−l=W(jl−1⋅2l−1+⋯+j0)km−l⋅2m−l,W^{j \cdot k_{m-l} \cdot 2^{m-l}} = W^{(j_{l-1} \cdot 2^{l-1} + \cdots + j_0) k_{m-l} \cdot 2^{m-l}},

one obtains successive arrays,

Al(j0,⋯ ,jl−1,km−l−1,⋯ ,k0)A_l(j_0, \cdots, j_{l-1}, k_{m-l-1}, \cdots, k_0)
=∑km−lAl−1(j0,⋯ ,jl−2,km−l,⋯ ,k0)⋅W(jl−1⋅2l−1+⋯+j0)⋅km−l⋅2m−l= \sum_{k_{m-l}} A_{l-1}(j_0, \cdots, j_{l-2}, k_{m-l}, \cdots, k_0) \cdot W^{(j_{l-1} \cdot 2^{l-1} + \cdots + j_0) \cdot k_{m-l} \cdot 2^{m-l}}

for l=1,2,⋯ ,ml = 1, 2, \cdots, m.

Writing out the sum this appears as

Al(j0,⋯ ,jl−1,km−l−1,⋯ ,k0)A_l(j_0, \cdots, j_{l-1}, k_{m-l-1}, \cdots, k_0)
=Al−1(j0,⋯ ,jl−2,0,km−l−1,⋯ ,k0)= A_{l-1}(j_0, \cdots, j_{l-2}, 0, k_{m-l-1}, \cdots, k_0)
+(−1)jl−1ijl−2Al−1(j0,⋯ ,jl−2,1,km−l−1,⋯ ,k0)+ (-1)^{j_{l-1}} i^{j_{l-2}} A_{l-1}(j_0, \cdots, j_{l-2}, 1, k_{m-l-1}, \cdots, k_0)
⋅W(jl−3⋅2l−3+⋯+j0)⋅2m−l,jl−1=0,1.\cdot W^{(j_{l-3} \cdot 2^{l-3} + \cdots + j_0) \cdot 2^{m-l}}, \quad j_{l-1} = 0, 1.

According to the indexing convention, this is stored in a location whose index is

j0⋅2m−1+⋯+jl−1⋅2m−l+km−l−1⋅2m−l−1+⋯+k0.j_0 \cdot 2^{m-1} + \cdots + j_{l-1} \cdot 2^{m-l} + k_{m-l-1} \cdot 2^{m-l-1} + \cdots + k_0.

It can be seen in (20) that only the two storage locations with indices having 0 and 1 in the 2m−l2^{m-l} bit position are involved in the computation. Parallel computation is permitted since the operation described by (20) can be carried out with all values of j0,⋯ ,jl−2j_0, \cdots, j_{l-2}, and k0,⋯ ,km−l−1k_0, \cdots, k_{m-l-1} simultaneously. In some applications* it is convenient to use (20) to express AlA_l in terms of Al−2A_{l-2}, giving what is equivalent to an algorithm with r=4r = 4.

The last array calculated gives the desired Fourier sums,

X(jm−1,⋯ ,j0)=Am(j0,⋯ ,jm−1)X(j_{m-1}, \cdots, j_0) = A_m(j_0, \cdots, j_{m-1})

in such an order that the index of an XX must have its binary bits put in reverse order to yield its index in the array AmA_m.

In some applications, where Fourier sums are to be evaluated twice, the above procedure could be programmed so that no bit-inversion is necessary. For example, consider the solution of the difference equation,

aX(j+1)+bX(j)+cX(j−1)=F(j).aX(j + 1) + bX(j) + cX(j - 1) = F(j).

The present method could be first applied to calculate the Fourier amplitudes of F(j)F(j) from the formula

B(k)=1N∑jF(j)W−jk.B(k) = \frac{1}{N} \sum_j F(j) W^{-jk}.

The Fourier amplitudes of the solution are, then,

A(k)=B(k)aWk+b+cW−k.A(k) = \frac{B(k)}{aW^k + b + cW^{-k}}.

The B(k)B(k) and A(k)A(k) arrays are in bit-inverted order, but with an obvious modification of (20), A(k)A(k) can be used to yield the solution with correct indexing.

A computer program for the IBM 7094 has been written which calculates three-dimensional Fourier sums by the above method. The computing time taken for computing three-dimensional 2a×2b×2c2^a \times 2^b \times 2^c arrays of data points was as follows:

  • A multiple-processing circuit using this algorithm was designed by R. E. Miller and S. Winograd of the IBM Watson Research Center. In this case r=4r = 4 was found to be most practical.
abcNo. Pts.Time (minutes)
4432^{11}.02
11002^{11}.02
4442^{12}.04
12002^{12}.07
5442^{13}.10
5532^{13}.12
13002^{13}.13

IBM Watson Research Center Yorktown Heights, New York

Bell Telephone Laboratories, Murray Hill, New Jersey

Princeton University Princeton, New Jersey

  1. G. E. P. Box, L. R. Connor, W. R. Cousins, O. L. Davies (Ed.), F. R. Hirnsworth & G. P. Silitto, The Design and Analysis of Industrial Experiments, Oliver & Boyd, Edinburgh, 1954.
  2. I. J. Good, "The interaction algorithm and practical Fourier series," J. Roy. Statist. Soc. Ser. B., v. 20, 1958, p. 361-372; Addendum, v. 22, 1960, p. 372-375. MR 21 1674; MR 23 A4231.

複素フーリエ級数の機械計算のためのアルゴリズム

James W. Cooley and John W. Tukey による

2m2^m要因実験の交互作用を計算する効率的な方法はYatesによって導入され、広く彼の名で知られている。3m3^mへの一般化はBox et al. [1]によって与えられた。Good [2]はこれらの方法を一般化し、その応用の一分野としてフーリエ級数の計算に用いることのできる優れたアルゴリズムを与えた。Goodの方法はその最も一般的な形では、NN-ベクトルに、mm個の疎行列に因数分解できるN×NN \times N行列を乗算しなければならないある種の問題に適用できる。ただし、mmはlog⁡N\log Nに比例する。この結果、N2N^2ではなくNlog⁡NN \log Nに比例する数の演算を必要とする手続きが得られる。ここではこれらの方法を複素フーリエ級数の計算に適用する。これはデータ点の数が非常に合成数である場合、またはそのように選択できる場合に有用である。ここではアルゴリズムをかなり異なる形で導出し、提示する。NNの選択についても考察する。また、N=2mN = 2^mとした二進コンピューターを使用することで特別な利点が得られること、および与えられたフーリエ係数に用いるNN個のデータ記憶場所からなる配列内だけで計算全体を実行できることを示す。

複素フーリエ級数を計算する問題を考える。

Read off the page by a vision model reading the page images using olmOCR-2-7B-1025-FP8.

Read off the page by a vision model reading the page images using olmOCR-2-7B-1025-FP8. Translated into 日本語 by gpt-5, against glossary version 6. Translated from the English.