1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>gstffts16</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
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-gstfft.html" title="gstfft">
10 <link rel="next" href="gst-plugins-base-libs-gstffts32.html" title="gstffts32">
11 <meta name="generator" content="GTK-Doc V1.17 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
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">
17 <td><a accesskey="p" href="gst-plugins-base-libs-gstfft.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-gstffts32.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#gst-plugins-base-libs-gstffts16.synopsis" class="shortcut">Top</a>
26 <a href="#gst-plugins-base-libs-gstffts16.description" class="shortcut">Description</a>
29 <div class="refentry">
30 <a name="gst-plugins-base-libs-gstffts16"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
33 <h2><span class="refentrytitle"><a name="gst-plugins-base-libs-gstffts16.top_of_page"></a>gstffts16</span></h2>
34 <p>gstffts16 — FFT functions for signed 16 bit integer samples</p>
36 <td valign="top" align="right"></td>
38 <div class="refsynopsisdiv">
39 <a name="gst-plugins-base-libs-gstffts16.synopsis"></a><h2>Synopsis</h2>
40 <pre class="synopsis">
41 #include <gst/fft/gstffts16.h>
43 struct <a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16" title="struct GstFFTS16">GstFFTS16</a>;
44 struct <a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16Complex" title="struct GstFFTS16Complex">GstFFTS16Complex</a>;
45 <a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16" title="struct GstFFTS16"><span class="returnvalue">GstFFTS16</span></a> * <a class="link" href="gst-plugins-base-libs-gstffts16.html#gst-fft-s16-new" title="gst_fft_s16_new ()">gst_fft_s16_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-gstffts16.html#gst-fft-s16-fft" title="gst_fft_s16_fft ()">gst_fft_s16_fft</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16" title="struct GstFFTS16"><span class="type">GstFFTS16</span></a> *self</code></em>,
48 <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint16"><span class="type">gint16</span></a> *timedata</code></em>,
49 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16Complex" title="struct GstFFTS16Complex"><span class="type">GstFFTS16Complex</span></a> *freqdata</code></em>);
50 <span class="returnvalue">void</span> <a class="link" href="gst-plugins-base-libs-gstffts16.html#gst-fft-s16-inverse-fft" title="gst_fft_s16_inverse_fft ()">gst_fft_s16_inverse_fft</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16" title="struct GstFFTS16"><span class="type">GstFFTS16</span></a> *self</code></em>,
51 <em class="parameter"><code>const <a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16Complex" title="struct GstFFTS16Complex"><span class="type">GstFFTS16Complex</span></a> *freqdata</code></em>,
52 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint16"><span class="type">gint16</span></a> *timedata</code></em>);
53 <span class="returnvalue">void</span> <a class="link" href="gst-plugins-base-libs-gstffts16.html#gst-fft-s16-window" title="gst_fft_s16_window ()">gst_fft_s16_window</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16" title="struct GstFFTS16"><span class="type">GstFFTS16</span></a> *self</code></em>,
54 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint16"><span class="type">gint16</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-gstffts16.html#gst-fft-s16-free" title="gst_fft_s16_free ()">gst_fft_s16_free</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16" title="struct GstFFTS16"><span class="type">GstFFTS16</span></a> *self</code></em>);
59 <div class="refsect1">
60 <a name="gst-plugins-base-libs-gstffts16.description"></a><h2>Description</h2>
62 <a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16" title="struct GstFFTS16"><span class="type">GstFFTS16</span></a> provides a FFT implementation and related functions for
63 signed 16 bit integer samples. To use this call <a class="link" href="gst-plugins-base-libs-gstffts16.html#gst-fft-s16-new" title="gst_fft_s16_new ()"><code class="function">gst_fft_s16_new()</code></a> for
64 allocating a <a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16" title="struct GstFFTS16"><span class="type">GstFFTS16</span></a> instance with the appropiate parameters and
65 then call <a class="link" href="gst-plugins-base-libs-gstffts16.html#gst-fft-s16-fft" title="gst_fft_s16_fft ()"><code class="function">gst_fft_s16_fft()</code></a> or <a class="link" href="gst-plugins-base-libs-gstffts16.html#gst-fft-s16-inverse-fft" title="gst_fft_s16_inverse_fft ()"><code class="function">gst_fft_s16_inverse_fft()</code></a> to perform the
66 FFT or inverse FFT on a buffer of samples.
69 After use free the <a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16" title="struct GstFFTS16"><span class="type">GstFFTS16</span></a> instance with <a class="link" href="gst-plugins-base-libs-gstffts16.html#gst-fft-s16-free" title="gst_fft_s16_free ()"><code class="function">gst_fft_s16_free()</code></a>.
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-gstffts16.html#gst-fft-s16-new" title="gst_fft_s16_new ()"><code class="function">gst_fft_s16_new()</code></a>.
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>.
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-gstffts16.html#gst-fft-s16-window" title="gst_fft_s16_window ()"><code class="function">gst_fft_s16_window()</code></a> can comfortably
87 Be aware, that you can't simply run <a class="link" href="gst-plugins-base-libs-gstffts16.html#gst-fft-s16-inverse-fft" title="gst_fft_s16_inverse_fft ()"><code class="function">gst_fft_s16_inverse_fft()</code></a> on the
88 resulting frequency data of <a class="link" href="gst-plugins-base-libs-gstffts16.html#gst-fft-s16-fft" title="gst_fft_s16_fft ()"><code class="function">gst_fft_s16_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.
94 <div class="refsect1">
95 <a name="gst-plugins-base-libs-gstffts16.details"></a><h2>Details</h2>
96 <div class="refsect2">
97 <a name="GstFFTS16"></a><h3>struct GstFFTS16</h3>
98 <pre class="programlisting">struct GstFFTS16 {
102 Instance structure for <a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16" title="struct GstFFTS16"><span class="type">GstFFTS16</span></a>.
106 <div class="refsect2">
107 <a name="GstFFTS16Complex"></a><h3>struct GstFFTS16Complex</h3>
108 <pre class="programlisting">struct GstFFTS16Complex {
114 Data type for complex numbers composed of
115 signed 16 bit integers.
117 <div class="variablelist"><table border="0">
118 <col align="left" valign="top">
121 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint16"><span class="type">gint16</span></a> <em class="structfield"><code><a name="GstFFTS16Complex.r"></a>r</code></em>;</span></p></td>
125 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint16"><span class="type">gint16</span></a> <em class="structfield"><code><a name="GstFFTS16Complex.i"></a>i</code></em>;</span></p></td>
126 <td>Imaginary part</td>
132 <div class="refsect2">
133 <a name="gst-fft-s16-new"></a><h3>gst_fft_s16_new ()</h3>
134 <pre class="programlisting"><a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16" title="struct GstFFTS16"><span class="returnvalue">GstFFTS16</span></a> * gst_fft_s16_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>
137 This returns a new <a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16" title="struct GstFFTS16"><span class="type">GstFFTS16</span></a> instance with the given parameters. It makes
138 sense to keep one instance for several calls for speed reasons.
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>.
145 <div class="variablelist"><table border="0">
146 <col align="left" valign="top">
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>
153 <td><p><span class="term"><em class="parameter"><code>inverse</code></em> :</span></p></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-gstffts16.html#GstFFTS16" title="struct GstFFTS16"><span class="type">GstFFTS16</span></a> instance should be used for the inverse FFT</td>
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-gstffts16.html#GstFFTS16" title="struct GstFFTS16"><span class="type">GstFFTS16</span></a> instance.</td>
165 <div class="refsect2">
166 <a name="gst-fft-s16-fft"></a><h3>gst_fft_s16_fft ()</h3>
167 <pre class="programlisting"><span class="returnvalue">void</span> gst_fft_s16_fft (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16" title="struct GstFFTS16"><span class="type">GstFFTS16</span></a> *self</code></em>,
168 <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint16"><span class="type">gint16</span></a> *timedata</code></em>,
169 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16Complex" title="struct GstFFTS16Complex"><span class="type">GstFFTS16Complex</span></a> *freqdata</code></em>);</pre>
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>.
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-gstffts16.html#GstFFTS16" title="struct GstFFTS16"><span class="type">GstFFTS16</span></a> instance with <a class="link" href="gst-plugins-base-libs-gstffts16.html#gst-fft-s16-new" title="gst_fft_s16_new ()"><code class="function">gst_fft_s16_new()</code></a>.
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-gstffts16.html#GstFFTS16Complex" title="struct GstFFTS16Complex"><span class="type">GstFFTS16Complex</span></a> frequency
181 <div class="variablelist"><table border="0">
182 <col align="left" valign="top">
185 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
187 <a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16" title="struct GstFFTS16"><span class="type">GstFFTS16</span></a> instance for this call</td>
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>
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>
201 <div class="refsect2">
202 <a name="gst-fft-s16-inverse-fft"></a><h3>gst_fft_s16_inverse_fft ()</h3>
203 <pre class="programlisting"><span class="returnvalue">void</span> gst_fft_s16_inverse_fft (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16" title="struct GstFFTS16"><span class="type">GstFFTS16</span></a> *self</code></em>,
204 <em class="parameter"><code>const <a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16Complex" title="struct GstFFTS16Complex"><span class="type">GstFFTS16Complex</span></a> *freqdata</code></em>,
205 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint16"><span class="type">gint16</span></a> *timedata</code></em>);</pre>
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>.
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-gstffts16.html#GstFFTS16" title="struct GstFFTS16"><span class="type">GstFFTS16</span></a> instance with <a class="link" href="gst-plugins-base-libs-gstffts16.html#gst-fft-s16-new" title="gst_fft_s16_new ()"><code class="function">gst_fft_s16_new()</code></a>.
214 <em class="parameter"><code>timedata</code></em> must be large enough to hold <em class="parameter"><code>len</code></em> time domain samples.
216 <div class="variablelist"><table border="0">
217 <col align="left" valign="top">
220 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
222 <a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16" title="struct GstFFTS16"><span class="type">GstFFTS16</span></a> instance for this call</td>
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>
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>
236 <div class="refsect2">
237 <a name="gst-fft-s16-window"></a><h3>gst_fft_s16_window ()</h3>
238 <pre class="programlisting"><span class="returnvalue">void</span> gst_fft_s16_window (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16" title="struct GstFFTS16"><span class="type">GstFFTS16</span></a> *self</code></em>,
239 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint16"><span class="type">gint16</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>
242 This calls the window function <em class="parameter"><code>window</code></em> on the <em class="parameter"><code>timedata</code></em> sample buffer.
244 <div class="variablelist"><table border="0">
245 <col align="left" valign="top">
248 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
250 <a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16" title="struct GstFFTS16"><span class="type">GstFFTS16</span></a> instance for this call</td>
253 <td><p><span class="term"><em class="parameter"><code>timedata</code></em> :</span></p></td>
254 <td>Time domain samples</td>
257 <td><p><span class="term"><em class="parameter"><code>window</code></em> :</span></p></td>
258 <td>Window function to apply</td>
264 <div class="refsect2">
265 <a name="gst-fft-s16-free"></a><h3>gst_fft_s16_free ()</h3>
266 <pre class="programlisting"><span class="returnvalue">void</span> gst_fft_s16_free (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16" title="struct GstFFTS16"><span class="type">GstFFTS16</span></a> *self</code></em>);</pre>
268 This frees the memory allocated for <em class="parameter"><code>self</code></em>.
270 <div class="variablelist"><table border="0">
271 <col align="left" valign="top">
273 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
275 <a class="link" href="gst-plugins-base-libs-gstffts16.html#GstFFTS16" title="struct GstFFTS16"><span class="type">GstFFTS16</span></a> instance for this call</td>
283 Generated by GTK-Doc V1.17</div>