Initialize Tizen 2.3
[framework/multimedia/gst-plugins-base0.10.git] / wearable / docs / libs / html / gst-plugins-base-libs-gstfftf32.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>gstfftf32</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GStreamer Base Plugins 0.10 Library Reference Manual">
8 <link rel="up" href="gstreamer-ffft.html" title="FFT Library">
9 <link rel="prev" href="gst-plugins-base-libs-gstffts32.html" title="gstffts32">
10 <link rel="next" href="gst-plugins-base-libs-gstfftf64.html" title="gstfftf64">
11 <meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
16 <tr valign="middle">
17 <td><a accesskey="p" href="gst-plugins-base-libs-gstffts32.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="gstreamer-ffft.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">GStreamer Base Plugins 0.10 Library Reference Manual</th>
21 <td><a accesskey="n" href="gst-plugins-base-libs-gstfftf64.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
22 </tr>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#gst-plugins-base-libs-gstfftf32.synopsis" class="shortcut">Top</a>
25                    | 
26                   <a href="#gst-plugins-base-libs-gstfftf32.description" class="shortcut">Description</a>
27 </td></tr>
28 </table>
29 <div class="refentry">
30 <a name="gst-plugins-base-libs-gstfftf32"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
32 <td valign="top">
33 <h2><span class="refentrytitle"><a name="gst-plugins-base-libs-gstfftf32.top_of_page"></a>gstfftf32</span></h2>
34 <p>gstfftf32 — FFT functions for 32 bit float samples</p>
35 </td>
36 <td valign="top" align="right"></td>
37 </tr></table></div>
38 <div class="refsynopsisdiv">
39 <a name="gst-plugins-base-libs-gstfftf32.synopsis"></a><h2>Synopsis</h2>
40 <pre class="synopsis">
41 #include &lt;gst/fft/gstfftf32.h&gt;
42
43 struct              <a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32">GstFFTF32</a>;
44 struct              <a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32Complex" title="struct GstFFTF32Complex">GstFFTF32Complex</a>;
45 <a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32"><span class="returnvalue">GstFFTF32</span></a> *         <a class="link" href="gst-plugins-base-libs-gstfftf32.html#gst-fft-f32-new" title="gst_fft_f32_new ()">gst_fft_f32_new</a>                     (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> len</code></em>,
46                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> inverse</code></em>);
47 <span class="returnvalue">void</span>                <a class="link" href="gst-plugins-base-libs-gstfftf32.html#gst-fft-f32-fft" title="gst_fft_f32_fft ()">gst_fft_f32_fft</a>                     (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32"><span class="type">GstFFTF32</span></a> *self</code></em>,
48                                                          <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gfloat"><span class="type">gfloat</span></a> *timedata</code></em>,
49                                                          <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32Complex" title="struct GstFFTF32Complex"><span class="type">GstFFTF32Complex</span></a> *freqdata</code></em>);
50 <span class="returnvalue">void</span>                <a class="link" href="gst-plugins-base-libs-gstfftf32.html#gst-fft-f32-inverse-fft" title="gst_fft_f32_inverse_fft ()">gst_fft_f32_inverse_fft</a>             (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32"><span class="type">GstFFTF32</span></a> *self</code></em>,
51                                                          <em class="parameter"><code>const <a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32Complex" title="struct GstFFTF32Complex"><span class="type">GstFFTF32Complex</span></a> *freqdata</code></em>,
52                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gfloat"><span class="type">gfloat</span></a> *timedata</code></em>);
53 <span class="returnvalue">void</span>                <a class="link" href="gst-plugins-base-libs-gstfftf32.html#gst-fft-f32-window" title="gst_fft_f32_window ()">gst_fft_f32_window</a>                  (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32"><span class="type">GstFFTF32</span></a> *self</code></em>,
54                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gfloat"><span class="type">gfloat</span></a> *timedata</code></em>,
55                                                          <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstfft.html#GstFFTWindow" title="enum GstFFTWindow"><span class="type">GstFFTWindow</span></a> window</code></em>);
56 <span class="returnvalue">void</span>                <a class="link" href="gst-plugins-base-libs-gstfftf32.html#gst-fft-f32-free" title="gst_fft_f32_free ()">gst_fft_f32_free</a>                    (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32"><span class="type">GstFFTF32</span></a> *self</code></em>);
57 </pre>
58 </div>
59 <div class="refsect1">
60 <a name="gst-plugins-base-libs-gstfftf32.description"></a><h2>Description</h2>
61 <p>
62 <a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32"><span class="type">GstFFTF32</span></a> provides a FFT implementation and related functions for
63 32 bit float samples. To use this call <a class="link" href="gst-plugins-base-libs-gstfftf32.html#gst-fft-f32-new" title="gst_fft_f32_new ()"><code class="function">gst_fft_f32_new()</code></a> for
64 allocating a <a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32"><span class="type">GstFFTF32</span></a> instance with the appropriate parameters and
65 then call <a class="link" href="gst-plugins-base-libs-gstfftf32.html#gst-fft-f32-fft" title="gst_fft_f32_fft ()"><code class="function">gst_fft_f32_fft()</code></a> or <a class="link" href="gst-plugins-base-libs-gstfftf32.html#gst-fft-f32-inverse-fft" title="gst_fft_f32_inverse_fft ()"><code class="function">gst_fft_f32_inverse_fft()</code></a> to perform the
66 FFT or inverse FFT on a buffer of samples.
67 </p>
68 <p>
69 After use free the <a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32"><span class="type">GstFFTF32</span></a> instance with <a class="link" href="gst-plugins-base-libs-gstfftf32.html#gst-fft-f32-free" title="gst_fft_f32_free ()"><code class="function">gst_fft_f32_free()</code></a>.
70 </p>
71 <p>
72 For the best performance use <a class="link" href="gst-plugins-base-libs-gstfft.html#gst-fft-next-fast-length" title="gst_fft_next_fast_length ()"><code class="function">gst_fft_next_fast_length()</code></a> to get a
73 number that is entirely a product of 2, 3 and 5 and use this as the
74 <em class="parameter"><code>len</code></em> parameter for <a class="link" href="gst-plugins-base-libs-gstfftf32.html#gst-fft-f32-new" title="gst_fft_f32_new ()"><code class="function">gst_fft_f32_new()</code></a>.
75 </p>
76 <p>
77 The <em class="parameter"><code>len</code></em> parameter specifies the number of samples in the time domain that
78 will be processed or generated. The number of samples in the frequency domain
79 is <em class="parameter"><code>len</code></em>/2 + 1. To get n samples in the frequency domain use 2*n - 2 as <em class="parameter"><code>len</code></em>.
80 </p>
81 <p>
82 Before performing the FFT on time domain data it usually makes sense
83 to apply a window function to it. For this <a class="link" href="gst-plugins-base-libs-gstfftf32.html#gst-fft-f32-window" title="gst_fft_f32_window ()"><code class="function">gst_fft_f32_window()</code></a> can comfortably
84 be used.
85 </p>
86 <p>
87 Be aware, that you can't simply run <a class="link" href="gst-plugins-base-libs-gstfftf32.html#gst-fft-f32-inverse-fft" title="gst_fft_f32_inverse_fft ()"><code class="function">gst_fft_f32_inverse_fft()</code></a> on the
88 resulting frequency data of <a class="link" href="gst-plugins-base-libs-gstfftf32.html#gst-fft-f32-fft" title="gst_fft_f32_fft ()"><code class="function">gst_fft_f32_fft()</code></a> to get the original data back.
89 The relation between them is iFFT (FFT (x)) = x * nfft where nfft is the
90 length of the FFT. This also has to be taken into account when calculation
91 the magnitude of the frequency data.
92 </p>
93 </div>
94 <div class="refsect1">
95 <a name="gst-plugins-base-libs-gstfftf32.details"></a><h2>Details</h2>
96 <div class="refsect2">
97 <a name="GstFFTF32"></a><h3>struct GstFFTF32</h3>
98 <pre class="programlisting">struct GstFFTF32 {
99 };
100 </pre>
101 <p>
102 Instance structure for <a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32"><span class="type">GstFFTF32</span></a>.
103 </p>
104 </div>
105 <hr>
106 <div class="refsect2">
107 <a name="GstFFTF32Complex"></a><h3>struct GstFFTF32Complex</h3>
108 <pre class="programlisting">struct GstFFTF32Complex {
109   gfloat r;
110   gfloat i;
111 };
112 </pre>
113 <p>
114 Data type for complex numbers composed of
115 32 bit float.
116 </p>
117 <div class="variablelist"><table border="0">
118 <col align="left" valign="top">
119 <tbody>
120 <tr>
121 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gfloat"><span class="type">gfloat</span></a> <em class="structfield"><code><a name="GstFFTF32Complex.r"></a>r</code></em>;</span></p></td>
122 <td>Real part</td>
123 </tr>
124 <tr>
125 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gfloat"><span class="type">gfloat</span></a> <em class="structfield"><code><a name="GstFFTF32Complex.i"></a>i</code></em>;</span></p></td>
126 <td>Imaginary part</td>
127 </tr>
128 </tbody>
129 </table></div>
130 </div>
131 <hr>
132 <div class="refsect2">
133 <a name="gst-fft-f32-new"></a><h3>gst_fft_f32_new ()</h3>
134 <pre class="programlisting"><a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32"><span class="returnvalue">GstFFTF32</span></a> *         gst_fft_f32_new                     (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> len</code></em>,
135                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> inverse</code></em>);</pre>
136 <p>
137 This returns a new <a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32"><span class="type">GstFFTF32</span></a> instance with the given parameters. It makes
138 sense to keep one instance for several calls for speed reasons.
139 </p>
140 <p>
141 <em class="parameter"><code>len</code></em> must be even and to get the best performance a product of
142 2, 3 and 5. To get the next number with this characteristics use
143 <a class="link" href="gst-plugins-base-libs-gstfft.html#gst-fft-next-fast-length" title="gst_fft_next_fast_length ()"><code class="function">gst_fft_next_fast_length()</code></a>.
144 </p>
145 <div class="variablelist"><table border="0">
146 <col align="left" valign="top">
147 <tbody>
148 <tr>
149 <td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
150 <td>Length of the FFT in the time domain</td>
151 </tr>
152 <tr>
153 <td><p><span class="term"><em class="parameter"><code>inverse</code></em> :</span></p></td>
154 <td>
155 <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the <a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32"><span class="type">GstFFTF32</span></a> instance should be used for the inverse FFT</td>
156 </tr>
157 <tr>
158 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
159 <td>a new <a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32"><span class="type">GstFFTF32</span></a> instance.</td>
160 </tr>
161 </tbody>
162 </table></div>
163 </div>
164 <hr>
165 <div class="refsect2">
166 <a name="gst-fft-f32-fft"></a><h3>gst_fft_f32_fft ()</h3>
167 <pre class="programlisting"><span class="returnvalue">void</span>                gst_fft_f32_fft                     (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32"><span class="type">GstFFTF32</span></a> *self</code></em>,
168                                                          <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gfloat"><span class="type">gfloat</span></a> *timedata</code></em>,
169                                                          <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32Complex" title="struct GstFFTF32Complex"><span class="type">GstFFTF32Complex</span></a> *freqdata</code></em>);</pre>
170 <p>
171 This performs the FFT on <em class="parameter"><code>timedata</code></em> and puts the result in <em class="parameter"><code>freqdata</code></em>.
172 </p>
173 <p>
174 <em class="parameter"><code>timedata</code></em> must have as many samples as specified with the <em class="parameter"><code>len</code></em> parameter while
175 allocating the <a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32"><span class="type">GstFFTF32</span></a> instance with <a class="link" href="gst-plugins-base-libs-gstfftf32.html#gst-fft-f32-new" title="gst_fft_f32_new ()"><code class="function">gst_fft_f32_new()</code></a>.
176 </p>
177 <p>
178 <em class="parameter"><code>freqdata</code></em> must be large enough to hold <em class="parameter"><code>len</code></em>/2 + 1 <a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32Complex" title="struct GstFFTF32Complex"><span class="type">GstFFTF32Complex</span></a> frequency
179 domain samples.
180 </p>
181 <div class="variablelist"><table border="0">
182 <col align="left" valign="top">
183 <tbody>
184 <tr>
185 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
186 <td>
187 <a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32"><span class="type">GstFFTF32</span></a> instance for this call</td>
188 </tr>
189 <tr>
190 <td><p><span class="term"><em class="parameter"><code>timedata</code></em> :</span></p></td>
191 <td>Buffer of the samples in the time domain</td>
192 </tr>
193 <tr>
194 <td><p><span class="term"><em class="parameter"><code>freqdata</code></em> :</span></p></td>
195 <td>Target buffer for the samples in the frequency domain</td>
196 </tr>
197 </tbody>
198 </table></div>
199 </div>
200 <hr>
201 <div class="refsect2">
202 <a name="gst-fft-f32-inverse-fft"></a><h3>gst_fft_f32_inverse_fft ()</h3>
203 <pre class="programlisting"><span class="returnvalue">void</span>                gst_fft_f32_inverse_fft             (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32"><span class="type">GstFFTF32</span></a> *self</code></em>,
204                                                          <em class="parameter"><code>const <a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32Complex" title="struct GstFFTF32Complex"><span class="type">GstFFTF32Complex</span></a> *freqdata</code></em>,
205                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gfloat"><span class="type">gfloat</span></a> *timedata</code></em>);</pre>
206 <p>
207 This performs the inverse FFT on <em class="parameter"><code>freqdata</code></em> and puts the result in <em class="parameter"><code>timedata</code></em>.
208 </p>
209 <p>
210 <em class="parameter"><code>freqdata</code></em> must have <em class="parameter"><code>len</code></em>/2 + 1 samples, where <em class="parameter"><code>len</code></em> is the parameter specified
211 while allocating the <a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32"><span class="type">GstFFTF32</span></a> instance with <a class="link" href="gst-plugins-base-libs-gstfftf32.html#gst-fft-f32-new" title="gst_fft_f32_new ()"><code class="function">gst_fft_f32_new()</code></a>.
212 </p>
213 <p>
214 <em class="parameter"><code>timedata</code></em> must be large enough to hold <em class="parameter"><code>len</code></em> time domain samples.
215 </p>
216 <div class="variablelist"><table border="0">
217 <col align="left" valign="top">
218 <tbody>
219 <tr>
220 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
221 <td>
222 <a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32"><span class="type">GstFFTF32</span></a> instance for this call</td>
223 </tr>
224 <tr>
225 <td><p><span class="term"><em class="parameter"><code>freqdata</code></em> :</span></p></td>
226 <td>Buffer of the samples in the frequency domain</td>
227 </tr>
228 <tr>
229 <td><p><span class="term"><em class="parameter"><code>timedata</code></em> :</span></p></td>
230 <td>Target buffer for the samples in the time domain</td>
231 </tr>
232 </tbody>
233 </table></div>
234 </div>
235 <hr>
236 <div class="refsect2">
237 <a name="gst-fft-f32-window"></a><h3>gst_fft_f32_window ()</h3>
238 <pre class="programlisting"><span class="returnvalue">void</span>                gst_fft_f32_window                  (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32"><span class="type">GstFFTF32</span></a> *self</code></em>,
239                                                          <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gfloat"><span class="type">gfloat</span></a> *timedata</code></em>,
240                                                          <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstfft.html#GstFFTWindow" title="enum GstFFTWindow"><span class="type">GstFFTWindow</span></a> window</code></em>);</pre>
241 <p>
242 This calls the window function <em class="parameter"><code>window</code></em> on the <em class="parameter"><code>timedata</code></em> sample buffer.
243 </p>
244 <div class="variablelist"><table border="0">
245 <col align="left" valign="top">
246 <tbody>
247 <tr>
248 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
249 <td>
250 <a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32"><span class="type">GstFFTF32</span></a> instance for this call</td>
251 </tr>
252 <tr>
253 <td><p><span class="term"><em class="parameter"><code>timedata</code></em> :</span></p></td>
254 <td>Time domain samples</td>
255 </tr>
256 <tr>
257 <td><p><span class="term"><em class="parameter"><code>window</code></em> :</span></p></td>
258 <td>Window function to apply</td>
259 </tr>
260 </tbody>
261 </table></div>
262 </div>
263 <hr>
264 <div class="refsect2">
265 <a name="gst-fft-f32-free"></a><h3>gst_fft_f32_free ()</h3>
266 <pre class="programlisting"><span class="returnvalue">void</span>                gst_fft_f32_free                    (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32"><span class="type">GstFFTF32</span></a> *self</code></em>);</pre>
267 <p>
268 This frees the memory allocated for <em class="parameter"><code>self</code></em>.
269 </p>
270 <div class="variablelist"><table border="0">
271 <col align="left" valign="top">
272 <tbody><tr>
273 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
274 <td>
275 <a class="link" href="gst-plugins-base-libs-gstfftf32.html#GstFFTF32" title="struct GstFFTF32"><span class="type">GstFFTF32</span></a> instance for this call</td>
276 </tr></tbody>
277 </table></div>
278 </div>
279 </div>
280 </div>
281 <div class="footer">
282 <hr>
283           Generated by GTK-Doc V1.18</div>
284 </body>
285 </html>