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

« back to all changes in this revision

Viewing changes to FAQ/fftw-faq.info

  • 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:
9
9
File: $prefix.info, Node: Top, Next: Question 1.1, Up: (dir)
10
10
 
11
11
            FFTW FREQUENTLY ASKED QUESTIONS WITH ANSWERS
12
 
                            07 Nov 1999
 
12
                            24 Mar 2003
13
13
                             Matteo Frigo
14
14
                           Steven G. Johnson
15
15
                            <fftw@fftw.org>
47
47
 
48
48
Section 3, Using FFTW
49
49
* Question 3.1::    FFTW seems really slow.
50
 
* Question 3.2::    FFTW gives results different from my old FFT.
51
 
* Question 3.3::    Can I save FFTW's plans?
52
 
* Question 3.4::    Why does your inverse transform return a scaled
 
50
* Question 3.2::    FFTW slows down after repeated calls.
 
51
* Question 3.3::    An FFTW routine is crashing when I call it.
 
52
* Question 3.4::    My Fortran program crashes when calling FFTW.
 
53
* Question 3.5::    FFTW gives results different from my old FFT.
 
54
* Question 3.6::    Your in-place transform gives incorrect results.
 
55
* Question 3.7::    Can I save FFTW's plans?
 
56
* Question 3.8::    Why does your inverse transform return a scaled
53
57
                    result?
54
 
* Question 3.5::    How can I make FFTW put the origin (zero frequency) at
 
58
* Question 3.9::    How can I make FFTW put the origin (zero frequency) at
55
59
                    the center of its output?
56
 
* Question 3.6::    How do I FFT an image/audio file in *foobar* format?
57
 
* Question 3.7::    My program does not link (on Unix).
 
60
* Question 3.10::   How do I FFT an image/audio file in *foobar* format?
 
61
* Question 3.11::   My program does not link (on Unix).
 
62
* Question 3.12::   My program crashes, complaining about stack space.
58
63
 
59
64
Section 4, Internals of FFTW
60
65
* Question 4.1::    How does FFTW work?
79
84
                    AIX.
80
85
* Question 5.10::   FFTW 2.1.2's complex transforms give incorrect results
81
86
                    for large prime sizes.
 
87
* Question 5.11::   FFTW 2.1.3 crashes on AIX
82
88
 
83
89
 
84
90
 
196
202
successful compilations of FFTW using Borland's C/C++ compilers on
197
203
Windows.
198
204
 
 
205
The Portland Group PGCC compiler, version 4.0 for Linux/x86, reportedly
 
206
produces incorrect code for FFTW 2.1.3.
 
207
 
199
208
Visual C++ 4.0 crashes when compiling FFTW 1.2 with all optimizations
200
209
turned on.  Visual C++ 5.0 reportedly produces incorrect code for the real
201
210
transforms in FFTW 2.x when the option "Maximize speed" is set.  We are
213
222
-xO5 option in Sun's SC4.0 C compiler.  egcs 1.0.2 produced incorrect code
214
223
for FFTW on the PowerPC (corrected in egcs 1.1).
215
224
 
 
225
The DEC C compiler, V5.8-009 on Digital UNIX V4.0 (Rev. 1091) is known to
 
226
have bugs with its EV6 tuning.  Specifically, compiling FFTW with -arch
 
227
host (the default) or -arch ev6 on an Alpha EV6 can cause FFTW (e.g.
 
228
fftw_test -s 256) to crash.
 
229
 
216
230
 
217
231
File: fftw-faq.info, Node: Question 2.4, Next: Question 2.5, Previous: Question 2.3, Up: Section 2
218
232
 
269
283
code, documented in the FFTW manual, is included with FFTW (versions 1.3
270
284
and higher).
271
285
 
 
286
By default, FFTW configures its wrapper routines to work with the first
 
287
compiler it finds, e.g. g77.  To configure for a different, incompatible
 
288
Fortran compiler foobar, use ./configure F77=foobar when installing FFTW.
 
289
 
272
290
 
273
291
File: fftw-faq.info, Node: Question 2.7, Next: Question 2.8, Previous: Question 2.6, Up: Section 2
274
292
 
300
318
 
301
319
* Menu:
302
320
* Question 3.1::    FFTW seems really slow.
303
 
* Question 3.2::    FFTW gives results different from my old FFT.
304
 
* Question 3.3::    Can I save FFTW's plans?
305
 
* Question 3.4::    Why does your inverse transform return a scaled
 
321
* Question 3.2::    FFTW slows down after repeated calls.
 
322
* Question 3.3::    An FFTW routine is crashing when I call it.
 
323
* Question 3.4::    My Fortran program crashes when calling FFTW.
 
324
* Question 3.5::    FFTW gives results different from my old FFT.
 
325
* Question 3.6::    Your in-place transform gives incorrect results.
 
326
* Question 3.7::    Can I save FFTW's plans?
 
327
* Question 3.8::    Why does your inverse transform return a scaled
306
328
                    result?
307
 
* Question 3.5::    How can I make FFTW put the origin (zero frequency) at
 
329
* Question 3.9::    How can I make FFTW put the origin (zero frequency) at
308
330
                    the center of its output?
309
 
* Question 3.6::    How do I FFT an image/audio file in *foobar* format?
310
 
* Question 3.7::    My program does not link (on Unix).
 
331
* Question 3.10::   How do I FFT an image/audio file in *foobar* format?
 
332
* Question 3.11::   My program does not link (on Unix).
 
333
* Question 3.12::   My program crashes, complaining about stack space.
311
334
 
312
335
 
313
336
 
326
349
FFTW_ESTIMATE option in the planner, which uses heuristics instead of
327
350
runtime measurements and produces a good plan in a short time.  Second,
328
351
you can use the wisdom feature to precompute the plan; see *Note Question
329
 
3.3:: `Can I save FFTW's plans?'
 
352
3.7:: `Can I save FFTW's plans?'
330
353
 
331
354
 
332
355
File: fftw-faq.info, Node: Question 3.2, Next: Question 3.3, Previous: Question 3.1, Up: Section 3
333
356
 
334
 
Question 3.2.  FFTW gives results different from my old FFT.
 
357
Question 3.2.  FFTW slows down after repeated calls.
 
358
 
 
359
Probably, NaNs or similar are creeping into your data, and the slowdown is
 
360
due to the resulting floating-point exceptions.  For example, be aware
 
361
that repeatedly FFTing the same array is a diverging process (because FFTW
 
362
computes the unnormalized transform).
 
363
 
 
364
 
 
365
File: fftw-faq.info, Node: Question 3.3, Next: Question 3.4, Previous: Question 3.2, Up: Section 3
 
366
 
 
367
Question 3.3.  An FFTW routine is crashing when I call it.
 
368
 
 
369
You almost certainly have a bug in your code.  For example, you could be
 
370
passing invalid arguments (such as wrongly-sized arrays) to FFTW, or you
 
371
could simply have memory corruption elsewhere in your program that causes
 
372
random crashes later on.  Learn to debug, and don't complain to us unless
 
373
you can come up with a minimal program (preferably under 30 lines) that
 
374
illustrates the problem.
 
375
 
 
376
 
 
377
File: fftw-faq.info, Node: Question 3.4, Next: Question 3.5, Previous: Question 3.3, Up: Section 3
 
378
 
 
379
Question 3.4.  My Fortran program crashes when calling FFTW.
 
380
 
 
381
As described in the manual, on 64-bit machines you must store the plans in
 
382
variables large enough to hold a pointer, for example integer*8.
 
383
 
 
384
 
 
385
File: fftw-faq.info, Node: Question 3.5, Next: Question 3.6, Previous: Question 3.4, Up: Section 3
 
386
 
 
387
Question 3.5.  FFTW gives results different from my old FFT.
335
388
 
336
389
People follow many different conventions for the DFT, and you should be
337
390
sure to know the ones that we use (described in the FFTW manual).  In
341
394
 
342
395
You should also know that we compute an unnormalized transform.  In
343
396
contrast, Matlab is an example of program that computes a normalized
344
 
transform.  See *Note Question 3.4:: `Why does your inverse transform
 
397
transform.  See *Note Question 3.8:: `Why does your inverse transform
345
398
return a scaled result?'.
346
399
 
347
 
 
348
 
File: fftw-faq.info, Node: Question 3.3, Next: Question 3.4, Previous: Question 3.2, Up: Section 3
349
 
 
350
 
Question 3.3.  Can I save FFTW's plans?
 
400
Finally, note that floating-point arithmetic is not exact, so different
 
401
FFT algorithms will give slightly different results (on the order of the
 
402
numerical accuracy; typically a fractional difference of 1e-15 or so).
 
403
 
 
404
 
 
405
File: fftw-faq.info, Node: Question 3.6, Next: Question 3.7, Previous: Question 3.5, Up: Section 3
 
406
 
 
407
Question 3.6.  Your in-place transform gives incorrect results.
 
408
 
 
409
As described in the FFTW manual, the output array argument has a special
 
410
meaning for FFTW_INPLACE transforms; you should not pass the input array
 
411
for this argument.
 
412
 
 
413
 
 
414
File: fftw-faq.info, Node: Question 3.7, Next: Question 3.8, Previous: Question 3.6, Up: Section 3
 
415
 
 
416
Question 3.7.  Can I save FFTW's plans?
351
417
 
352
418
Yes. Starting with version 1.2, FFTW provides the  wisdom mechanism for
353
419
saving plans.  See *Note Question 4.3:: `What is this wisdom thing?' and
354
420
the FFTW manual.
355
421
 
356
422
 
357
 
File: fftw-faq.info, Node: Question 3.4, Next: Question 3.5, Previous: Question 3.3, Up: Section 3
 
423
File: fftw-faq.info, Node: Question 3.8, Next: Question 3.9, Previous: Question 3.7, Up: Section 3
358
424
 
359
 
Question 3.4.  Why does your inverse transform return a scaled result?
 
425
Question 3.8.  Why does your inverse transform return a scaled result?
360
426
 
361
427
Computing the forward transform followed by the backward transform (or
362
428
vice versa) yields the original array scaled by the size of the array.
371
437
typically be absorbed at little or no cost.
372
438
 
373
439
 
374
 
File: fftw-faq.info, Node: Question 3.5, Next: Question 3.6, Previous: Question 3.4, Up: Section 3
 
440
File: fftw-faq.info, Node: Question 3.9, Next: Question 3.10, Previous: Question 3.8, Up: Section 3
375
441
 
376
 
Question 3.5.  How can I make FFTW put the origin (zero frequency) at the center of its output?
 
442
Question 3.9.  How can I make FFTW put the origin (zero frequency) at the center of its output?
377
443
 
378
444
For human viewing of a spectrum, it is often convenient to put the origin
379
445
in frequency space at the center of the output array, rather than in the
384
450
is not specific to FFTW.)
385
451
 
386
452
 
387
 
File: fftw-faq.info, Node: Question 3.6, Next: Question 3.7, Previous: Question 3.5, Up: Section 3
 
453
File: fftw-faq.info, Node: Question 3.10, Next: Question 3.11, Previous: Question 3.9, Up: Section 3
388
454
 
389
 
Question 3.6.  How do I FFT an image/audio file in *foobar* format?
 
455
Question 3.10.  How do I FFT an image/audio file in *foobar* format?
390
456
 
391
457
FFTW performs an FFT on an array of floating-point values.  You can
392
458
certainly use it to compute the transform of an image or audio stream, but
394
460
the form FFTW requires.
395
461
 
396
462
 
397
 
File: fftw-faq.info, Node: Question 3.7, Next: Question 4.1, Previous: Question 3.6, Up: Section 3
 
463
File: fftw-faq.info, Node: Question 3.11, Next: Question 3.12, Previous: Question 3.10, Up: Section 3
398
464
 
399
 
Question 3.7.  My program does not link (on Unix).
 
465
Question 3.11.  My program does not link (on Unix).
400
466
 
401
467
Please use the exact order in which libraries are specified by the FFTW
402
468
manual (e.g. -lrfftw -lfftw -lm).  Also, note that the libraries must be
405
471
For example, switching the order to -lfftw -lrfftw -lm will fail.
406
472
 
407
473
 
 
474
File: fftw-faq.info, Node: Question 3.12, Next: Question 4.1, Previous: Question 3.11, Up: Section 3
 
475
 
 
476
Question 3.12.  My program crashes, complaining about stack space.
 
477
 
 
478
You cannot declare large arrays statically; you should use malloc (or
 
479
equivalent) to allocate the arrays you want to transform if they are
 
480
larger than a few hundred elements.
 
481
 
 
482
 
408
483
File: fftw-faq.info, Node: Section 4, Next: Section 5, Previous: Section 3, Up: Top
409
484
 
410
485
Internals of FFTW
417
492
 
418
493
 
419
494
 
420
 
File: fftw-faq.info, Node: Question 4.1, Next: Question 4.2, Previous: Question 3.7, Up: Section 4
 
495
File: fftw-faq.info, Node: Question 4.1, Next: Question 4.2, Previous: Question 3.12, Up: Section 4
421
496
 
422
497
Question 4.1.  How does FFTW work?
423
498
 
496
571
                    AIX.
497
572
* Question 5.10::   FFTW 2.1.2's complex transforms give incorrect results
498
573
                    for large prime sizes.
 
574
* Question 5.11::   FFTW 2.1.3 crashes on AIX
499
575
 
500
576
 
501
577
 
580
656
default.
581
657
 
582
658
 
583
 
File: fftw-faq.info, Node: Question 5.10, Previous: Question 5.9, Up: Section 5
 
659
File: fftw-faq.info, Node: Question 5.10, Next: Question 5.11, Previous: Question 5.9, Up: Section 5
584
660
 
585
661
Question 5.10.  FFTW 2.1.2's complex transforms give incorrect results for large prime sizes.
586
662
 
589
665
that caused incorrect results for many primes greater than 32768 (on
590
666
32-bit machines).  (Sizes without large prime factors are not affected.)
591
667
 
 
668
 
 
669
File: fftw-faq.info, Node: Question 5.11, Previous: Question 5.10, Up: Section 5
 
670
 
 
671
Question 5.11.  FFTW 2.1.3 crashes on AIX
 
672
 
 
673
The FFTW 2.1.3 configure script picked incorrect compiler flags for the
 
674
xlc compiler on newer IBM processors.  This is fixed in FFTW 2.1.4.
 
675