You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CMSIS-DSP/main/group__ComplexFFT.html

244 lines
17 KiB
HTML

<!-- HTML header for doxygen 1.9.2-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CMSIS-DSP: Complex FFT Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="footer.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function() { init_search(); });
/* @license-end */
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"></script>
<link href="$extra_stylesheet" rel="stylesheet" type="text/css" />
<link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
<link href="version.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../version.js"></script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 55px;">
<td id="projectlogo" style="padding: 1.5em;"><img alt="Logo" src="cmsis_logo_white_small.png"/></td>
<td style="padding-left: 1em; padding-bottom: 1em;padding-top: 1em;">
<div id="projectname">CMSIS-DSP
&#160;<span id="projectnumber"><script type="text/javascript">
<!--
writeHeader.call(this);
writeVersionDropdown(this);
//-->
</script>
</span>
</div>
<div id="projectbrief">CMSIS DSP Software Library</div>
</td>
<!--END !PROJECT_NAME-->
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li>
<li class="current"><a href="modules.html"><span>&#160;API&#160;Reference</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.svg"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__ComplexFFT.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#groups">Content</a> </div>
<div class="headertitle"><div class="title">Complex FFT Functions<div class="ingroups"><a class="el" href="group__groupTransforms.html">Transform Functions</a></div></div></div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="groups" name="groups"></a>
Content</h2></td></tr>
<tr class="memitem:group__CFFT__CIFFT"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CFFT__CIFFT.html">Complex FFT Tables</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__ComplexFFTF16"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ComplexFFTF16.html">Complex FFT F16</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__ComplexFFTF32"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ComplexFFTF32.html">Complex FFT F32</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__ComplexFFTF64"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ComplexFFTF64.html">Complex FFT F64</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__ComplexFFTQ15"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ComplexFFTQ15.html">Complex FFT Q15</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__ComplexFFTQ31"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ComplexFFTQ31.html">Complex FFT Q31</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__ComplexFFTDeprecated"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ComplexFFTDeprecated.html">Deprecated Complex FFT functions</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
<dl class="section user"><dt></dt><dd>The Fast Fourier Transform (FFT) is an efficient algorithm for computing the Discrete Fourier Transform (DFT). The FFT can be orders of magnitude faster than the DFT, especially for long lengths. The algorithms described in this section operate on complex data. A separate set of functions is devoted to handling of real sequences. </dd></dl>
<dl class="section user"><dt></dt><dd>There are separate algorithms for handling floating-point, Q15, and Q31 data types. The algorithms available for each data type are described next. </dd></dl>
<dl class="section user"><dt></dt><dd>The FFT functions operate in-place. That is, the array holding the input data will also be used to hold the corresponding result. The input data is complex and contains <code>2*fftLen</code> interleaved values as shown below. <pre>{real[0], imag[0], real[1], imag[1], ...} </pre> The FFT result will be contained in the same array and the frequency domain values will have the same interleaving.</dd></dl>
<dl class="section user"><dt>Floating-point</dt><dd>The floating-point complex FFT uses a mixed-radix algorithm. Multiple radix-8 stages are performed along with a single radix-2 or radix-4 stage, as needed. The algorithm supports lengths of [16, 32, 64, ..., 4096] and each length uses a different twiddle factor table. </dd></dl>
<dl class="section user"><dt></dt><dd>The function uses the standard FFT definition and output values may grow by a factor of <code>fftLen</code> when computing the forward transform. The inverse transform includes a scale of <code>1/fftLen</code> as part of the calculation and this matches the textbook definition of the inverse FFT. </dd></dl>
<dl class="section user"><dt></dt><dd>For the MVE version, the new arm_cfft_init_f32 initialization function is <b>mandatory</b>. <b>Compilation flags are available to include only the required tables for the needed FFTs.</b> Other FFT versions can continue to be initialized as explained below. </dd></dl>
<dl class="section user"><dt></dt><dd>For not MVE versions, pre-initialized data structures containing twiddle factors and bit reversal tables are provided and defined in <code><a class="el" href="arm__const__structs_8h.html">arm_const_structs.h</a></code>. Include this header in your function and then pass one of the constant structures as an argument to arm_cfft_f32. For example: </dd></dl>
<dl class="section user"><dt></dt><dd><code>arm_cfft_f32(arm_cfft_sR_f32_len64, pSrc, 1, 1)</code> </dd></dl>
<dl class="section user"><dt></dt><dd>computes a 64-point inverse complex FFT including bit reversal. The data structures are treated as constant data and not modified during the calculation. The same data structure can be reused for multiple transforms including mixing forward and inverse transforms. </dd></dl>
<dl class="section user"><dt></dt><dd>Earlier releases of the library provided separate radix-2 and radix-4 algorithms that operated on floating-point data. These functions are still provided but are deprecated. The older functions are slower and less general than the new functions. </dd></dl>
<dl class="section user"><dt></dt><dd>An example of initialization of the constants for the arm_cfft_f32 function follows: <div class="fragment"><div class="line"><span class="keyword">const</span> <span class="keyword">static</span> <a class="code hl_struct" href="structarm__cfft__instance__f32.html" title="Instance structure for the floating-point CFFT/CIFFT function.">arm_cfft_instance_f32</a> *S;</div>
<div class="line">...</div>
<div class="line">switch (length) {</div>
<div class="line"> <span class="keywordflow">case</span> 16:</div>
<div class="line"> S = &amp;arm_cfft_sR_f32_len16;</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">case</span> 32:</div>
<div class="line"> S = &amp;arm_cfft_sR_f32_len32;</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">case</span> 64:</div>
<div class="line"> S = &amp;arm_cfft_sR_f32_len64;</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">case</span> 128:</div>
<div class="line"> S = &amp;arm_cfft_sR_f32_len128;</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">case</span> 256:</div>
<div class="line"> S = &amp;arm_cfft_sR_f32_len256;</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">case</span> 512:</div>
<div class="line"> S = &amp;arm_cfft_sR_f32_len512;</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">case</span> 1024:</div>
<div class="line"> S = &amp;arm_cfft_sR_f32_len1024;</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">case</span> 2048:</div>
<div class="line"> S = &amp;arm_cfft_sR_f32_len2048;</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">case</span> 4096:</div>
<div class="line"> S = &amp;arm_cfft_sR_f32_len4096;</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line">}</div>
</div><!-- fragment --></dd></dl>
<dl class="section user"><dt></dt><dd>The new arm_cfft_init_f32 can also be used. </dd></dl>
<dl class="section user"><dt>Q15 and Q31</dt><dd>The floating-point complex FFT uses a mixed-radix algorithm. Multiple radix-4 stages are performed along with a single radix-2 stage, as needed. The algorithm supports lengths of [16, 32, 64, ..., 4096] and each length uses a different twiddle factor table. </dd></dl>
<dl class="section user"><dt></dt><dd>The function uses the standard FFT definition and output values may grow by a factor of <code>fftLen</code> when computing the forward transform. The inverse transform includes a scale of <code>1/fftLen</code> as part of the calculation and this matches the textbook definition of the inverse FFT. </dd></dl>
<dl class="section user"><dt></dt><dd>Pre-initialized data structures containing twiddle factors and bit reversal tables are provided and defined in <code><a class="el" href="arm__const__structs_8h.html">arm_const_structs.h</a></code>. Include this header in your function and then pass one of the constant structures as an argument to arm_cfft_q31. For example: </dd></dl>
<dl class="section user"><dt></dt><dd><code>arm_cfft_q31(arm_cfft_sR_q31_len64, pSrc, 1, 1)</code> </dd></dl>
<dl class="section user"><dt></dt><dd>computes a 64-point inverse complex FFT including bit reversal. The data structures are treated as constant data and not modified during the calculation. The same data structure can be reused for multiple transforms including mixing forward and inverse transforms. </dd></dl>
<dl class="section user"><dt></dt><dd>Earlier releases of the library provided separate radix-2 and radix-4 algorithms that operated on floating-point data. These functions are still provided but are deprecated. The older functions are slower and less general than the new functions. </dd></dl>
<dl class="section user"><dt></dt><dd>An example of initialization of the constants for the arm_cfft_q31 function follows: <div class="fragment"><div class="line"><span class="keyword">const</span> <span class="keyword">static</span> <a class="code hl_struct" href="structarm__cfft__instance__q31.html" title="Instance structure for the fixed-point CFFT/CIFFT function.">arm_cfft_instance_q31</a> *S;</div>
<div class="line">...</div>
<div class="line"> <span class="keywordflow">switch</span> (length) {</div>
<div class="line"> <span class="keywordflow">case</span> 16:</div>
<div class="line"> S = &amp;arm_cfft_sR_q31_len16;</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">case</span> 32:</div>
<div class="line"> S = &amp;arm_cfft_sR_q31_len32;</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">case</span> 64:</div>
<div class="line"> S = &amp;arm_cfft_sR_q31_len64;</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">case</span> 128:</div>
<div class="line"> S = &amp;arm_cfft_sR_q31_len128;</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">case</span> 256:</div>
<div class="line"> S = &amp;arm_cfft_sR_q31_len256;</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">case</span> 512:</div>
<div class="line"> S = &amp;arm_cfft_sR_q31_len512;</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">case</span> 1024:</div>
<div class="line"> S = &amp;arm_cfft_sR_q31_len1024;</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">case</span> 2048:</div>
<div class="line"> S = &amp;arm_cfft_sR_q31_len2048;</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> <span class="keywordflow">case</span> 4096:</div>
<div class="line"> S = &amp;arm_cfft_sR_q31_len4096;</div>
<div class="line"> <span class="keywordflow">break</span>;</div>
<div class="line"> }</div>
</div><!-- fragment --> </dd></dl>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">
<script type="text/javascript">
<!--
writeFooter.call(this);
//-->
</script>
</li>
</ul>
</div>
</body>
</html>