-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnfft.dox
368 lines (334 loc) · 10.3 KB
/
nfft.dox
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
/*
* Copyright (c) 2002, 2016 Jens Keiner, Stefan Kunis, Daniel Potts
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*! \file nfft3.h
* \brief Header file for the nfft3 library.
*/
/*! \def MACRO_MV_PLAN(RC)
* Macros for public members inherited by all plan structures.
* */
/**
* @defgroup nfft NFFT - Nonequispaced fast Fourier transform
* Direct and fast computation of the nonequispaced discrete Fourier transform.
* @{
*
* This module implements the nonequispaced fast Fourier transforms.
* In the following, we abbreviate the term "nonequispaced fast Fourier
* transform" by NFFT.
*
* We introduce our notation and nomenclature for discrete Fourier transforms.
* Let the torus
* \f[
* \mathbb{T}^d
* := \left\{ \mathbf{x}=\left(x_t\right)_{t=0,\hdots,d-1}\in\mathbb{R}^{d}:
* \; - \frac{1}{2} \le x_t < \frac{1}{2},\; t=0,\hdots,d-1 \right\}
* \f]
* of dimension \f$d\f$ be given.
* It will serve as domain from which the nonequispaced nodes \f$\mathbf{x}\f$
* are taken.
* The sampling set is given by \f${\cal X}:=\{\mathbf{x}_j \in {\mathbb T}^d:
* \,j=0,\hdots,M-1\}\f$.
* Possible frequencies \f$\mathbf{k}\f$ are collected in the multi index set
* \f[
* I_{\mathbf{N}} := \left\{ \mathbf{k}=\left(k_t\right)_{t=0,\hdots,d-1}\in
* \mathbb{Z}^d: - \frac{N_t}{2} \le k_t < \frac{N_t}{2} ,\;t=0,\hdots,d-1
* \right\}.
* \f]
*
* Our concern is the computation of the
* \e nonequispaced discrete Fourier transform \e (NDFT) \anchor ndft_formula
* \f[
* f_j = \sum_{\mathbf{k}\in I_{\mathbf{N}}}
* \hat{f}_{\mathbf{k}} {\rm e}^{-2\pi{\rm i} \mathbf{k}\mathbf{x}_j}, \qquad
* j=0,\hdots,M-1.
* \f]
* The corresponding adjoint NDFT is the computation of
* \f[
* \hat f_{\mathbf{k}}=\sum_{j=0}^{M-1} f_j {\rm e}^{+2\pi{\rm i}
* \mathbf{k}\mathbf{x}_j}, \qquad \mathbf{k}\in I_{\mathbf{N}}.
* \f]
* Direct implementations are given by \ref nfft_direct_trafo and \ref nfft_direct_adjoint
* taking \f${\cal O}(|I_{\mathbf{N}}|M)\f$ floating point operations.
* Approximative realisations take only
* \f${\cal O}(|I_{\mathbf{N}}|\log|I_{\mathbf{N}}|+M)\f$ floating point operations.
* These are provided by \ref nfft_trafo and \ref nfft_adjoint, respectively.
*/
/*! \struct nfft_plan
* NFFT transform plan
*/
/*! \fn void nfft_direct_trafo(nfft_plan *ths)
* Computes an NDFT, see the \ref ndft_formula "definition".
*
* \arg ths The pointer to a nfft plan
*
* \author Stefan Kunis, Daniel Potts
*/
/*! \fn void nfft_direct_adjoint(nfft_plan *ths)
* Computes an adjoint NDFT, see the \ref ndftH_formula "definition".
*
* \arg ths The pointer to a nfft plan
*
* \author Stefan Kunis, Daniel Potts
*/
/*! \fn void nfft_trafo(nfft_plan *ths)
* Computes a NFFT, see the \ref ndft_formula "definition".
*
* \arg ths The pointer to a nfft plan
*
* \author Stefan Kunis, Daniel Potts
*/
/*! \fn void nfft_adjoint(nfft_plan *ths)
* Computes an adjoint NFFT, see the \ref ndftH_formula "definition".
*
* \arg ths The pointer to a nfft plan
*
* \author Stefan Kunis, Daniel Potts
*/
/*! \fn void nfft_init_1d(nfft_plan *ths, int N1, int M)
* Initialisation of a transform plan, wrapper d=1.
*
* \arg ths The pointer to a nfft plan
* \arg N1 bandwidth
* \arg M The number of nodes
*
* \author Stefan Kunis, Daniel Potts
*/
/*! \fn void nfft_init_2d(nfft_plan *ths, int N1, int N2, int M)
* Initialisation of a transform plan, wrapper d=2.
*
* \arg ths The pointer to a nfft plan
* \arg N1 bandwidth
* \arg N2 bandwidth
* \arg M The number of nodes
*
* \author Stefan Kunis, Daniel Potts
*/
/*! \fn void nfft_init_3d(nfft_plan *ths, int N1, int N2, int N3, int M)
* Initialisation of a transform plan, wrapper d=3.
*
* \arg ths The pointer to a nfft plan
* \arg N1 bandwidth
* \arg N2 bandwidth
* \arg N3 bandwidth
* \arg M The number of nodes
*
* \author Stefan Kunis, Daniel Potts
*/
/*! \fn void nfft_init(nfft_plan *ths, int d, int *N, int M)
* Initialisation of a transform plan, simple.
*
* \arg ths The pointer to a nfft plan
* \arg d The dimension
* \arg N The multi bandwidth
* \arg M The number of nodes
*
* \author Stefan Kunis, Daniel Potts
*/
/*! \fn void nfft_init_advanced(nfft_plan *ths, int d, int *N, int M, unsigned flags_on, unsigned flags_off)
* Initialisation of a transform plan, advanced.
* NOT YET IMPLEMENTED!!
*
* \arg ths The pointer to a nfft plan
* \arg d The dimension
* \arg N The multi bandwidth
* \arg M The number of nodes
* \arg flags_on NFFT flags to switch on
* \arg flags_off NFFT flags to switch off
*
* \author Stefan Kunis, Daniel Potts
*/
/*! \fn void X(init_guru)(X(plan) *ths, int d, int *N, int M, int *n, int m, unsigned flags, unsigned fftw_flags)
* Initialisation of a transform plan, guru.
*
* \arg ths The pointer to a nfft plan
* \arg d The dimension
* \arg N The multi bandwidth
* \arg M The number of nodes
* \arg n The oversampled multi bandwidth
* \arg m The spatial cut-off
* \arg flags NFFT flags to use
* \arg fftw_flags_off FFTW flags to use
*
* \author Stefan Kunis, Daniel Potts
*/
/*! \fn void nfft_precompute_one_psi(nfft_plan *ths)
* Precomputation for a transform plan.
*
* \arg ths The pointer to a nfft plan
*
* \author Stefan Kunis
*
* wrapper for precompute*_psi
*
* if PRE_*_PSI is set the application program has to call this routine
* (after) setting the nodes x
*/
/*! \fn void nfft_precompute_full_psi(nfft_plan *ths)
* Superceded by nfft_precompute_one_psi.
* \author Stefan Kunis
*/
/*! \fn void nfft_precompute_psi(nfft_plan *ths)
* Superceded by nfft_precompute_one_psi.
* \author Stefan Kunis
*/
/*! \fn void nfft_precompute_lin_psi(nfft_plan *ths)
* Superceded by nfft_precompute_one_psi.
* \author Stefan Kunis
*/
/*! \fn void nfft_check(nfft_plan *ths)
* Checks a transform plan for frequently used bad parameter.
*
* \arg ths The pointer to a nfft plan
*
* \author Stefan Kunis, Daniel Potts
*/
/*! \fn void nfft_finalize(nfft_plan *ths)
* Destroys a transform plan.
*
* \arg ths The pointer to a nfft plan
*
* \author Stefan Kunis, Daniel Potts
*/
/*! \def PRE_PHI_HUT
* If this flag is set, the deconvolution step (the multiplication with the
* diagonal matrix \f$\mathbf{D}\f$) uses precomputed values of the Fourier
* transformed window function.
*
* \see nfft_init
* \see nfft_init_advanced
* \see nfft_init_guru
* \author Stefan Kunis
*/
/*! \def FG_PSI
* If this flag is set, the convolution step (the multiplication with the
* sparse matrix \f$\mathbf{B}\f$) uses particular properties of the Gaussian
* window function to trade multiplications for direct calls to exponential
* function.
*
* \see nfft_init
* \see nfft_init_advanced
* \see nfft_init_guru
* \author Stefan Kunis
*/
/*! \def PRE_LIN_PSI
* If this flag is set, the convolution step (the multiplication with the
* sparse matrix \f$\mathbf{B}\f$) uses linear interpolation from a lookup
* table of equispaced samples of the window function instead of exact values
* of the window function.
* At the moment a table of size \f$(K+1)d\f$ is used, where
* \f$K=2^{10}(m+1)\f$.
* An estimate for the size of the lookup table with respect to the target
* accuracy should be implemented.
*
* \see nfft_init
* \see nfft_init_advanced
* \see nfft_init_guru
* \author Stefan Kunis
*/
/*! \def PRE_FG_PSI
* If this flag is set, the convolution step (the multiplication with the
* sparse matrix \f$\mathbf{B}\f$) uses particular properties of the Gaussian
* window function to trade multiplications for direct calls to exponential
* function (the remaining \f$2dM\f$ direct calls are precomputed).
*
* \see nfft_init
* \see nfft_init_advanced
* \see nfft_init_guru
* \author Stefan Kunis
*/
/*! \def PRE_PSI
* If this flag is set, the convolution step (the multiplication with the
* sparse matrix \f$\mathbf{B}\f$) uses \f$(2m+2)dM\f$ precomputed values of
* the window function.
*
* \see nfft_init
* \see nfft_init_advanced
* \see nfft_init_guru
* \author Stefan Kunis
*/
/*! \def PRE_FULL_PSI
* If this flag is set, the convolution step (the multiplication with the
* sparse matrix \f$\mathbf{B}\f$) uses \f$(2m+2)^dM\f$ precomputed values of
* the window function, in addition indices of source and target vectors are
* stored.
*
* \see nfft_init
* \see nfft_init_advanced
* \see nfft_init_guru
* \author Stefan Kunis
*/
/*! \def MALLOC_X
* If this flag is set, (de)allocation of the node vector is done.
*
* \see nfft_init
* \see nfft_init_advanced
* \see nfft_init_guru
* \see nfft_finalize
* \author Stefan Kunis
*/
/*! \def MALLOC_F_HAT
* If this flag is set, (de)allocation of the vector of Fourier coefficients is
* done.
*
* \see nfft_init
* \see nfft_init_advanced
* \see nfft_init_guru
* \see nfft_finalize
* \author Stefan Kunis
*/
/*! \def MALLOC_F
* If this flag is set, (de)allocation of the vector of samples is done.
*
* \see nfft_init
* \see nfft_init_advanced
* \see nfft_init_guru
* \see nfft_finalize
* \author Stefan Kunis
*/
/*! \def FFT_OUT_OF_PLACE
* If this flag is set, FFTW uses disjoint input/output vectors.
*
* \see nfft_init
* \see nfft_init_advanced
* \see nfft_init_guru
* \see nfft_finalize
* \author Stefan Kunis
*/
/*! \def FFTW_INIT
* If this flag is set, fftw_init/fftw_finalize is called.
*
* \see nfft_init
* \see nfft_init_advanced
* \see nfft_init_guru
* \see nfft_finalize
* \author Stefan Kunis
*/
/*! \def PRE_ONE_PSI
* Summarises if precomputation is used within the convolution step (the
* multiplication with the sparse matrix \f$\mathbf{B}\f$).
* If testing against this flag is positive, \ref nfft_precompute_one_psi has
* to be called.
*
* \see nfft_init
* \see nfft_init_advanced
* \see nfft_init_guru
* \see nfft_precompute_one_psi
* \see nfft_finalize
* \author Stefan Kunis
*/
/** @}
*/