|GNU Scientific Library Reference Manual - Third Edition (v1.12)|
by M. Galassi, J. Davies, J. Theiler, B. Gough, G. Jungman, P. Alken, M. Booth, F. Rossi
Paperback (6"x9"), 592 pages, 60 figures
RRP £24.95 ($39.95)
15.2 Overview of complex data FFTs
The inputs and outputs for the complex FFT routines are packed arrays of floating point numbers. In a packed array the real and imaginary parts of each complex number are placed in alternate neighboring elements. For example, the following definition of a packed array of length 6,
double x[3*2]; gsl_complex_packed_array data = x;
can be used to hold an array of three complex numbers,
the following way,
data = Re(z) data = Im(z) data = Re(z) data = Im(z) data = Re(z) data = Im(z)
The array indices for the data have the same ordering as those in the definition of the DFT--i.e. there are no index transformations or permutations of the data.
A stride parameter allows the user to perform transforms on the
z[stride*i] instead of
z[i]. A stride greater
than 1 can be used to take an in-place FFT of the column of a matrix. A
stride of 1 accesses the array without any additional spacing between
To perform an FFT on a vector argument, such as
* v, use the following definitions (or their equivalents) when calling
the functions described in this chapter:
gsl_complex_packed_array data = v->data; size_t stride = v->stride; size_t n = v->size;
For physical applications it is important to remember that the index appearing in the DFT does not correspond directly to a physical frequency. If the time-step of the DFT is \Delta then the frequency-domain includes both positive and negative frequencies, ranging from -1/(2\Delta) through 0 to +1/(2\Delta). The positive frequencies are stored from the beginning of the array up to the middle, and the negative frequencies are stored backwards from the end of the array.
Here is a table which shows the layout of the array data, and the correspondence between the time-domain data z, and the frequency-domain data x.
index z x = FFT(z) 0 z(t = 0) x(f = 0) 1 z(t = 1) x(f = 1/(N Delta)) 2 z(t = 2) x(f = 2/(N Delta)) . ........ .................. N/2 z(t = N/2) x(f = +1/(2 Delta), -1/(2 Delta)) . ........ .................. N-3 z(t = N-3) x(f = -3/(N Delta)) N-2 z(t = N-2) x(f = -2/(N Delta)) N-1 z(t = N-1) x(f = -1/(N Delta))
When N is even the location N/2 contains the most positive and negative frequencies (+1/(2 \Delta), -1/(2 \Delta)) which are equivalent. If N is odd then general structure of the table above still applies, but N/2 does not appear.
|ISBN 0954612078||GNU Scientific Library Reference Manual - Third Edition (v1.12)||See the print edition|