Mercurial > hg > js-dsp-test
comparison fft/fftw/fftw-3.3.4/doc/html/Words-of-Wisdom_002dSaving-Plans.html @ 19:26056e866c29
Add FFTW to comparison table
author | Chris Cannam |
---|---|
date | Tue, 06 Oct 2015 13:08:39 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
18:8db794ca3e0b | 19:26056e866c29 |
---|---|
1 <html lang="en"> | |
2 <head> | |
3 <title>Words of Wisdom-Saving Plans - FFTW 3.3.4</title> | |
4 <meta http-equiv="Content-Type" content="text/html"> | |
5 <meta name="description" content="FFTW 3.3.4"> | |
6 <meta name="generator" content="makeinfo 4.13"> | |
7 <link title="Top" rel="start" href="index.html#Top"> | |
8 <link rel="up" href="Other-Important-Topics.html#Other-Important-Topics" title="Other Important Topics"> | |
9 <link rel="prev" href="Multi_002ddimensional-Array-Format.html#Multi_002ddimensional-Array-Format" title="Multi-dimensional Array Format"> | |
10 <link rel="next" href="Caveats-in-Using-Wisdom.html#Caveats-in-Using-Wisdom" title="Caveats in Using Wisdom"> | |
11 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> | |
12 <!-- | |
13 This manual is for FFTW | |
14 (version 3.3.4, 20 September 2013). | |
15 | |
16 Copyright (C) 2003 Matteo Frigo. | |
17 | |
18 Copyright (C) 2003 Massachusetts Institute of Technology. | |
19 | |
20 Permission is granted to make and distribute verbatim copies of | |
21 this manual provided the copyright notice and this permission | |
22 notice are preserved on all copies. | |
23 | |
24 Permission is granted to copy and distribute modified versions of | |
25 this manual under the conditions for verbatim copying, provided | |
26 that the entire resulting derived work is distributed under the | |
27 terms of a permission notice identical to this one. | |
28 | |
29 Permission is granted to copy and distribute translations of this | |
30 manual into another language, under the above conditions for | |
31 modified versions, except that this permission notice may be | |
32 stated in a translation approved by the Free Software Foundation. | |
33 --> | |
34 <meta http-equiv="Content-Style-Type" content="text/css"> | |
35 <style type="text/css"><!-- | |
36 pre.display { font-family:inherit } | |
37 pre.format { font-family:inherit } | |
38 pre.smalldisplay { font-family:inherit; font-size:smaller } | |
39 pre.smallformat { font-family:inherit; font-size:smaller } | |
40 pre.smallexample { font-size:smaller } | |
41 pre.smalllisp { font-size:smaller } | |
42 span.sc { font-variant:small-caps } | |
43 span.roman { font-family:serif; font-weight:normal; } | |
44 span.sansserif { font-family:sans-serif; font-weight:normal; } | |
45 --></style> | |
46 </head> | |
47 <body> | |
48 <div class="node"> | |
49 <a name="Words-of-Wisdom-Saving-Plans"></a> | |
50 <a name="Words-of-Wisdom_002dSaving-Plans"></a> | |
51 <p> | |
52 Next: <a rel="next" accesskey="n" href="Caveats-in-Using-Wisdom.html#Caveats-in-Using-Wisdom">Caveats in Using Wisdom</a>, | |
53 Previous: <a rel="previous" accesskey="p" href="Multi_002ddimensional-Array-Format.html#Multi_002ddimensional-Array-Format">Multi-dimensional Array Format</a>, | |
54 Up: <a rel="up" accesskey="u" href="Other-Important-Topics.html#Other-Important-Topics">Other Important Topics</a> | |
55 <hr> | |
56 </div> | |
57 | |
58 <h3 class="section">3.3 Words of Wisdom—Saving Plans</h3> | |
59 | |
60 <p><a name="index-wisdom-124"></a><a name="index-saving-plans-to-disk-125"></a> | |
61 FFTW implements a method for saving plans to disk and restoring them. | |
62 In fact, what FFTW does is more general than just saving and loading | |
63 plans. The mechanism is called <dfn>wisdom</dfn>. Here, we describe | |
64 this feature at a high level. See <a href="FFTW-Reference.html#FFTW-Reference">FFTW Reference</a>, for a less casual | |
65 but more complete discussion of how to use wisdom in FFTW. | |
66 | |
67 <p>Plans created with the <code>FFTW_MEASURE</code>, <code>FFTW_PATIENT</code>, or | |
68 <code>FFTW_EXHAUSTIVE</code> options produce near-optimal FFT performance, | |
69 but may require a long time to compute because FFTW must measure the | |
70 runtime of many possible plans and select the best one. This setup is | |
71 designed for the situations where so many transforms of the same size | |
72 must be computed that the start-up time is irrelevant. For short | |
73 initialization times, but slower transforms, we have provided | |
74 <code>FFTW_ESTIMATE</code>. The <code>wisdom</code> mechanism is a way to get the | |
75 best of both worlds: you compute a good plan once, save it to | |
76 disk, and later reload it as many times as necessary. The wisdom | |
77 mechanism can actually save and reload many plans at once, not just | |
78 one. | |
79 <a name="index-FFTW_005fMEASURE-126"></a><a name="index-FFTW_005fPATIENT-127"></a><a name="index-FFTW_005fEXHAUSTIVE-128"></a><a name="index-FFTW_005fESTIMATE-129"></a> | |
80 | |
81 <p>Whenever you create a plan, the FFTW planner accumulates wisdom, which | |
82 is information sufficient to reconstruct the plan. After planning, | |
83 you can save this information to disk by means of the function: | |
84 <pre class="example"> int fftw_export_wisdom_to_filename(const char *filename); | |
85 </pre> | |
86 <p><a name="index-fftw_005fexport_005fwisdom_005fto_005ffilename-130"></a>(This function returns non-zero on success.) | |
87 | |
88 <p>The next time you run the program, you can restore the wisdom with | |
89 <code>fftw_import_wisdom_from_filename</code> (which also returns non-zero on success), | |
90 and then recreate the plan using the same flags as before. | |
91 <pre class="example"> int fftw_import_wisdom_from_filename(const char *filename); | |
92 </pre> | |
93 <p><a name="index-fftw_005fimport_005fwisdom_005ffrom_005ffilename-131"></a> | |
94 Wisdom is automatically used for any size to which it is applicable, as | |
95 long as the planner flags are not more “patient” than those with which | |
96 the wisdom was created. For example, wisdom created with | |
97 <code>FFTW_MEASURE</code> can be used if you later plan with | |
98 <code>FFTW_ESTIMATE</code> or <code>FFTW_MEASURE</code>, but not with | |
99 <code>FFTW_PATIENT</code>. | |
100 | |
101 <p>The <code>wisdom</code> is cumulative, and is stored in a global, private | |
102 data structure managed internally by FFTW. The storage space required | |
103 is minimal, proportional to the logarithm of the sizes the wisdom was | |
104 generated from. If memory usage is a concern, however, the wisdom can | |
105 be forgotten and its associated memory freed by calling: | |
106 <pre class="example"> void fftw_forget_wisdom(void); | |
107 </pre> | |
108 <p><a name="index-fftw_005fforget_005fwisdom-132"></a> | |
109 Wisdom can be exported to a file, a string, or any other medium. | |
110 For details, see <a href="Wisdom.html#Wisdom">Wisdom</a>. | |
111 | |
112 </body></html> | |
113 |