~ubuntu-branches/ubuntu/quantal/fftw/quantal

« back to all changes in this revision

Viewing changes to FAQ/fftw-faq.ascii

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-29 01:48:33 UTC
  • mfrom: (5.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20111129014833-3leawsns2nghyaoj
Tags: 2.1.5-1
* Team upload.
* New upstream release
* Package moved into the Debian Science team (no answer from the previous
  maintainer) and package not maintained.
* Standards-Version updated to version 3.9.2
* Vcs-Browser & Vcs-Svn updated
* Switch to mpi-default-dev (Closes: #571446)
* Get ride of .la files (Closes: #633175)
* Fix lintian warning debhelper-but-no-misc-depends
* Fix lintian warning patch-system-but-direct-changes-in-diff 
* Switch to dpkg-source 3.0 (quilt) format

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
            FFTW FREQUENTLY ASKED QUESTIONS WITH ANSWERS
2
 
                            07 Nov 1999
 
2
                            24 Mar 2003
3
3
                             Matteo Frigo
4
4
                           Steven G. Johnson
5
5
                            <fftw@fftw.org>
31
31
 
32
32
 Section 3.  Using FFTW
33
33
 Q3.1        FFTW seems really slow.
34
 
 Q3.2        FFTW gives results different from my old FFT.
35
 
 Q3.3        Can I save FFTW's plans?
36
 
 Q3.4        Why does your inverse transform return a scaled result?
37
 
 Q3.5        How can I make FFTW put the origin (zero frequency) at the center 
38
 
 Q3.6        How do I FFT an image/audio file in *foobar* format?
39
 
 Q3.7        My program does not link (on Unix).
 
34
 Q3.2        FFTW slows down after repeated calls.
 
35
 Q3.3        An FFTW routine is crashing when I call it.
 
36
 Q3.4        My Fortran program crashes when calling FFTW.
 
37
 Q3.5        FFTW gives results different from my old FFT.
 
38
 Q3.6        Your in-place transform gives incorrect results.
 
39
 Q3.7        Can I save FFTW's plans?
 
40
 Q3.8        Why does your inverse transform return a scaled result?
 
41
 Q3.9        How can I make FFTW put the origin (zero frequency) at the center 
 
42
 Q3.10       How do I FFT an image/audio file in *foobar* format?
 
43
 Q3.11       My program does not link (on Unix).
 
44
 Q3.12       My program crashes, complaining about stack space.
40
45
 
41
46
 Section 4.  Internals of FFTW
42
47
 Q4.1        How does FFTW work?
55
60
 Q5.8        FFTW 2.1.1's MPI test programs crash with MPICH.
56
61
 Q5.9        FFTW 2.1.2's multi-threaded transforms don't work on AIX.
57
62
 Q5.10       FFTW 2.1.2's complex transforms give incorrect results for large p
 
63
 Q5.11       FFTW 2.1.3 crashes on AIX
58
64
 
59
65
===============================================================================
60
66
 
157
163
successful compilations of FFTW using Borland's C/C++ compilers on
158
164
Windows.
159
165
 
 
166
The Portland Group PGCC compiler, version 4.0 for Linux/x86, reportedly
 
167
produces incorrect code for FFTW 2.1.3.
 
168
 
160
169
Visual C++ 4.0 crashes when compiling FFTW 1.2 with all optimizations
161
170
turned on.  Visual C++ 5.0 reportedly produces incorrect code for the real
162
171
transforms in FFTW 2.x when the option "Maximize speed" is set.  We are
174
183
-xO5 option in Sun's SC4.0 C compiler.  egcs 1.0.2 produced incorrect code
175
184
for FFTW on the PowerPC (corrected in egcs 1.1).
176
185
 
 
186
The DEC C compiler, V5.8-009 on Digital UNIX V4.0 (Rev. 1091) is known to
 
187
have bugs with its EV6 tuning.  Specifically, compiling FFTW with -arch
 
188
host (the default) or -arch ev6 on an Alpha EV6 can cause FFTW (e.g.
 
189
fftw_test -s 256) to crash.
 
190
 
177
191
-------------------------------------------------------------------------------
178
192
 
179
193
Question 2.4.  FFTW does not compile on Solaris, complaining about const.
227
241
code, documented in the FFTW manual, is included with FFTW (versions 1.3
228
242
and higher).
229
243
 
 
244
By default, FFTW configures its wrapper routines to work with the first
 
245
compiler it finds, e.g. g77.  To configure for a different, incompatible
 
246
Fortran compiler foobar, use ./configure F77=foobar when installing FFTW.
 
247
 
230
248
-------------------------------------------------------------------------------
231
249
 
232
250
Question 2.7.  Can I call FFTW from C++?
253
271
Section 3.  Using FFTW
254
272
 
255
273
 Q3.1        FFTW seems really slow.
256
 
 Q3.2        FFTW gives results different from my old FFT.
257
 
 Q3.3        Can I save FFTW's plans?
258
 
 Q3.4        Why does your inverse transform return a scaled result?
259
 
 Q3.5        How can I make FFTW put the origin (zero frequency) at the center 
260
 
 Q3.6        How do I FFT an image/audio file in *foobar* format?
261
 
 Q3.7        My program does not link (on Unix).
 
274
 Q3.2        FFTW slows down after repeated calls.
 
275
 Q3.3        An FFTW routine is crashing when I call it.
 
276
 Q3.4        My Fortran program crashes when calling FFTW.
 
277
 Q3.5        FFTW gives results different from my old FFT.
 
278
 Q3.6        Your in-place transform gives incorrect results.
 
279
 Q3.7        Can I save FFTW's plans?
 
280
 Q3.8        Why does your inverse transform return a scaled result?
 
281
 Q3.9        How can I make FFTW put the origin (zero frequency) at the center 
 
282
 Q3.10       How do I FFT an image/audio file in *foobar* format?
 
283
 Q3.11       My program does not link (on Unix).
 
284
 Q3.12       My program crashes, complaining about stack space.
262
285
 
263
286
-------------------------------------------------------------------------------
264
287
 
275
298
is significant, you have two options.  First, you can use the
276
299
FFTW_ESTIMATE option in the planner, which uses heuristics instead of
277
300
runtime measurements and produces a good plan in a short time.  Second,
278
 
you can use the wisdom feature to precompute the plan; see Q3.3 `Can I
 
301
you can use the wisdom feature to precompute the plan; see Q3.7 `Can I
279
302
save FFTW's plans?'
280
303
 
281
304
-------------------------------------------------------------------------------
282
305
 
283
 
Question 3.2.  FFTW gives results different from my old FFT.
 
306
Question 3.2.  FFTW slows down after repeated calls.
 
307
 
 
308
Probably, NaNs or similar are creeping into your data, and the slowdown is
 
309
due to the resulting floating-point exceptions.  For example, be aware
 
310
that repeatedly FFTing the same array is a diverging process (because FFTW
 
311
computes the unnormalized transform).
 
312
 
 
313
-------------------------------------------------------------------------------
 
314
 
 
315
Question 3.3.  An FFTW routine is crashing when I call it.
 
316
 
 
317
You almost certainly have a bug in your code.  For example, you could be
 
318
passing invalid arguments (such as wrongly-sized arrays) to FFTW, or you
 
319
could simply have memory corruption elsewhere in your program that causes
 
320
random crashes later on.  Learn to debug, and don't complain to us unless
 
321
you can come up with a minimal program (preferably under 30 lines) that
 
322
illustrates the problem.
 
323
 
 
324
-------------------------------------------------------------------------------
 
325
 
 
326
Question 3.4.  My Fortran program crashes when calling FFTW.
 
327
 
 
328
As described in the manual, on 64-bit machines you must store the plans in
 
329
variables large enough to hold a pointer, for example integer*8.
 
330
 
 
331
-------------------------------------------------------------------------------
 
332
 
 
333
Question 3.5.  FFTW gives results different from my old FFT.
284
334
 
285
335
People follow many different conventions for the DFT, and you should be
286
336
sure to know the ones that we use (described in the FFTW manual).  In
290
340
 
291
341
You should also know that we compute an unnormalized transform.  In
292
342
contrast, Matlab is an example of program that computes a normalized
293
 
transform.  See Q3.4 `Why does your inverse transform return a scaled
 
343
transform.  See Q3.8 `Why does your inverse transform return a scaled
294
344
result?'.
295
345
 
296
 
-------------------------------------------------------------------------------
297
 
 
298
 
Question 3.3.  Can I save FFTW's plans?
 
346
Finally, note that floating-point arithmetic is not exact, so different
 
347
FFT algorithms will give slightly different results (on the order of the
 
348
numerical accuracy; typically a fractional difference of 1e-15 or so).
 
349
 
 
350
-------------------------------------------------------------------------------
 
351
 
 
352
Question 3.6.  Your in-place transform gives incorrect results.
 
353
 
 
354
As described in the FFTW manual, the output array argument has a special
 
355
meaning for FFTW_INPLACE transforms; you should not pass the input array
 
356
for this argument.
 
357
 
 
358
-------------------------------------------------------------------------------
 
359
 
 
360
Question 3.7.  Can I save FFTW's plans?
299
361
 
300
362
Yes. Starting with version 1.2, FFTW provides the  wisdom mechanism for
301
363
saving plans.  See Q4.3 `What is this wisdom thing?' and the FFTW manual.
302
364
 
303
365
-------------------------------------------------------------------------------
304
366
 
305
 
Question 3.4.  Why does your inverse transform return a scaled result?
 
367
Question 3.8.  Why does your inverse transform return a scaled result?
306
368
 
307
369
Computing the forward transform followed by the backward transform (or
308
370
vice versa) yields the original array scaled by the size of the array.
318
380
 
319
381
-------------------------------------------------------------------------------
320
382
 
321
 
Question 3.5.  How can I make FFTW put the origin (zero frequency) at the center of its output?
 
383
Question 3.9.  How can I make FFTW put the origin (zero frequency) at the center of its output?
322
384
 
323
385
For human viewing of a spectrum, it is often convenient to put the origin
324
386
in frequency space at the center of the output array, rather than in the
330
392
 
331
393
-------------------------------------------------------------------------------
332
394
 
333
 
Question 3.6.  How do I FFT an image/audio file in *foobar* format?
 
395
Question 3.10.  How do I FFT an image/audio file in *foobar* format?
334
396
 
335
397
FFTW performs an FFT on an array of floating-point values.  You can
336
398
certainly use it to compute the transform of an image or audio stream, but
339
401
 
340
402
-------------------------------------------------------------------------------
341
403
 
342
 
Question 3.7.  My program does not link (on Unix).
 
404
Question 3.11.  My program does not link (on Unix).
343
405
 
344
406
Please use the exact order in which libraries are specified by the FFTW
345
407
manual (e.g. -lrfftw -lfftw -lm).  Also, note that the libraries must be
347
409
*A* uses *B*, then *A* must be listed before *B* in the link command.).
348
410
For example, switching the order to -lfftw -lrfftw -lm will fail.
349
411
 
 
412
-------------------------------------------------------------------------------
 
413
 
 
414
Question 3.12.  My program crashes, complaining about stack space.
 
415
 
 
416
You cannot declare large arrays statically; you should use malloc (or
 
417
equivalent) to allocate the arrays you want to transform if they are
 
418
larger than a few hundred elements.
 
419
 
350
420
===============================================================================
351
421
 
352
422
Section 4.  Internals of FFTW
426
496
 Q5.8        FFTW 2.1.1's MPI test programs crash with MPICH.
427
497
 Q5.9        FFTW 2.1.2's multi-threaded transforms don't work on AIX.
428
498
 Q5.10       FFTW 2.1.2's complex transforms give incorrect results for large p
 
499
 Q5.11       FFTW 2.1.3 crashes on AIX
429
500
 
430
501
-------------------------------------------------------------------------------
431
502
 
508
579
that caused incorrect results for many primes greater than 32768 (on
509
580
32-bit machines).  (Sizes without large prime factors are not affected.)
510
581
 
 
582
-------------------------------------------------------------------------------
 
583
 
 
584
Question 5.11.  FFTW 2.1.3 crashes on AIX
 
585
 
 
586
The FFTW 2.1.3 configure script picked incorrect compiler flags for the
 
587
xlc compiler on newer IBM processors.  This is fixed in FFTW 2.1.4.
 
588