KN - 1969 Mixed

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Introduction

ThefastFouriertransform(FFT)algorithm is an
efficient method for computing the transformation
n- 1

An Algorithm for ah =
j=O
z j exp (i2rrjkln) (1)

Computing for k=O, 1, . . , n-1, where { x j ) and ( a k ) areboth


complex-valued. The basic ideaof the current formof the
the Mixed Radix Fast fast Fourier transform algorithm, thatof factoring n,
Fourier Transform n = n m
nit
i=l

RICHARD C. SINGLETON, Senior Member, IEEE and then decomposing the transform into m steps with
Stanford Research Institute n/ni transformations of size ni within each step,is that of
Menlo Park, Calif. 94025 Cooley and Tukey [l]. Most subsequent authors have
directed their attentiontothe special case of n= 2m.
Explanation and programming are simpler nfor = 2m than
Abstract for the generalcase, and the restricted choice of values of
This paper presents an algorithmfor computing the fast Fourier n is adequate for a majority of applications. There are,
transform, based on a method proposed by Cooley and Tukey. As in however, some applications in which a wider choice of
their algorithm, the dimension n of the transform is factored (if possi- values of n is needed. The author has encountered this
ble), and n/p elementary transforms of dimension p are computed for need in spectral analysis of speech and economic time
each factor p of n. An improved method of computing a transform step series data.
corresponding to an odd factor of n is given; with this method, the
Gentleman and Sande [ 2 ] have extended the develop-
ment of the general case and describe possible variations
number of complex multiplicatiops for an elementary transform of di-
in organizing the algorithm. They mention the existence
mension p is reduced from (p-1)2 to (p-1)2/4 for odd p. The fast
of a mixed radix F F T program written by Sande. Avail-
Fourier transform, when computed in place, requires a final permuta- ablemixedradix programs include onein ALGOL by
tion step to arrange the results in normal order. This algorithm in- Singleton [3] and another in FORTRAN by Brenner [4].
cludes an efficient method for permuting the results in place. The al- A FORTRAN program based on the algorithm discussed
gorithm is described mathematically and illustrated by a FORTRAN here is included in Appendix I; this program was com-
subroutine. pared with Brenner’s on several computers (CDC 6400,
CDC 6600, IBM360/67, andBurroughs B5500) and
found to besignificantly faster.

The Mixed Radix FFT

The complex Fourier transform (1) can be expressed


as a matrix multiplication
CY = Tx,
where Tis ann X n matrix of complex exponentials
tjk = exp (i27rjkln).
In decomposing the matrix T, we use the factoring of
Sande [ 2 ] , rather than the original factoring of Cooley
[l]. However, if the data are first permuted to digit-
reversed order and then transformed, Cooley’s factoring
leads to anequally efficient algorithm.
In computing the fast Fourier transform, we factor T
as
T PFmFm-l * . * F2F1,

Manuscript received December 2, 1968. where Fiis the transform step correspondingto the factor
This work was supported by Stanford Research Institute, out of ni of n and P is a permutation matrix. The matrixFi has
Research and Development funds. only n i nonzero elements in each row and column and

IEEE TRANSACTIONS ON AUDIO AND ELECTROACOUSTICS VOL. AU-17,NO. 2 JUNE 1969 93

Authorized licensed use limited to: Escuela Superior de Ingeneria Mecanica. Downloaded on November 23, 2009 at 18:11 from IEEE Xplore. Restrictions apply.
can be partitioned into n/ni square submatrices of dimen- and
sion ni; it is this partition and the resulting reduction in
multiplications that is the basis forthe FFT algorithm. .i' = j1n6n5 * - nl + . i m n 4 . * ?a1 + j5n4n3n2n1
The matrices Fi can be
further
factored
to yield + j4n3n2nl + j3nlnl + j6nl $- j6.

The permutation P1 in this case leaves each result ele-


ment in its correct segment of length. n/n1n2,grouped in
where Ri is a diagonal matrix of rotation factors (called subsequences of nln2 consecutive elements. The permuta-
twiddle factors by Gentleman and Sande 121) and Tican tion P 2 then completes the reordering by permuting the
bepartitionedinto n/ni identicalsquaresubmatrices, n3n4n5 subsequences within each segment of length
each the matrixofa complex Fourier transform of dimen- n/nln2. In the FORTRAN subroutine given in Appendix I,
sion ni. Although it might appear that this stepincreases Pzis done by first determining the permutation cycles for
the number of complex multiplications, it in fact enables digit reversal of the digits corresponding to the square-
us to exploittrigonometricfunction symmetries and free factors,thenpermutingthe data following these
multipliers of simple form(e.g., eiT, eirr!O,and eiTli) in cycles. The permutation can be done using as few as two
computing Ti that more than compensate for the fewer elements of temporary storage to hold a single complex
than n multiplications in applying the rotation Ri. This result, but the program uses its available array space to
point will bediscussed furthe1 in later sections. permute the subsequences of length nln2 if possible.
The permutationP is required because the transformed
result is initially in digit-reversed order, i.e., the Fourier
coefficient a j ,with The Rotation Factor
. .
a = MLI~,--Z . . nl +
.* j m + j ~ , + In the previous section, we described the factoring of
the transform step B , corresponding to a factor ni of n,
is found in location into a product RiTi of a matrixTi of n/ni identical Fourier
transforms of dimension ni and a diagonal rotation factor
-
j' = j m n , . n, j2n,n4 . n, + +j,, e +- -
matrix Ri. Here we specify the elements of Ri for the Sande
version of the FFT.
As mentioned previously by the author [SI, the permuta- The rotation factor R ifollowing the transform step Ti
tion may be performed in place by pair interchanges if n has diagonal elements
is factoredso that
ni = n,-i
r j = exp i--2 x ( j mod k)[-;----]]
j mod kk {
IC 12
for i<n-i. In this case, we can count j in natural order
and j' in digit-reversed order, then exchange ai and air if forj=O, 1, . . , n-1 where a

j<j'. This method is a generalization of a well-known I; = n/n,n, . * ?ai and ldc = nik,
method for reordering the radix-2 FFT result.
Before computing the Fourier transform, we first de- and the squarebrackets [ ] denotethegreatest integer
compose n into its prime factors. The square factors are < the enclosed quantity. The rotation factors multiply-
-
arranged symmetrically about the factors of the square- ing each transform of dimension ni within Tihave angles
free portion of n. Thus n = 270 is factored as
0, e, 20, . . . (ni- 110,
3X2X3X5X3.
where 0 may differ from one transform to another. No
Then the permutationP is factored into two steps, multiplication is needed for the zero angle, thus there are
at most
P = PZP1.
n(ni - l)/%
The permutation P1 is associated with the square factors
of n and is done by pair interchanges as described above, complex multiplications to applytherotationfactor
except that the digits of n corresponding to the square- following thetransformstep Ti.Inaddition, e= 0 for
free factors are held constant and the digitsof the square (jmod k ) = 0 o r 0'mod kk) = 0, allowing the number of
factors areexchanged symmetrically. Thus if complex multiplications to be reduced by

n = n1n2n3n?n~n~n7 (n1 - 1) + n l ( m - I) + n1n2(n3 - 1)


with n s = n i , I 7 2 = ? l 5 , and n3, na, and n5 are relatively
+ e a + nln2 . . n,-l(n,
e - 1) = n - 1 ,
prime, we interchange We note that the number of rotation factor multiplica-
j = jjn5n, . ' . nl + j5n6n4 . , 1 n1 + jjn4n3n2n1 tions is independent of the order of a.rrangement of the
factors of n. The final rotation factor R, has 0 = 0 for all
+j4n3nzn1 + j a n m + j2n1 + jl elements, and
thus is omitted.

94 IEEE TRANSACTIONS ON AUDIO AND ELECTROACOUSTICS JIJNE 1969

Authorized licensed use limited to: Escuela Superior de Ingeneria Mecanica. Downloaded on November 23, 2009 at 18:11 from IEEE Xplore. Restrictions apply.
Counting Complex Multiplications mn(p - l ) z
_____
A complex multiplication, requiring four real multipli- 4P
cations and two real additions,is a relatively slow opera- complex multiplications. Adding the
tion on most computers.' To a first approximation, the
speed of an FFT algorithm is proportional to the number mn(P - 1)
- - (n- 1)
of complex multiplications used. The number of times we P
index through the data array is, however, an important multiplications for rotation factors, we obtain a total of
secondary factor.
Using the results of the previous section, the number of mn(P - 1)(P
---__--- 3) -
(n - 1)
+
complex multiplications for the rotation factors Riis 4P
2
n h - 1)
(n - 11,
complex multiplications for a radix-p transform. Since p
is assumed here to be an odd prime, we have no I otations
i=l ni with 0 an integer multiple of n/4 to reduce further the
assuming we avoid multiplication for allrotations of zero number of complex multiplications.
angle. To this number we must add the multiplications The ratio of the number of complex multiplications to
for the transform steps Ti. n logz n can serve as a measure of relative efficiency for
For n a power of 2, we note that a complex Fourier the mixed radix FFT. The resultsof this section, neglect-
transform of dimension 2 or 4 can be computed without ing the reduction by n- 1 for B= 0, yield the following
multiplication and that a transform of dimension 8 re- comparison:
quires only two real multiplications, equivalent to one-
half a complex multiplication. Going one step further, a Radix Relative Efficiency
transform of dimension 16, computed as two factors of 2 0.500
4, requires the equivalent of six complex multiplications. 4 0.375
Combining these results with the number of rotation fac- 8 0.333
16 0.328
tor multiplications and assuming that n = 2" is a power of 3 0.631
the radix, the total number of complex multiplications is 5 0.689
as follows: 7 0.763
11 0.920
13 0.998
Radix
Number of Complex
Multiplications 17 1.151
- 19 1 ,227
2 mn/2 - (n- 1) 23 1.374
4 3rnn/8 - (n- 1)
8 mn/3 - ( n - 1)
16 21mn/64-(n-1) The general term for an odd primep is
+
-I(_P_--.- I ) ( P 3 )
These results have been given previously by Bergland [ 6 ] . 4PlOgz ( P )
The savings for 16 over 8 is small, considering the added
complexity of thealgorithm. As Berglandpoints out, Decomposition of a ComplexFourierTransform
radix 8, with provision for an additional factor of 4 or 2, In theprevious section, we promised to show that a com-
is a good choice for anefficient F F T program for powers plex transform of dimension p , for p odd, can be com-
of 2. For themixed radix FFT, we transform with factors putedwith(p- l)z realmultiplications.Considerthe
of 4 whenever possible, but also provide for factors of 2 . complex transform
We now consider the number of complex multiplica-
tions for aradix-ptransform of n=pm complex data
values, wherep is an oddprime. While at first it might ap-
pear that an elementarytransform of dimension p re-
quires @- l)z complex multiplications, we show in the
next section that (p- 1)2 realmultiplications suffice,
equivalent to (p- 1)2/4 complex multiplications. This re-
sult holds, in fact, for any odd value ofp. Thus the trans-
form steps forn=pm require the equivalentof

1 G. Golub(privatecommunication)haspointedoutthat a
complexmultiplication can alternatively be done with three real
multiplications and five real additions, asindicated by the following:
(a+ib).(c+id)= [(a+b)~(c-d)fa~d-b~c]+i[a~d+b~c].
This method does not appear advantageous for FORTRAN coding,
as the numberof statements is increased from two to four.

SINGLETON : ALGORITHM FOR MIXED RADIX FFT 95

Authorized licensed use limited to: Escuela Superior de Ingeneria Mecanica. Downloaded on November 23, 2009 at 18:11 from IEEE Xplore. Restrictions apply.
For even values of p , a decomposition similar to the
above yields 4(p/2- 1) series to sum, each with (p/2- 1)
multiplications. Thus a complex Fourier transform for p
even can be computed with at most ( ~ - 2 )real
~ rnultipli-
cations. For p > 2, we know that this result can be im-
proved. Combining results for the odd and even cases, we
can state that a Fourier transform of dimension p can be
computed with the equivalent of

["I'2
for k=O, 1, . . , p - I , We note first that or fewer complex multiplications, where thesquare
brackets [ ] denotethelargest integer value 5 the en-
+ ibo +
P- 1
closed quantity.
ao = (xi i y j )
j=O

is computedwithoutmultiplications. The remaining A Method for Computing Trigonometric Function Values


Fourier coefficients can beexpressed as The trigonometricfunction values used in the fast
Fourier transform can all be represented in terms of in-
ai, = Uk+ - ak-"
teger powers of
ap-k = akf + ai;- exp ( i 2 ~ / n ) ,
bk = bk+ + bk-
the nth root of unity. Since we often use a sequence of
bp-k = bk+ - bk-.. equally spaced values on the unitcircle, it is useful to have
accurate methods of generating them by complex multi-
for k = 1, 2, e . . , ( p - 1)/2, where
plication, rather than by repeated use of the library sine
and cosine functions.For very short sequences, we use the
simple method
&+I = F~zexp (io),
where
Eo = I

and { ] is the sequence of computed values exp (ik8).


This method suffers, however, from rapid accumulation
of round-off errors. A better method, proposed by the
author in an earlier paper [SI, is to use the difference
equation
Altogetherthereare 2@- 1) series to sum,each with Fk+l = ik + ?ti,,
(p- 1)/2 multiplications, for a total of (p- 1)' real multi- where the multiplier
plications.
?I = exp ( 9 ) - I
For p an odd prime and for fixedj, the multipliers
= 2i sin (8/2) exp (i8/2)
cos (2xjk,/p) fork = 1,2, s . ( p - 1)/2 = - 2 sin2 (8/2) + i sin (8)
have no duplications of magnitude, thus no further re- decreases in magnitude with decreasing 8. This method
ductioninmultiplicationsappears possible.2 The same gives good accurcay on a computer using rounded float-
condition holds for the multipliers ing-pointarithmetic (e.g., theBurroughs B5500). How-
ever, with truncated arithmetic (as on the IBM 360/67),
sin ( 2 x j k / p ) for lc = I, 2 , . . ( p - 1),/2.
the value of Ek tends to spiral inward from the unit circle
with increasing k .
C. AM. Rader(privatecommunication) hasproposed an al- In Table I,we show the accumulated errors from extrap-
ternative decomposition ofa Fouriertransform ofdimension 5 ,
using the equivalent of 3 complexmultiplications (12 real multi- olating to x / 2 in 2i, increments, using rounded arithmetic
plications)instead of the 4 complexmultiplications used in the (machine language) and truncated arithmetic (FORTRAN)
algorithm described in this paper. In Appendix I11 we give a on a CDC 6400 computer; identical initial values, from
FORTRAN coding of Rader's method. When substituted in subroutine
F F T (Appendix I), times were unchanged on the CDC 6600 com- the library sine and cosine functions, were used in com-
puter and improved by about 5 percent for radix4 transforms on puting the results in each of the three pairs of columns.
the CDC 6400 computer (the 6400 has a relatively slower multiply In examining the second pair of columns, we find that the
operation).Rader'smethodlooksadvantageous forcoding in
machine language on a computer having multiple arithmetic regis- angle after 2b extrapolation steps is very close to ~ / 2 but
,
ters available for temporary storage of intermediate results. that the magnitude has shrunk through truncation. To

96 IEEE TRANSACTIONS ON AUDIO AND ELECTROACOUSTICS JUNE 1969

Authorized licensed use limited to: Escuela Superior de Ingeneria Mecanica. Downloaded on November 23, 2009 at 18:11 from IEEE Xplore. Restrictions apply.
TABLE I
Extrapolated Values of cos n/2 and sin n/2- 1 on a CDC 6400 Computer, Using Rounded and Truncated Arithmetic Operations
(Values in Units of 1 O-I4)

Truncated
Arithmetic
Truncated
Arithmetic
Rounded Arithmetic
Number
Correction of Without
WithCorrection Correction
Without
Extrapolations __-
cos 712 sin n/2 - 1 cos n/2 sin n/2- 1 cos n/2 sin n/2- 1

24 2.8 2.6 -3.6 0 . 0 2.9 -0.4


-0.7 26 3.0 -0.4
-0.4 26 4.1 2.5 -13.1
0.0 3.8
- 0 . 7 27 5.1 -0.4
- 0 . 725 2.7 -0.4
-1.129 4.9 -0.4
-1.1210 8.8 -0.4
2.1 211 14.2 0.0 -0.4
-0.4
212 13.2
-0.4213 -0.2 -0.4
-9.6 2141 . 4 -7.4 - 3440.1- 0 . 4 1.2
-1.8216 -10.3 -0.4
2.8 216 19.8 4.4 --0.4
13707.1 -33.3
5.7
217 18.7 -27416.7
-0.4 3.5

compensate for thisshrinkage, we modify theabove accuracy is small. The subroutinesin Appendixes I and I1
method to restore the extrapolated value to unit magni- include comment cards indicating the changes to remove
tude. We first compute a trialvalue the rescaling. On the other hand, the number of multipli-
cationsmay be reduced by onewhenusing truncated
Yk = tk -k r t k arithmetic, through using the overcorrection multiplier
where
= 2 - YkYk*.
7 = - 2 sin2 ( 0 / 2 ) + i sin (e) 8k

In this case, the truncation bias stabilizes a method that


and
mathematically borderson instability. Onthe CDC
to = 1, 6400 computer, this multiplier gives comparable accuracy
then multiply by a scalar to the multiplier suggested above.

A FORTRAN Subroutine for the Mixed Radix FFT


where
In Appendix I, we list a FORTRAN subroutine for com-
putingthemixedradix FFT orits inverse, using the
algorithmdescribedabove.This subroutinecomputes
to obtain the new value. Since ykyk* is very close to 1, we either a single-variate complex Fourier transform or the
can avoid the library square-root function and use the calculation for one variate of a multivariate transform.
approximation To compute a single-variate transform (1)of n data
values,
61, = -(--
1
2
1
YkYk*
+ 1) CALL FFT(A, B, n, n, n, 1).
Or if division is more costly than multiplication, we can The “inverse”transform
alternatively use the approximation n- 1

81, = 3(3 - Y k Y k * ) . xi = CYk exp (- i27rj/c/n>


k=O
O n the CDC 6400 computer, both approximations give is computed by
the results shownin the third pair of columns of Table I.
This rescaling of magnitude uses four real multiplications CALL FFT(A, B , n, n, n, - 1).
and a divide (or five real multiplications) in addition to
the four real multiplicationsto compute the trialvalue of Scaling is left to the user. The two calls in succession give
Y k . However, on most computers, these calculations will the transformation
take less time than computing the values using the library T*Tx = nx,
trigonometric function.
The added step of rescaling the extrapolated trigono- i.e., n times the original values, except for round-off er-
metric function values to the unit circle can also be used rors. The arrays A and B originally hold the real and
when computing with rounded arithmetic, but the gain in imaginary components of the data, indexed from 1 to n ;

SINGLETON : ALGORITHM FOR MIXED RADIX FFT 97

Authorized licensed use limited to: Escuela Superior de Ingeneria Mecanica. Downloaded on November 23, 2009 at 18:11 from IEEE Xplore. Restrictions apply.
the data values are replaced by the complex Fourier co- loss in efficiency compared with the present algorithm. In
efficients. Thustherealcomponent of CY^ is found in the ALGOL algorithm, the Cooley version of the FFT al-
A ( k + l ) , and the imaginary component in B(k+ I), for gorithm is used, with a simulated recursive structure;
k=O, 1, * . , n-1. rotation factor multiplicationis included within the trans-
The difference between the transform and inverse cal- form phase, requiring two additional arrays with dimen-
culation is primarily one of changing thesign of a variable sion equal to the largest prime factor in n. The transform
holding the value 27~.The one additional change is to method for odd factors islike that used here. The permu-
follow an alternative path within the radix-4 section of tation for square factors of n also has a simulated recur-
the program, using the angle - x / 2 rather than ~ / 2 . sive structure, with one level of “recursion”for each
The use of the subroutine for multivariate transforms is square factor in 1 2 ; in the present algorithm, this permuta-
described in the comments at the beginning of the pro- tion is consolidated into a single step. The permutation
gram. To compute a bivariate transform on data stored forsquare-freefactors is identicalinbothalgorithms.
in rectangular arrays A and B, the subroutine is called The ALGOL algorithm contains a number of dynamic ar-
once to transform the columns and again to transform rays, which is an obstacle to translation to FORTRAN. On
the rows. A multivariate transform is essentially a single- the other hand, the FORTRAN subroutine given here can
variate transform with modified indexing. easily be translated to ALGOL,with the addition of dy-
Thesubroutine as listed permits a maximumprime namic upper bounds on all arrays other than NFAC; in
factor of23, using fourarrays of thisdimension. The making this translation, it would be desirable to modify
dimension of these arrays may be reduced to 1 if IZ con- the data indexing to go from 0 to 12- 1 to correspond with
tains no prime factors greater than 5. An array NP(209) is the mathematical notation.
used in permuting the results to normal order; the present
value permits a maximum of 210 for the product of the
Timing and Accuracy
square-free factors of n. If n contains at most one square-
free factor, the dimension of this array can be reduced to The subroutine FFT was tested for time and accuracy
j+ I , wherej is the maximum number of prime factors of on a CDC 6400 computer at Stanford Research Institute.
n. A sixth arrray NFAC(11) holds the factors of n. This is The results are shown in Table 11. The times are central
ample for any transform that can be done on a computer processor times, which are measured with 0.002 second
with core storage for 217 real values (216 complex values); resolution; the times measured on successive runs rarely
differ by more than 0.002 to 0.004 second. Furthermore,
52488 = 2 X 34 X 2 X 34 X 2
calling the subroutine with 12-2 yields a timing result of
is the only number < 21Gwith as many as 11 factors, given 0 or 0.002 second; thus the time is apparently measured
the factoring used in this algorithm. The existing array with negligible bias.
dimensions do not permit unrestricted choice of M, but The dataused in the trialswere random normal deviates
they rule out only a very small percentage of the possible with a mean of zero and a standard deviation of one (Le.,
values. an expected rms value of one). The subroutine was called
The transform portion of the subroutine includes sec- twice :
tions for factors of 2, 3, 4,and 5, as well as a general sec-
CALL FFT(A, B , n, n, n, 1)
tionforoddfactors.The sections for 2 and 4 include
multiplication of each result value by the rotation factor; CALL FFT(A, B, n, ?I,,n, - 1);
combining the two steps gives about a 10 percent speed
improvement over using the general rotation factor sec- then the result was scaled by l / n . The squared deviations
tion in the program, due to reduced indexing. The sec- from the original data values were summed, the real and
tions for 3 and 5 are similar to the general odd factors imaginaryquantitiesseparately,then divided by n and
section, and they improve speed substantially for these square roots taken to yield an rms error value. The two
factors by reducing indexing operations. The odd factors values were in all cases comparable in magnitude, and an
section is used for odd primes > 5, but can handle anyodd average is reported in Table 11.
factor. The rotation factor section works for any factor The measured times were normalized in two ways, first
but is used only for odd factors. by dividing by
The permutation for square factorsof n contains special
code for single-variate transforms, since less indexing is
required. However, thepermutationformultivariate
transforms also works on single-variate transforms. and second by dividing by
The author has previously published an ALGOL proce-
n,log, (n)
dure [3] of the same name and with a similar function.
One significant difference between the two algorithms is To a first approximation, computing time for the mixed
that the ALGOL one is organized for computing large trans- radix FFT is proportional to n times the sum of the factors
forms on a virtual corememory system (e.g.,theBur- of n, and we observe in the present case that a propor-
roughs B5500 computer). This constraint leads to a small tionality constant of 25 ps gives a fair fit to this model.

98 IEEE TRANSACTIONS ON AUDIO AND ELECTROACOUSTICS JUXE 1969

Authorized licensed use limited to: Escuela Superior de Ingeneria Mecanica. Downloaded on November 23, 2009 at 18:11 from IEEE Xplore. Restrictions apply.
TABLE II TABLE Ill

Timing and Accuracy Tests of Subroutine FFT on a CDC 6400 Computer Numbers 5 100 000 Containing No Prime Factor Greater Than 5
- -
Time
Time 2 788 1920 6750 19440 4R000
-- ____ rms
3
4
300
320
1944
2000
6912
7200
19683
20000
4~600
49152
Factoring of n Time &n nlogz n Error 5 324 2025 7290 20250 50000
(seconds) ( x 10-13) 6 360 7048 7500 204r0 50625
(PS) (PSI 8 375 2160 7680 20736 51200
9 384 21R7 7776 21600 5 1840
10 400 2250 8000 2187C 524RR
512=42x2X42 0.188 20.4 40.8 1.1 12 405 2704 8 100 22500 54000
1024=42X4X42 0.398 19.4 38.9 1.2 15 432 2400 8192 23040 54675
2048=42X2X2X2X42 0.928 20.6 1.4 41.2 16 450 2430 8640 23328 55276
4096 = 43X 43 1.864 19.0 1.5 37.9 18 480 2500 8748 24C00 56250
20 486 25 60 9000 24300 57600
2187=33X3X33 1.494 32.5 1.6 61.6 24 500 2592 9216 24576 58120
3125=52X5X52 1.898 24.3 2.3 52.3 25 5 12 2700 9375 25000 59049
2401 =72X72 2.310 34.4 85.7 2.6 27 540 2R80 9600 25600 60000
1331=llXllXll 1.324 30.1 2.5 95.9 30 576 29 16 9720 25920 60750
2.478 28.9 101.6 3.5 32 600 3000 10000 26244 61 440
2197=13X13X13 36 625 3072 10125 27000 62708
289=17X17 0.272 27.7 2.5 115.1 40 640 3125 10240 2764E 62500
361 = 1 9 x 1 9 0.372 27.1 3.2 121.3 45 648 3200 10368 28125 64000
529 = 23 X23 0.636 26.1 3.5 132.9 48 675 3240 10800 28800 64R00
1000=2X5x2X5X2X5 0.546 26.0 1.6 54.8 50 720 3375 10935 29 160 65536
1.042 22.6 47.5 1.7 54 729 3456 11250 30000 65610
2000=4X5X5X5><4 60 750 3600 11520 30375 67500
64 768 3645 11664 30720 691211
72 800 3750 12000 31 104 69984
15 810 3840 12150 31250 77000
Onthe basis of countingcomplexmultiplications, we 80 864 3RRR 12288 32000 72900
81 900 4000 12500 324CC
would expect a decline in this proportionality constant 90 960 4050 12800 3276P
7372R
75000
withincreasing radix;a decline is observedforodd 96 972 4096 129.50 32805 76800
100 1000 43211 13122 33750 77760
primes> 5. Factors of 5 or less are of course favored by 108 1024 4374 13500 34560 78125
special coding in the program. The second normalized 120 1080 4500 13824 34992 78732
125 1125 Rmco
4608 14400 36000
time value places all times on a comparable scale, allow- 128 1152 4800
810n0 14580 36450
135 1200 4860
ing oneto assess the relative efficiency of using valuesof n 144 1215
9 1920
5000
A2944
15000
153t0
36864
37500
other than powers of 2; these results follow closely the 150 1250 5120
84375 15552 384C0
160 1280 5184
R6400 15625 38880
relative efficiency values derived in an earlier section by 162 1296 5400
r74r0 16000 39366
counting complex multiplications, except that radix 5 is 180
1 92
1350
1440
562 5
90nnn
5760
16200 400CO
91125 16384 40500
substantially better than predicted. 200 1458 5832
921fJq 16875 4096C
216 1500 6000
93312 17280 41472
In Table 111, we list the numbers up to 100 000 contain- 225 1536 6075
93750 17496 43200
ing no prime factor greaterthan 5 to aid the user in select- 240 1600 6144
96000 18000 4314C
243 1620 6750
97200 18225 45000
ing efficient values of n. 250 1728 6400
98704 18432 46080
When compared with Brenner’s FORTRAN subroutine 256 lROO 6480
98415 18750 46656
270 1875 lnnooo
6561 19200 46875
[6]on the CDC6400 computer, FFT was about 8 percent
faster for radix 2, about 50 percent faster for radix 3 and
5, and about 22 percent faster for odd prime radix>7.
similar to an ALGOL procedure REALTRAN given elsewhere
Brenner’s subroutine also requires working storage array
[7] by the author.
space equal to that used for data when computing other
The real data values are stored alternately in the arrays
than radix-2 transforms.
A and B,
The FORTRAN style in the subroutine FFT was designed
to simplify hand compiling into assembly language forthe A U ) , W ) ,A @ ) ,B ( 2 ) , * ’ * A ( n ) ,B b ) ,
CDC 6600 to gain improvedefficiency. Times onthe CDC
then we
6600 for theassembly language version are approximately
1/10 of those shown in Table11.The register arrangement CALL FFT(A, B, n, n, n, 1)
of the CDC 6600 is well suited to the radix-2 FFT; the
CALL REALTR ( A ,B, n, 1).
author has written a subroutine occupying 59 words of
storage on this machine, including the constants used to Afterscaling by 0.5/n, the results in A and B are the
generateallneededtrigonometricfunctionvalues, that Fourier cosine and sine coefficients, i.e.,
computes a complex FFT for n= 1024 in 42 ms.
ak = A ( k 1) +
Transforming Real Data b k = B(k 1) +
As others have pointed out previously, a single-variate for k = 0, 1, a 0 - ,n, with b = b, = 0. The inverse operation,
Fourier transform of 2n real data values can be computed
by use of a complex Fourier transformof dimension n. In
CALL REALTR ( A ,B, n, - 1)
Appendix 11,we include a FORTRAN subroutine REALTR, CALL - l),
FFT(A, B, n, n, n,
SlNoLETON :ALGORITHM FOR MIXED RADIX FFT 99

Authorized licensed use limited to: Escuela Superior de Ingeneria Mecanica. Downloaded on November 23, 2009 at 18:11 from IEEE Xplore. Restrictions apply.
after scaling by 1/2, evaluates the Fourierseries and leaves that it couldhave been used here to transform the square-
the time domain values stored free factors of n. This alternative has not been tried, but
the potential gain, if any, appears small.
A(l),B(1),A @ ) B
, (2) * ‘ ’ Ab),B(n)
References
as originally.
The-subroutine REALTR, called with ISN= 1, separates J. W. Cooley and J. W. Tukey, “An algorithm for the machine
calculation of complex Fourier series,” Math. Comp., vol. 19,
the complex transforms of the even- and odd-numbered pp, 297-301, April 1965.
data values, using the fact that the transform of real data W. M. Gentleman and G. Sande, “Fasl Fourier transforms for
hasthe complex conjugatesymmetry fun and profit,” 1966 Full Joint Computer Cor$, AFIPS Proc.,
vol. 29. Washington, D. C.: Spartan, 1966, pp. 563-578.
an-k = @.kY R.C. Singleton, “An ALGOL procedure for the fast Fourier trans-
form with arbitrary factors,” Commurz ACM, vol. 11, pp. 776--
for k = 1, 2, . * , n - 1, then performs a final radix-2 step 779, Algorithm 339, November 1968.
N. M. Brenner, “Three FORTRAN programsthatperformthe
to complete the transform for the 2n real values. If called Cooky-Tukey Fourier transform,” M.I.T. Lincoln Lab., Lex-
with ISN= - 1, the inverse operation is performed. The ington, Mass., Tech. Note 1967-2, July 1967.
pair of calls R. C. Singleton, “On computing the fast Fourier transform,”
Commun. A C M , vol. 10, pp. 647-654, October 1967.
CALL REALTR ( A ,B , 72, 1) G. D. Bergland, “AfastFouriertransformalgorithm using
base 8 iterations,” Math. Comp., vol. 22, pp. 275-279, April
CALL REALTR ( A ,B, 72, - 1) 1968.
R. C. Singleton, ‘<ALGOLprocedures for the fast Fourier trans-
returntheoriginal values multiplied by 4, except for form,” Commun. ACM, vol. 11, pp. 773-776, Algorithm 338,
November 1968.
round-off errors. I. J. Good, “The interaction algorithm and practical Fourier
Time on the CDC 6400 for n= 1000 is 0.100 second, series,” J. Roy. Stat. Soc., ser. B, vol. 20, pp, 361 -372, 1958;
andfor n= 2000, 0.200 second. Time for REALTR isa Addendum. vol. 22, pp. 372-375, 1960.
linear function of n for other numbers of data values.
The rms error for the above pair of calls of REALTR was Appendix I
1.6X forboth n= 1000 and n= 2000. F O R T R A N Subroutine FFT, for Computing the
Mixed Radix Fourier Transform
Conclusion C
SUBPCUTIYE F F T l A r B , N T O T ~ N , h S P b N , I S h l
M U L T I V b R l A T E C O W L E X F O C R I ETRR b N S F C R UC,C M P U T E D I N PLbCE
C U S I N G M I X E D - R B C I X F b FSCT U R I E T R A N S F O RAM LGCRITHH.
We have described an efficient algorithm for computing C
C
B Y R . C. S I M O L E T C hS.T I N F O R RD E S E A R C IHh S l I l L T E ,
b R R b Y S b B N C @ O B I G I N I L L Y H O L D T HR EEbL bkC IVAGINbRV
OCT. 1 9 6 8

C C C P P C F E h T S OF T H E C b T B , AND
the mixed radix fast Fourier transform and have illus- C l F b G l h L R V CC’lPCNENTS OF
RETURN THE
THE R E S U L T l h G FCURIER
R E b L AND
COFFFICIENTS.
C M U L T I V b R l A T E O A T b I S I U O E X E C b C C O R C I N G T C T HFEO R T R b N
trated this algorithm by a FORTRAN subroutine FFT for C b R R b Y E L E V E h ? S L C C E I S O R F U N C T l OWh I, T H O U L ITP I T
C C h ? C € lvUllBEP OF I V P L l EFOL L T l P L E SUBSCRIPTS.
computing multivariate transforms. The principal means C THE S U E R O U T i ~ , c I S C P L L EOCN CF EOERb CVHb R l b T E .
C T H E C b L L S F C P A P U L T l V A R l b T ET R A N S F C R M P A Y B E I N ANY ORDER.
of improving efficiency is the reduction in the number of C & T O 1 I S T V E T C T P L h L P B E R CF C C Y B L E D XATA VALUES.
C N I S TI’E D I V E R S I O L C F T P E C U R R E N T V A R I C B L E .
complex multiplications for an odd prime factorp of n to C
C
h S P b h / h I S T F E S P b C l hC
U H I ILhED E X I hT GC
b EU R R E N VA
GCF P N S E C U T I V E
TRIbBLE.
C b T b VALUES

approximately C
C
T H SE l GOh IFS D
N E T E R M I N E TS H SE I G O
N TF H C
ECMFLEX
E X P O h E N T I b L , b h C T H E C P C N I T U COIESF N IS N O R H b L LOVN E .
C b TRI-VbRIbTT ER A h S F C R W Y ITH P l N l , N 2 , N 3 1Br l N l , N Z r N 1 1
c I S CCFPUTED e y
C CALL F F T ( A , B , N l * N Z ~ N 3 r N l ~ N l r I I
C CALL F F T l A s @ , N l ~ N 2 8 k 3 ~ h 2 ~ N 1 ~ N 2 , 1 1
C CALL FF?IbI@,hl*N2*N3rN3~hl*N2*h3.1)
C FOR b S I h G L E - V P R I b TTER A N S F O R M l
The algorithm also permutes the result in place by pair C
C
N T O T = N = N S P b N = ( N U H E FOC
F FCT b1 L4 L. B . N . N l h r l I
RFO M P L ECXA TVAb L U F S l , F.G.

interchanges for the square factors of n, using additional C


C
T H E D A TM A b AV L T E R Y A T I V E L R
b R R b V b , T P ETNHHEA G N I T U C E
YSE T O R E10N
OF I SCNH A N G E D
b SINGLE CCNPLFX
TO T h O T O
C G I VTEb E C C R R E C T I h D F X I NI G N C R E V E hAThACI 2U1S E D
temporary storage during permutation only when n has C P b S S T HI EN I T I A L A C D R E S S FOR T V E S E C U E N CCI M EF b G I N A R V
TO

two or more square-free factors.


A second subroutine REALTR for completing the trans-
form of 2n real values is given, allowing efficient use of a
C V A X P PUS1 E E .cy. T H E hUVEER CF P R i k E ; A c l O a S 0 ; N.
complex transform of dimension n for the major portion C
C
I h b C D I T I O N , ITFHSEQ U I R E - F R E E
MCRE P R I MFEb C T O R S , THEk P A XNPU S 1
P C R T I C k K CF N H b S T Y O OR
B E .GE. K-1.
of the computing in this case. C
DlVEhSICN b l l l v 8 1 l I
b R R A Y STORAGE I N NFAC FOR b P A X l M U i l CF I 1 F b C l C R O
SNF .
By use of these two subroutines,Fouriertransforms C
C
I F N H b S M O LTEH 4 h
SCUARE-FREE FACTCRS
0h.E S Q U A R E - F R EFEb C l C RT,H E
M L S T B E .LE. 210
PROOUCT O F THE

can be computedformany possible values of n, with C ARRAY


CIHENSICN NFACI1111YP12091
STORbGE FOR Y & X l P U P P R I M FEA C T O CR2F3
nearly as good efficiency as for n a power of 2. This ex- ClbEhSION bT12311CKI23IrBTl23lrSKI23~
E P U I V b L E N C1E1 1 1 1 1
C T b FE O L L O W I N G TWC C C N S T A N T S C H O U L C b G R E E h I T H T VAER R bO VI C F N S I P N S .
pandedrange of values has been found useful by the PbXF=23
PAXP=209
author in speech and economic time series analysis work. I F I N . L T2 .1 RFTURh
l N C = I SN
Before Cooley and Tukey’s paper [I], Good [8] pre- RbC=B.O*ATbWlI.01
S72=RAD/5.0
sented a fast Fourier transform method based on decom- C72-tCSISi7
s?2=sIYIs72l
posing n into mutually prime factors. This algorithmuses SlZO-SORTIC.75I
I F I I S N .GE. 01 GO TO 10
a more complicated indexing scheme than the Cooley- S72=-572
SL20=-S120
Tukey algorithm, but avoids the rotation factor multipli- -
RbR=-C!AP -
INC=-INC
cations. While the restriction to mutually prime factors is 10 hT=INCINTOT
KS=lhC*NSPIN
an obstacle to general use of Good’s algorithm, we note KSPbN=KS
hN=hT-INC

100 IEEE TRANSACTIONS ON AUDIO AND ELECTROACOUSTICS JUNE 1969

Authorized licensed use limited to: Escuela Superior de Ingeneria Mecanica. Downloaded on November 23, 2009 at 18:11 from IEEE Xplore. Restrictions apply.
JC=KSIN 420 K l i K K t K S P b N
RAOF=RbC*FLCATlJCl*O.5 LZ=Kl+KSPAN
r.= n_ K3=KZ+KSPbN
JF=O bKP=PIKKl+AIK21
O E T E R U I N FT H EF b C T C R SC F N bKH=AIKK~-bIK21
V.0 bJP=blKlltblK31
K=N AJP=blKlI-blK71
GO T C 2 0 AlKltl=bKPtbJP
15 *=HI1 bJP-bKP-bJP
NFbCIPI=4 BKP*BlKKI+8lK2I
K=K/l6 BKP-8IKKI-BIK2I
20 l F I K - l K / l 6 l * l 6 . E C . 0 1 G O T O 15 EIJP=8IKlltBlK?I
J=3 BJP=8lK11-81K31
JJ=9 EIKKI=8KP+BJP
GO T O 30 PJP=BKP-RJP
2 5 W=R+l I F I l S l r .LT. 0 1 G C T O 450
hFbClPI=J b,(P*bKP-BJF
K=KIJJ bKF=bKP+eJY
3 0I F l H O D l K , J J I . E O . 0 1 GP T l l 2 5 @KP=BKPtAJW
J=Jt2 ., : Y Y - . I ! Y - b - "I V
JJ= J**2 I F I S 1 .Ea. 0.01 GO T O 460
I F I J J .LE. K I GC T O 30 4 9 3 AlKlI=AKP*CI-FJKP8Sl
I F I K .GT. 41 GC T O 4 0 OlKl)=AKP*Sl+BKPICl
KT=F blK2l=bJP*C?-8JP*S2
hFbCIYilI=K PI*2l=AJP*S2t8JP*C2
I F I K .NE. 1 Y1 = V + l ClK3l=AKW*C3-RKM*S3
GO T C 8 C PIK3l~AKY*53+PKV*r3
4 0 I F l K - I K / 4 1 * 4. h E . CI GC T r 50 Kl<=I:3+KSPAh
*=r*1 I F I K K . L E . h T I G C T O 420
NFbClFl=2 4 4 2 CZ=CL-ICC*CI+SCIS~I
K=K/4
5 K0 T = P s1=Iso*c1-co*s1~*s1
J=2 C T HFEO L L O U I N TGH R ESET A T E M E N TCSD M P E N S b TFEOTRR U N C A T I O N
6 0I F I Y C O l K , J l .NE. 01 GO T C 1C C ERROR. I F ROUNOE bROI T H M E T I C IS U S ESDU, B S T I T U T E
?=*+I c CIlC2
NFACIYl=J Cl~0.5/lC2**2iSIbt2~tO.5
KzKIJ Sl=Cl*Sl
c1=c1*c2
7 0J = I I J + l I / 2 l * 2 + i
I F I J .LE. K l GC T C 6 f l c2-c1**2-s1**2
Z2=2.O*Cl*Sl
80 I F I K T .EC. 0 1 G O T C 100
J=KT C3=C2*cl-S2*Sl
9 0 W=W+l S3=CZ*Sl+S2*Cl
KKiKK-NTtJt
hFACIPI=NFACIJI
I F I K K .LE. K S P b N l GO T O 420
J=J-1 KK=KK-KSPbhtINC
I F I J .NE. 01 G O T O 90 I F I K K .LE. J C I GC T O 410
COMPUTE FOURIER TRbNSFORM I F l K S P b N .Ea. J C ) G O T O 800
100 S O = R b O F / F L O A T l K S P b N i l GO T O 100
CD=2.0*SINlSOl**2 450 b K P = b K P t B J M
SD=SINlSO+SO1 bKM=bKP-BJP
KK= 1 BKP=BKP-AJF
1=1*1 BKP-BKF+bJM
I F l N F b C l I I .NE. 2 1 G O T O 4 0 0 I F l S l .NEI 0.01 G O T O 470
TRbNSFCRH FORFACTOR OF 7 I l N C L U O l N G R O l b T I O N FACTOR1 4 6 0b l K l l = A K P
KCPAN=K$PbN/2 BlK11=8KP
Ki=KSPAN+2 bIKZl=bJP
21K 0 Z=KK+KSPbN BIKZI=BJP
bK-blK21 AlK3l=bKM
BK=BIKZI 8lK31=8KM
blK2l=blKKI-bK KK=K3tKSPbN
8IK21=8lKKI-BK I F I K K .LE. h l ) GO TO + 2 O
blKKI=AlKKl+bK G O TO 4 4 0
8lKKI=BIKKl+BK C TRANSFCRM F O FRb C T O ERF 5 I C P T I O N ACL O D E 1
KK-K2+KSPAN 5 1 0C 2 = C 7 2 * * 2 - S 7 2 * * 2
I F I K K .LE. N N ) GO T O 210 S2=2.O*C72*sl2
KK=KK-NN 5 2 0K l = K K t K S P b k
I F I K K .LE. J C ) GC T O 2 1 0 K2-KIIKSPAN
I F I K K .GT. K S P A L I GO T O 0 0 0 K3;KZtKSPAN
2 2 0C 1 = 1 . O - C 0 K4=K3+KSPAk
s1=so bKP=A(KlItblK41
2 3 K0 Z = K K * K S P A N bKM=blKlI-blK41
bK=bIKKI-blKZl 8KP=81Kllt8lK41
8K=BIKKI-8lK2I BKN=BlKl~-BlK41
blKKl=AlKK)tbIK2I bJP=blK2I+IlK31
BlKKI=RlKKItBlK2I bJ*=bIK2l-blK31
AlK2I=Cl*AK-Sl*BK BJP=BIK21t8lK31
BIK2~=Sl*bK+Cl*BK EIJP-8IK2I-BIK31
KK=KZtKSPbN bb=blKKl
I F I K K .LT. N T I GO TC 2 3 0 BB=BIKKl
KZ=KK-NT blKKl=AbtAKPtAJP
Cl=-Cl 81KKI=8Et8KPtBJP
KK=KI-K2 AK=bKP*C72tbJWCZtbA
I F I K K .GT. K 2 I GO T O 2 3 0 BK=BKP*C72+8JP*C2+8B
PK=Cl-ICO*CltSO*Sll A.I=bKM*S72+AJM*S2
S1=ISo*Cl-Co*Sl~tSl BJ=BKP*S72t8JH*S2
THE FOLLOWING THREE STATEMENTS COMPENSATE FORTRUNCbTION h.*?t.-hK-RJ
ERROR. I F ROUNOEO b R l T H H E T l C I S USED, S U B S T I T U T E
C Cl-bK blK41=bK+BJ
C1=0.5/lAK**2tSl**2ItO.5 BIKlI=BK+AJ
s1=c1*s1 8IK4I-BK-bJ
Cl=Cl*bK bK=bKPbC2+bJPbCl2+bA
KK=KKtJC 8K=BKP*CZ+BJP*C72teP
I F I K K .LT. K 2 I GC T O 2 3 0 bJ=bKM*S2-bJM*S72
KI=Kl+INCtINC BJ=8KM*S2-8JP*S72
KK=IKl-KSPlhllZtJC IIKZLibK-RJ
I F I K K. L F +J C t J C ) GO T O 228 blK3l=bKtBJ
GO T O 100 EIlK21=8KtdJ
5 TRbhSFCRM F C FRA C T C O
RF 3 I O P T I O N A L CODE1 B(K31=8K-bJ
3 2 0K l = K K i K S P b N KK=K4+KSPbN
K2=KltKSPbN I F I K K .LT. N N I GO T O 5 2 0
bK=blKKl KK=KK-NN
BK=BIKKI I F I K K .LE. K S P b N l GO T O 5 2 0
bJ=blKlltblK21 GO T O 700
BJ=EIIKll+ElK21 C TRANSFCRM FOR 000 FbCTORS
blKKI=bK+AJ 600 K = N F b C l I I
PIKKI=BKtRJ KSPNN=KSPbN
AK=-0.5*bJ+bK KSPbNIKSPbhlK
BK=-0.5*BJ+BK I F I K .EO. 3 1 GO T C 3 2 0
AJ=IAlKl~-bIK2L14Sl20 l F l K .EO. 5 1 GO T O 5 1 0
~J=I81KlI-BIK2IIrS120 I F I K . E C . J F I GO T O 6 4 0
AIKlI=AK-BJ ".IF;Y ,.
81Kl)=BK+bJ Sl=RbClFLObTlKI
AlK2I=AK+BJ cl=ccSIsl~
BIKZI=BK-AJ ,Sl=SINISlI
KK-K2tKSPAN I F I J F .GT. M b X F l GC T f l 9 9 0
I F I K K .LT. h h l G C T O 320 CKIJFI-1.0
KK=KK-NN SKIJFI=0.0
I F I K K . L EK. S P b h I GU T O 3 2 0 J=l
GC TC 100 6 3 0C K I J l = C K I K l * C l + S K I K I * S l
C T R b N S F C RFHOFRb C T OCRF 4 SKIJL=CKlKl*Sl-SKlKI*Cl
4 0 0 l F l h F A C l I I .NE. 4 1 GC T O 6 C O KEK-1
KSPNN=KSPAN CKIKI-CKIJI
KSPbN=KSPbh/4 SKlKl=-SKlJi
4 1 0 C1;l.O J=Jt1
s1=0 I F I J .LT. K I GO T C6 3 0

SINGLETON : ALGORITHM FOR MIXED RADIX FFT 101

Authorized licensed use limited to: Escuela Superior de Ingeneria Mecanica. Downloaded on November 23, 2009 at 18:11 from IEEE Xplore. Restrictions apply.
640 Kl=KK I F f K 2 .LT. K S I GO T O
XZ=KK+KSPNN I F f K K .LT. K S I GO TO E 3 0
AA=bIKKI JC=K3
IB=BfKKI GC TO 8 9 0
AK=AA : P E R P U T d T l OFNOMRU L T l V A R I d TTER A N S F C R N
eK=BB 050 K = K K t J C
J-1 860 A K = A f K K I
Kl=Kl*KSPAN AlKKI=AIKZI
650 KZ'KZ-KSPAN AlK2I-AK
J=J+1 BK-BfKKI
PTIJI=AfKlI+AfK2I ElKiI=BlK2l
LK=ATfJI+AK BfK21=BK.
BTIJ~=BIKlltBfK2I KK=KK+ICC
EK=BTfJlt8K KZ=KZ+lNC
J=J+l I F I K K .LT. K I GO TO 060
ATfJl-AfKl1-AlK2I KK=KK+KS-JC
BTfJI*BIK11-0lK2I KZ=K2tKS-JC
I F I K K . L T . N T I GO T O 8 5 0
Kl=KltKSPAN KZ=K2-KT+KSPAN
l F f K 1 .LT. K 2 I GO T O 6 5 0 KK=KK-NTtJC
AfKKl=AK I F f K 2 .LT. K S I GO TO 8 5 0
BIKKl=BK 870 KZxKZ-NPfJI
Kl=KK J=Jt1
K2-KKIKSPNH K2=NPIJtlItK2
J= 1 I F I K 2 .GT. N P f J l l G O T O 870
660 Kl=Kl+KSPAN J=1
KZ=KZ-KSPAN 800 I F f K K .LT. K 2 ) G O T O 850
JJ=J KKsKKtJC
PK=AA KZlKSPANtK2
BK=BB I F f K 2 .LT. K S I G O T O 080
bJ-0.0 I F I K K .LT. K S I G O T O 070
8J=O.O
K= 1 090 I F f Z * K T + l .GE. M I RETURN
670 K=K+1 KSPhN=kPfKT+tl
AK=ATlKl*CKIJJl+AK C P E R H U T A T I CFNOSRQ U A R E - F R FFEA C T O ROSF N
BK=BTfKI*CKfJJItBK J=M-KT
K-K t 1 hFbClJtll=l
bJ=ATIKl*SKIJJI+bJ 900 N F A C l J l = h F A C f J l * N F A C f J + l l
BJ=BTfKI*SKIJJItAJ J=J-1
JJ=JJ+J I F I J .NE. K T 1 GTOO 900
I F I J J .GT. J F JI J = J J - J F KT=KTtl
I F I K .LT. J F I GO T C 6 7 0 hN=hFACIKTI-l
K=JF-J I F I N N .GT. H A X P l GC 70 9 9 8
bfKll=AK-BJ JJ-0
BfKlI=BK+AJ
AfK2l=AKtBJ
-i;n_
GO TO 906
BfKZI=BK-AJ 502 J J = J J - K 2
J=J+l K2=KK
I F I J .LT. KI G O T C 6 6 0 K=K+l
KKlKKtKSPNK XKshFACIKl
I F I K K .LE. h h l GO T O 6 4 0 904 J J = K K t J J
KK=KK-NN I F I J J .GE. K Z I GO TO 9 0 2
I F l K K . L EK. S P A N I GO T O 640 hPIJI=JJ
P U L T l P L Y B Y R O T A T I O Fh A C T O R [ E X C E P FT O R
FACTCRS O F 2 AND 41 906 K Z = h F A C f K T I
100 I F f l .EC. P I G C TC B O O K=KTtl
KK=JC+l KK=hFACfKI
110 c2=1.0-c0 J=J*l
s1=so I F f J .LE. NNI GC TC 9 0 4
T 2 0c 1 = c 2 C D E T E R M I NTEHPEE R r U T A T I OCNY C L EOSLFE N G TG
HR E A T ETRH A N 1
S2=S1 J=C
KK=KKtKSPAN G TOO 914
130 A K = d I K K l
910 K = K K
AfKKl-C2*AK-S2*BfKK1
81KK1-S2*AKtCZ*0fKKl KK=hPlKl
KKiKKtKSPNN KPfKlr-KK
I F I K K .LE. h T l GC T O 7 3 0 1 F f K K .NE. J 1 G O T C 910
dK=Sl*S2 K3-KK
S2=Sl*C2+Cl*S2 9 1 4J = J t l
CZ=Cl*CZ-AK KK=hPfJ)
KK=KK-NT+KSPAN IFIKK .LT. a ) G O T O 914
I F I K K . L EK. S P N h l G O TO 730 I F f K K .NE. J I GO T O 910
C2=cl~~fCo*Cl+SC*SlI
Sl=Sl+fSO*cl-CD*SlI I F I J .hE. N h I GO T O 914
rAXF=INC*MAXF
C R E C R D E R A A N 0 0, F C L L O W I N G T H E P E R M U T A T I O N C Y C L E S
GO T C 9 5 0
T H EF O L L O W I N GT H R E ES T A T E M E N T SC O N P E N S A T EF O RT R U W C A T I O N 9 2 4 J=J-I
ERROR. I F R O U N D E bDR l T H N E T I C I S U S E O , THEY MAY I F f h P f J l .LT. 01 GO T O 9 2 4
B E DELETED. JJ=JC
CL=0.5/1c2**2*Sl**2Ito.5 9 2 6 KSPAN=JJ
s1=c1*s1 I F I J J .GT. M A X F I KSPdN=MAXF
C2.Cl*CZ JJ=JJ-KSPAN
KK=KK-KSPNNtJC K=NPlJl
I F I K K .LE. K S P A N I GO TO 720 KK=JC*K+lltJJ
KK-KK-KSPAN+JC+INC Nl=KKtKSPAN
I F I K K .LE. J C I J C I GO TO 7 1 0 K2-0
GO TO 100 9 2 0K 2 = K Z t l
P E R M U T TE H R
EESULTS TI: NCRHAL
ORDER---DONE I k TWO S T A G E S ATILZI=AfKlI
- P E R N U T A T I OFN5 R SCUbRE FACTORS OF N BTfK2I=BIK11
8 0 0N P f I l = K S Kl=Kl-INC
I F f K T .EC. 0 1 GO T O 890 I F f K 1 .NE. K K I GO T O 9 7 8
K-KTtKT+l 932 Kl=KKiKSPAN
I F l H .LT. K IK = K - l KZ=Kl-JC*fKiNPfKlI
J-1 . K=-KP IK I
NPfKtll=JC 9 3 6A I K 1 1 = A I K Z l
010 N P f J + l l = N P I J l / N F b C f J l @lKll=BfKZI
NPlKl=NPlKtll*NFDClJI Kl=KL-INC
J=J+l KZ=KZ-INC
.K=K-1 1 F I K 1 .NE. K K I GO T O 9 3 6
I F I J .LT. K I GO T O 8 1 0 KK=Y-
.. 7
K3=NPfKtlI 1 F f K .NE. J I GC T C 9 3 2
KSPAN=NPlZl Kl=KK+KSPAN
KKlJCtl K2=0
KZ=KSPANtl 940 K2=K2*1
J= 1 dIK1I=ATIK21
I F f N .hE. h T C T I GC T O 8 5 0 B(KLI=BTfKZI
C P E R M U T A T I O N FOR S I N G L E - V A R I A TTER A N S F C RIVO P T I O N ACLO D E 1 Kl=Kl-INC
8 2 0A X - A f K K l I F l K l .NE. K K I GO T O 9 4 0
AfKKI-AIK2I I F I J J .hE+ 01 G O T C 9 2 6
AlK2l=AK l F f J .NE. 1 1 GO T O 924
BK-BIKKI 950 J=K3*1
8IKKI=BfK21 NT=NT-KSPNN
0fK21=0K II=NT-INC+l
KK=KK+lNC 1 F I N T .GE. 01 C O TO 9 2 4
K2=KSPAN+K2 RETURN
I F f K 2 .LT. K S I GO T O 8 2 0 C E R R C R F I N I S HI ,N S U F F I C I E N T A R R A Y STORAGE
830 K Z r K 2 - N P f J I 9 9 8 ISN=O
J*Jtl c P9R9 I9I r T
K2-NPfJllltK2
I F I K Z .GT. N P I J I I GO T O 8 3 0
sTnP
999 F O R Y A T I 4 4 H O A R R d YB O U N D SE X C E E D E DW I T H I N SUBROUTINE F F T l
EN0

102 IEEE TRANSACTIONS ON AUDIO AND ELECTROACOUSTICS JUNE 1969

Authorized licensed use limited to: Escuela Superior de Ingeneria Mecanica. Downloaded on November 23, 2009 at 18:11 from IEEE Xplore. Restrictions apply.
SNsISO*CL-CO*SNItSN
Appendix II C T HFEO L L O W I N GT H R ESET A T E M E N TCS O M P E N S A T E FOR T R U N C A T I O N
ERROR.
C I F R O U N DAERDI T N M E T I C IS USED, SUBSTITUTE

FORTRAN Subroutine REALTR, for Completing the Fourier 2 o C NN*=A 0A . 5 / I A b * * 2 * S N * * 2 1 ~ 0 ~ 5


SN=CN*SN
Transform of 2n Real Values 2 0 CN=CNLAA
RETURN
30 CN=-l.O
SO=-SO
S U B R O U T I N ER E 4 L T R I A ~ E ~ N I I S N I GO TO 1 0
I FI S N = lT, H I SS U E R O U T I N EC O M P L E T E ST H EF O U R I E RT R A N S F O R M END
O F2 * NR E b OL A T AV A L U E SW , H E R ET H EO R I G I N A D
L A T AV A L U E S ARE
S T O R E 0A L T E R N A T E L YI NA R R A Y S d A N 0 E , AND ARE FIRST
T R A N S F O R M E DB YAC O M P L E XF O U R I E RT R A N S F O R MO FD I M E N S I O N N.
T H EC O S I N EC O E F F I C I E N T S ARE I NA l l I ~ A I 2 l t . + . A I N + l l AND Appendix 111
T H ES I N EC O E F F I C I E k T SA R E IN RI1l~EI2lt...EIti+11.
AT Y P I C A LC A L L I N GS E Q U E N C E
C A L LF F T I A r B v h t N ~ N r l l
IS Rader’s Radix-5Method,for PossibleSubstitution in
C A L LR E A L T R I A ~ B ~ N ~ l l
T H ER E S U L T SS H O U L DB EP U L T I P L I E D B Y 0 . 5 / N T O G I V ET H E
Subroutine FFT in Appendix I
U S U A LS C A L I N GO FC C E F F I C I E N T S .
I Fl S N = - lT. H EI N V E R S ET R A N S F O R M A i I O N I S D O N ET,H FEI R S T !i T E P COOEI I
I N E V A L U A T I N G4R E A LF O U R I E RS E R I E S .
A T Y P I C A L CALLING SEOllENCF IC
CALi-kEA;TiTA,E,N;rii -- --
C A L LF F T I A r B r N v N ~ N ~ - l l
T H ER E S U L T S H O U L DB EP U L T I P L I E DB Y 0.5 TO G I V ET H EU S U A L
S C A L I N GA, N DT H ET l P ED O M A I NR E S U L T SA L T E R N A T EI NA R R A Y SA
AND 81 1.E. A ~ 1 l ~ E 1 1 1 ~ A ~ 2 l r E l 2 1 ~ ~ ~ ~ A l N l ~ 8 I N l ~ K4*K3+KSPAN
T H ED A T AU A YA L T E R N b T l V E L YB ES T O R E D I N AS I N G L EC O M P L E X AKP-AIKlltAlK41
A R R A YATt H E NT H EP A G N I T U D E C F I S NC H b N G E D T O TWO TO AKH~AIKlI-AlK41
GIVE THE C C R R E C ITN O E X l h G INCREMENT b N D A ( 2 l USEDTO BKP-EIKlltEIK41
PASS THE I N I T I A AL C C R E S S
FOR THE SEGbENCE OF I M A G I N A R Y BKM=BIKlI-EIK41
VALUES, E.G. AJP=AlK2ItAlK31
C A L LF F T I A t A l 2 1 ~ N ~ N v N . Z l AJM.AIKZl-AIK3l
C A L LR E A L T R I b ~ A l Z l ~ t i ~ 2 ~ EJP-ElK21tE1K34
I N T H I SC A S ET, H EC O S I N E AND S I N EC C E F F I C I E N T SA L T E R N A T E I N A. BJWEIK21-EIK3l
B Y R. C. S I N G L E T O hS. T A N F O R D RESEARCH ILSTITUTEI OCT. 1 9 6 8 AK-AKPtAJP
ClUEFiSlON P I l l ~ e I l l AJP=IAKP-AJPl*Ct
REAL 1 M BK-EKPtEJP
lNC=lABSlISNl BJP-IEKP-BJPI*CZ
NK=h*lNC+2 AKP=AIKK1-0.25*AK
NH=NK/Z AlKKl=AtKKltAK
SO=2.O*ATbNIl.Ol/FLO ATINI BKP=EIKK)-O.ZS*BK
CD=Z.O*SINISDl**2 E(KK)-B(KKItBK
SD=SINISDtSOI AK=AKP+AJP
SN=O.O AJPoAKP-AJP
I F I I S N .LT. 01 GO TO 30 BKIBKPtEJP
CNrl.0 EJhBKP-EJP
AINK-l1=AlII AKP-AKM*SlZtAJM*SZ
BINK-1l=EI11 AKM.AKY*S2-AJM*ST2
10 00 2 0J = l r h H I I N C BKP=BKM*S72tBJM*SZ
KmNK-J EKW=BKM*SZ-EJWS72
AA=AIJl+AIKI AlK 11-AK-BKP
AS*AlJI-AlKI AIK4l=AK+BKP
EA=8IJltBlKI BIKlI~EKtAKP
EB=t7IJl-RlKI BIK41-EK-AKP
RE=Ch*BAtSh*AE AlK21-AJP-BKM
IM=SN+BA-CN*bE AlK31-AJPtBKM
SIKI=IP-RO EIK2l-EJPtAKM
BlJI=Ik’*BS E(K3l-EJP-AKH
AlKliAA-RE KK-K4tKSPAN
blJ)=AA+RE I F I K K .LT. N N I GO T O 5 2 0
bA=CN-(CCtCN+SOtSNI KK-KK-NN
FIK
IK .LE. KSPANI GO TO 520
GO 10 700

FOR SINGLETON: ALGORITHM RADIX FFT 103

Authorized licensed use limited to: Escuela Superior de Ingeneria Mecanica. Downloaded on November 23, 2009 at 18:11 from IEEE Xplore. Restrictions apply.

You might also like