1
/*--------------------------------*-C-*---------------------------------*
5
* Singleton's multivariate complex Fourier transform, computed in
6
* place using mixed-radix Fast Fourier Transform algorithm.
8
* Called here `fftn' since it does a radix-n FFT on n-dimensional data
10
* Copyright(c)1995,97 Mark Olesen <olesen@me.QueensU.CA>
11
* Queen's Univ at Kingston (Canada)
13
* Permission to use, copy, modify, and distribute this software for
14
* any purpose without fee is hereby granted, provided that this
15
* entire notice is included in all copies of any software which is
16
* or includes a copy or modification of this software and in all
17
* copies of the supporting documentation for such software.
19
* THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
20
* IMPLIED WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR QUEEN'S
21
* UNIVERSITY AT KINGSTON MAKES ANY REPRESENTATION OR WARRANTY OF ANY
22
* KIND CONCERNING THE MERCHANTABILITY OF THIS SOFTWARE OR ITS
23
* FITNESS FOR ANY PARTICULAR PURPOSE.
25
* All of which is to say that you can do what you like with this
26
* source code provided you don't try to sell it as your own and you
27
* include an unaltered copy of this message (including the
30
* It is also implicitly understood that bug fixes and improvements
31
* should make their way back to the general Internet community so
32
* that everyone benefits.
34
* Brief overview of parameters:
35
* ---------------------------------------------------------------------*
36
* Re[]: real value array
37
* Im[]: imaginary value array
38
* nTotal: total number of complex values
39
* nPass: number of elements involved in this pass of transform
40
* nSpan: nspan/nPass = number of bytes to increment pointer
42
* isign: exponent: +1 = forward -1 = reverse
43
* scaling: normalizing constant by which the final result is DIVIDED
44
* scaling == -1, normalize by total dimension of the transform
45
* scaling < -1, normalize by the square-root of the total dimension
48
* Slightly more detailed information:
49
* ----------------------------------------------------------------------*
50
* void fft_free (void);
52
* free-up allocated temporary storage after finished all the Fourier
55
* ----------------------------------------------------------------------*
57
* int fftn (int ndim, const int dims[], REAL Re[], REAL Im[],
58
* int iSign, double scaling);
60
* NDIM = the total number dimensions
61
* DIMS = a vector of array sizes
62
* if NDIM is zero then DIMS must be zero-terminated
64
* RE and IM hold the real and imaginary components of the data, and
65
* return the resulting real and imaginary Fourier coefficients.
66
* Multidimensional data *must* be allocated contiguously. There is
67
* no limit on the number of dimensions.
69
* ISIGN = the sign of the complex exponential
70
* (ie, forward or inverse FFT)
71
* the magnitude of ISIGN (normally 1) is used to determine
72
* the correct indexing increment (see below).
74
* SCALING = normalizing constant by which the final result is DIVIDED
75
* if SCALING == -1, normalize by total dimension of the transform
76
* if SCALING < -1, normalize by the square-root of the total dimension
79
* tri-variate transform with Re[n3][n2][n1], Im[n3][n2][n1]
81
* int dims[3] = {n1,n2,n3}
82
* fftn (3, dims, Re, Im, 1, scaling);
84
* or, using a null terminated dimension list
85
* int dims[4] = {n1,n2,n3,0}
86
* fftn (0, dims, Re, Im, 1, scaling);
87
* ----------------------------------------------------------------------*/
93
extern void fft_free (void);
95
/* double precision routine */
96
extern int fftn (int /* ndim */,
97
const int /* dims */[],
101
double /* scaling */);
103
/* float precision routine */
104
extern int fftnf (int /* ndim */,
105
const int /* dims */[],
109
double /* scaling */);
115
/*----------------------- end-of-file (C header) -----------------------*/