1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
|
<html lang="en">
<head>
<title>Overview of complex data FFTs - GNU Scientific Library -- Reference Manual</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="GNU Scientific Library -- Reference Manual">
<meta name="generator" content="makeinfo 4.8">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Fast-Fourier-Transforms.html" title="Fast Fourier Transforms">
<link rel="prev" href="Mathematical-Definitions.html" title="Mathematical Definitions">
<link rel="next" href="Radix_002d2-FFT-routines-for-complex-data.html" title="Radix-2 FFT routines for complex data">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 The GSL Team.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``GNU General Public License'' and ``Free Software
Needs Free Documentation'', the Front-Cover text being ``A GNU Manual'',
and with the Back-Cover Text being (a) (see below). A copy of the
license is included in the section entitled ``GNU Free Documentation
License''.
(a) The Back-Cover Text is: ``You have freedom to copy and modify this
GNU Manual, like GNU software.''-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<p>
<a name="Overview-of-complex-data-FFTs"></a>
Next: <a rel="next" accesskey="n" href="Radix_002d2-FFT-routines-for-complex-data.html">Radix-2 FFT routines for complex data</a>,
Previous: <a rel="previous" accesskey="p" href="Mathematical-Definitions.html">Mathematical Definitions</a>,
Up: <a rel="up" accesskey="u" href="Fast-Fourier-Transforms.html">Fast Fourier Transforms</a>
<hr>
</div>
<h3 class="section">15.2 Overview of complex data FFTs</h3>
<p><a name="index-FFT_002c-complex-data-1396"></a>
The inputs and outputs for the complex FFT routines are <dfn>packed
arrays</dfn> 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,
<pre class="example"> double x[3*2];
gsl_complex_packed_array data = x;
</pre>
<p class="noindent">can be used to hold an array of three complex numbers, <code>z[3]</code>, in
the following way,
<pre class="example"> data[0] = Re(z[0])
data[1] = Im(z[0])
data[2] = Re(z[1])
data[3] = Im(z[1])
data[4] = Re(z[2])
data[5] = Im(z[2])
</pre>
<p class="noindent">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.
<p>A <dfn>stride</dfn> parameter allows the user to perform transforms on the
elements <code>z[stride*i]</code> instead of <code>z[i]</code>. 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
elements.
<p>To perform an FFT on a vector argument, such as <code>gsl_vector_complex
* v</code>, use the following definitions (or their equivalents) when calling
the functions described in this chapter:
<pre class="example"> gsl_complex_packed_array data = v->data;
size_t stride = v->stride;
size_t n = v->size;
</pre>
<p>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.
<p>Here is a table which shows the layout of the array <var>data</var>, and the
correspondence between the time-domain data z, and the
frequency-domain data x.
<pre class="example"> 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))
</pre>
<p class="noindent">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.
<hr>The GNU Scientific Library - a free numerical library licensed under the GNU GPL<br>Back to the <a href="/software/gsl/">GNU Scientific Library Homepage</a></body></html>
|