arm_variance_example_f32_8c-example.html 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <title>CMSIS-DSP: arm_variance_example_f32.c</title>
  7. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  8. <link href="cmsis.css" rel="stylesheet" type="text/css" />
  9. <script type="text/javascript" src="jquery.js"></script>
  10. <script type="text/javascript" src="dynsections.js"></script>
  11. <link href="navtree.css" rel="stylesheet" type="text/css"/>
  12. <script type="text/javascript" src="resize.js"></script>
  13. <script type="text/javascript" src="navtree.js"></script>
  14. <script type="text/javascript">
  15. $(document).ready(initResizable);
  16. </script>
  17. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  18. <script type="text/javascript" src="search/search.js"></script>
  19. <script type="text/javascript">
  20. $(document).ready(function() { searchBox.OnSelectItem(0); });
  21. </script>
  22. <link href="stylsheetf" rel="stylesheet" type="text/css" />
  23. </head>
  24. <body>
  25. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  26. <div id="titlearea">
  27. <table cellspacing="0" cellpadding="0">
  28. <tbody>
  29. <tr style="height: 46px;">
  30. <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td>
  31. <td style="padding-left: 0.5em;">
  32. <div id="projectname">CMSIS-DSP
  33. &#160;<span id="projectnumber">Version 1.4.4</span>
  34. </div>
  35. <div id="projectbrief">CMSIS DSP Software Library</div>
  36. </td>
  37. </tr>
  38. </tbody>
  39. </table>
  40. </div>
  41. <!-- end header part -->
  42. <div id="CMSISnav" class="tabs1">
  43. <ul class="tablist">
  44. <li><a href="../../General/html/index.html"><span>CMSIS</span></a></li>
  45. <li><a href="../../Core/html/index.html"><span>CORE</span></a></li>
  46. <li><a href="../../Driver/html/index.html"><span>Driver</span></a></li>
  47. <li class="current"><a href="../../DSP/html/index.html"><span>DSP</span></a></li>
  48. <li><a href="../../RTOS/html/index.html"><span>RTOS API</span></a></li>
  49. <li><a href="../../Pack/html/index.html"><span>Pack</span></a></li>
  50. <li><a href="../../SVD/html/index.html"><span>SVD</span></a></li>
  51. </ul>
  52. </div>
  53. <!-- Generated by Doxygen 1.8.2 -->
  54. <script type="text/javascript">
  55. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  56. </script>
  57. <div id="navrow1" class="tabs">
  58. <ul class="tablist">
  59. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  60. <li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li>
  61. <li><a href="modules.html"><span>Reference</span></a></li>
  62. <li>
  63. <div id="MSearchBox" class="MSearchBoxInactive">
  64. <span class="left">
  65. <img id="MSearchSelect" src="search/mag_sel.png"
  66. onmouseover="return searchBox.OnSearchSelectShow()"
  67. onmouseout="return searchBox.OnSearchSelectHide()"
  68. alt=""/>
  69. <input type="text" id="MSearchField" value="Search" accesskey="S"
  70. onfocus="searchBox.OnSearchFieldFocus(true)"
  71. onblur="searchBox.OnSearchFieldFocus(false)"
  72. onkeyup="searchBox.OnSearchFieldChange(event)"/>
  73. </span><span class="right">
  74. <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
  75. </span>
  76. </div>
  77. </li>
  78. </ul>
  79. </div>
  80. </div><!-- top -->
  81. <div id="side-nav" class="ui-resizable side-nav-resizable">
  82. <div id="nav-tree">
  83. <div id="nav-tree-contents">
  84. <div id="nav-sync" class="sync"></div>
  85. </div>
  86. </div>
  87. <div id="splitbar" style="-moz-user-select:none;"
  88. class="ui-resizable-handle">
  89. </div>
  90. </div>
  91. <script type="text/javascript">
  92. $(document).ready(function(){initNavTree('arm_variance_example_f32_8c-example.html','');});
  93. </script>
  94. <div id="doc-content">
  95. <!-- window showing the filter options -->
  96. <div id="MSearchSelectWindow"
  97. onmouseover="return searchBox.OnSearchSelectShow()"
  98. onmouseout="return searchBox.OnSearchSelectHide()"
  99. onkeydown="return searchBox.OnSearchSelectKey(event)">
  100. <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div>
  101. <!-- iframe showing the search results (closed by default) -->
  102. <div id="MSearchResultsWindow">
  103. <iframe src="javascript:void(0)" frameborder="0"
  104. name="MSearchResults" id="MSearchResults">
  105. </iframe>
  106. </div>
  107. <div class="header">
  108. <div class="headertitle">
  109. <div class="title">arm_variance_example_f32.c</div> </div>
  110. </div><!--header-->
  111. <div class="contents">
  112. <div class="fragment"><div class="line"><span class="comment">/* ----------------------------------------------------------------------</span></div>
  113. <div class="line"><span class="comment">* Copyright (C) 2010-2012 ARM Limited. All rights reserved.</span></div>
  114. <div class="line"><span class="comment">*</span></div>
  115. <div class="line"><span class="comment">* $Date: 17. January 2013</span></div>
  116. <div class="line"><span class="comment">* $Revision: V1.4.0</span></div>
  117. <div class="line"><span class="comment">*</span></div>
  118. <div class="line"><span class="comment">* Project: CMSIS DSP Library</span></div>
  119. <div class="line"><span class="comment">* Title: arm_variance_example_f32.c</span></div>
  120. <div class="line"><span class="comment">*</span></div>
  121. <div class="line"><span class="comment">* Description: Example code demonstrating variance calculation of input sequence.</span></div>
  122. <div class="line"><span class="comment">*</span></div>
  123. <div class="line"><span class="comment">* Target Processor: Cortex-M4/Cortex-M3</span></div>
  124. <div class="line"><span class="comment">*</span></div>
  125. <div class="line"><span class="comment">* Redistribution and use in source and binary forms, with or without</span></div>
  126. <div class="line"><span class="comment">* modification, are permitted provided that the following conditions</span></div>
  127. <div class="line"><span class="comment">* are met:</span></div>
  128. <div class="line"><span class="comment">* - Redistributions of source code must retain the above copyright</span></div>
  129. <div class="line"><span class="comment">* notice, this list of conditions and the following disclaimer.</span></div>
  130. <div class="line"><span class="comment">* - Redistributions in binary form must reproduce the above copyright</span></div>
  131. <div class="line"><span class="comment">* notice, this list of conditions and the following disclaimer in</span></div>
  132. <div class="line"><span class="comment">* the documentation and/or other materials provided with the</span></div>
  133. <div class="line"><span class="comment">* distribution.</span></div>
  134. <div class="line"><span class="comment">* - Neither the name of ARM LIMITED nor the names of its contributors</span></div>
  135. <div class="line"><span class="comment">* may be used to endorse or promote products derived from this</span></div>
  136. <div class="line"><span class="comment">* software without specific prior written permission.</span></div>
  137. <div class="line"><span class="comment">*</span></div>
  138. <div class="line"><span class="comment">* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS</span></div>
  139. <div class="line"><span class="comment">* &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT</span></div>
  140. <div class="line"><span class="comment">* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS</span></div>
  141. <div class="line"><span class="comment">* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE</span></div>
  142. <div class="line"><span class="comment">* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,</span></div>
  143. <div class="line"><span class="comment">* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,</span></div>
  144. <div class="line"><span class="comment">* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;</span></div>
  145. <div class="line"><span class="comment">* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span></div>
  146. <div class="line"><span class="comment">* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT</span></div>
  147. <div class="line"><span class="comment">* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN</span></div>
  148. <div class="line"><span class="comment">* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span></div>
  149. <div class="line"><span class="comment">* POSSIBILITY OF SUCH DAMAGE.</span></div>
  150. <div class="line"><span class="comment">* -------------------------------------------------------------------- */</span></div>
  151. <div class="line"></div>
  152. <div class="line"><span class="preprocessor">#include &lt;math.h&gt;</span></div>
  153. <div class="line"><span class="preprocessor">#include &quot;<a class="code" href="arm__math_8h.html">arm_math.h</a>&quot;</span></div>
  154. <div class="line"></div>
  155. <div class="line"><span class="comment">/* ----------------------------------------------------------------------</span></div>
  156. <div class="line"><span class="comment">* Defines each of the tests performed</span></div>
  157. <div class="line"><span class="comment">* ------------------------------------------------------------------- */</span></div>
  158. <div class="line"><span class="preprocessor">#define MAX_BLOCKSIZE 32</span></div>
  159. <div class="line"><span class="preprocessor"></span><span class="preprocessor">#define DELTA (0.000001f)</span></div>
  160. <div class="line"><span class="preprocessor"></span></div>
  161. <div class="line"></div>
  162. <div class="line"><span class="comment">/* ----------------------------------------------------------------------</span></div>
  163. <div class="line"><span class="comment">* Declare I/O buffers</span></div>
  164. <div class="line"><span class="comment">* ------------------------------------------------------------------- */</span></div>
  165. <div class="line"><a class="code" href="arm__math_8h.html#a4611b605e45ab401f02cab15c5e38715" title="32-bit floating-point type definition.">float32_t</a> <a name="a0"></a><a class="code" href="arm__signal__converge__example__f32_8c.html#a16e759789fbc05f878863f009066c8ea">wire1</a>[<a name="a1"></a><a class="code" href="_a_r_m_2arm__convolution__example__f32_8c.html#af8a1d2ed31f7c9a00fec46a798edb61b">MAX_BLOCKSIZE</a>];</div>
  166. <div class="line"><a class="code" href="arm__math_8h.html#a4611b605e45ab401f02cab15c5e38715" title="32-bit floating-point type definition.">float32_t</a> <a name="a2"></a><a class="code" href="arm__signal__converge__example__f32_8c.html#a4e370163c81ae2b72cc655a6b79e4c6a">wire2</a>[<a class="code" href="_a_r_m_2arm__convolution__example__f32_8c.html#af8a1d2ed31f7c9a00fec46a798edb61b">MAX_BLOCKSIZE</a>];</div>
  167. <div class="line"><a class="code" href="arm__math_8h.html#a4611b605e45ab401f02cab15c5e38715" title="32-bit floating-point type definition.">float32_t</a> <a name="a3"></a><a class="code" href="arm__signal__converge__example__f32_8c.html#a7e2cceadf6ec7f0aa0f698a680fa3a4b">wire3</a>[<a class="code" href="_a_r_m_2arm__convolution__example__f32_8c.html#af8a1d2ed31f7c9a00fec46a798edb61b">MAX_BLOCKSIZE</a>];</div>
  168. <div class="line"></div>
  169. <div class="line"><span class="comment">/* ----------------------------------------------------------------------</span></div>
  170. <div class="line"><span class="comment">* Test input data for Floating point Variance example for 32-blockSize</span></div>
  171. <div class="line"><span class="comment">* Generated by the MATLAB randn() function</span></div>
  172. <div class="line"><span class="comment">* ------------------------------------------------------------------- */</span></div>
  173. <div class="line"></div>
  174. <div class="line"><a class="code" href="arm__math_8h.html#a4611b605e45ab401f02cab15c5e38715" title="32-bit floating-point type definition.">float32_t</a> <a name="a4"></a><a class="code" href="arm__graphic__equalizer__data_8c.html#a987ef9f3767fa5e083bcf2dd1efed05c">testInput_f32</a>[32] =</div>
  175. <div class="line">{</div>
  176. <div class="line"> -0.432564811528221, -1.665584378238097, 0.125332306474831, 0.287676420358549,</div>
  177. <div class="line"> -1.146471350681464, 1.190915465642999, 1.189164201652103, -0.037633276593318,</div>
  178. <div class="line"> 0.327292361408654, 0.174639142820925, -0.186708577681439, 0.725790548293303,</div>
  179. <div class="line"> -0.588316543014189, 2.183185818197101, -0.136395883086596, 0.113931313520810,</div>
  180. <div class="line"> 1.066768211359189, 0.059281460523605, -0.095648405483669, -0.832349463650022,</div>
  181. <div class="line"> 0.294410816392640, -1.336181857937804, 0.714324551818952, 1.623562064446271,</div>
  182. <div class="line"> -0.691775701702287, 0.857996672828263, 1.254001421602532, -1.593729576447477,</div>
  183. <div class="line"> -1.440964431901020, 0.571147623658178, -0.399885577715363, 0.689997375464345</div>
  184. <div class="line"></div>
  185. <div class="line">};</div>
  186. <div class="line"></div>
  187. <div class="line"><span class="comment">/* ----------------------------------------------------------------------</span></div>
  188. <div class="line"><span class="comment">* Declare Global variables</span></div>
  189. <div class="line"><span class="comment">* ------------------------------------------------------------------- */</span></div>
  190. <div class="line">uint32_t <a name="a5"></a><a class="code" href="arm__fir__example__f32_8c.html#ab6558f40a619c2502fbc24c880fd4fb0">blockSize</a> = 32;</div>
  191. <div class="line"><a class="code" href="arm__math_8h.html#a4611b605e45ab401f02cab15c5e38715" title="32-bit floating-point type definition.">float32_t</a> <a name="a6"></a><a class="code" href="arm__variance__example__f32_8c.html#a26cbbfe2a7905669e8440159465050df">refVarianceOut</a> = 0.903941793931839;</div>
  192. <div class="line"></div>
  193. <div class="line"><span class="comment">/* ----------------------------------------------------------------------</span></div>
  194. <div class="line"><span class="comment">* Variance calculation test</span></div>
  195. <div class="line"><span class="comment">* ------------------------------------------------------------------- */</span></div>
  196. <div class="line"></div>
  197. <div class="line">int32_t <a name="a7"></a><a class="code" href="_a_r_m_2arm__class__marks__example__f32_8c.html#a196718f834091385d38586a0ce4009dc">main</a>(<span class="keywordtype">void</span>)</div>
  198. <div class="line">{</div>
  199. <div class="line"> <a class="code" href="arm__math_8h.html#a5e459c6409dfcd2927bb8a57491d7cf6" title="Error status returned by some functions in the library.">arm_status</a> <a name="a8"></a><a class="code" href="_a_r_m_2arm__dotproduct__example__f32_8c.html#a88ccb294236ab22b00310c47164c53c3">status</a>;</div>
  200. <div class="line"> <a class="code" href="arm__math_8h.html#a4611b605e45ab401f02cab15c5e38715" title="32-bit floating-point type definition.">float32_t</a> <a name="a9"></a><a class="code" href="_a_r_m_2arm__class__marks__example__f32_8c.html#acc9290716b3c97381ce52d14b4b01681">mean</a>, oneByBlockSize;</div>
  201. <div class="line"> <a class="code" href="arm__math_8h.html#a4611b605e45ab401f02cab15c5e38715" title="32-bit floating-point type definition.">float32_t</a> variance;</div>
  202. <div class="line"> <a class="code" href="arm__math_8h.html#a4611b605e45ab401f02cab15c5e38715" title="32-bit floating-point type definition.">float32_t</a> diff;</div>
  203. <div class="line"></div>
  204. <div class="line"> status = <a name="a10"></a><a class="code" href="arm__math_8h.html#a5e459c6409dfcd2927bb8a57491d7cf6a9f8b2a10bd827fb4600e77d455902eb0">ARM_MATH_SUCCESS</a>;</div>
  205. <div class="line"></div>
  206. <div class="line"> <span class="comment">/* Calculation of mean value of input */</span></div>
  207. <div class="line"></div>
  208. <div class="line"> <span class="comment">/* x&#39; = 1/blockSize * (x(0)* 1 + x(1) * 1 + ... + x(n-1) * 1) */</span></div>
  209. <div class="line"></div>
  210. <div class="line"> <span class="comment">/* Fill wire1 buffer with 1.0 value */</span></div>
  211. <div class="line"> <a name="a11"></a><a class="code" href="group___fill.html#ga2248e8d3901b4afb7827163132baad94" title="Fills a constant value into a floating-point vector.">arm_fill_f32</a>(1.0, <a class="code" href="arm__signal__converge__example__f32_8c.html#a16e759789fbc05f878863f009066c8ea">wire1</a>, <a class="code" href="arm__fir__example__f32_8c.html#ab6558f40a619c2502fbc24c880fd4fb0">blockSize</a>);</div>
  212. <div class="line"></div>
  213. <div class="line"> <span class="comment">/* Calculate the dot product of wire1 and wire2 */</span></div>
  214. <div class="line"> <span class="comment">/* (x(0)* 1 + x(1) * 1 + ...+ x(n-1) * 1) */</span></div>
  215. <div class="line"> <a name="a12"></a><a class="code" href="group__dot__prod.html#ga55418d4362f6ba84c327f9b4f089a8c3" title="Dot product of floating-point vectors.">arm_dot_prod_f32</a>(<a class="code" href="arm__graphic__equalizer__data_8c.html#a987ef9f3767fa5e083bcf2dd1efed05c">testInput_f32</a>, <a class="code" href="arm__signal__converge__example__f32_8c.html#a16e759789fbc05f878863f009066c8ea">wire1</a>, <a class="code" href="arm__fir__example__f32_8c.html#ab6558f40a619c2502fbc24c880fd4fb0">blockSize</a>, &amp;mean);</div>
  216. <div class="line"></div>
  217. <div class="line"> <span class="comment">/* Calculation of 1/blockSize */</span></div>
  218. <div class="line"> oneByBlockSize = 1.0 / (<a class="code" href="arm__fir__example__f32_8c.html#ab6558f40a619c2502fbc24c880fd4fb0">blockSize</a>);</div>
  219. <div class="line"></div>
  220. <div class="line"> <span class="comment">/* 1/blockSize * (x(0)* 1 + x(1) * 1 + ... + x(n-1) * 1) */</span></div>
  221. <div class="line"> <a name="a13"></a><a class="code" href="group___basic_mult.html#gaca3f0b8227da431ab29225b88888aa32" title="Floating-point vector multiplication.">arm_mult_f32</a>(&amp;mean, &amp;oneByBlockSize, &amp;mean, 1);</div>
  222. <div class="line"></div>
  223. <div class="line"></div>
  224. <div class="line"> <span class="comment">/* Calculation of variance value of input */</span></div>
  225. <div class="line"></div>
  226. <div class="line"> <span class="comment">/* (1/blockSize) * (x(0) - x&#39;) * (x(0) - x&#39;) + (x(1) - x&#39;) * (x(1) - x&#39;) + ... + (x(n-1) - x&#39;) * (x(n-1) - x&#39;) */</span></div>
  227. <div class="line"></div>
  228. <div class="line"> <span class="comment">/* Fill wire2 with mean value x&#39; */</span></div>
  229. <div class="line"> <a class="code" href="group___fill.html#ga2248e8d3901b4afb7827163132baad94" title="Fills a constant value into a floating-point vector.">arm_fill_f32</a>(mean, <a class="code" href="arm__signal__converge__example__f32_8c.html#a4e370163c81ae2b72cc655a6b79e4c6a">wire2</a>, <a class="code" href="arm__fir__example__f32_8c.html#ab6558f40a619c2502fbc24c880fd4fb0">blockSize</a>);</div>
  230. <div class="line"></div>
  231. <div class="line"> <span class="comment">/* wire3 contains (x-x&#39;) */</span></div>
  232. <div class="line"> <a name="a14"></a><a class="code" href="group___basic_sub.html#ga7f975a472de286331134227c08aad826" title="Floating-point vector subtraction.">arm_sub_f32</a>(<a class="code" href="arm__graphic__equalizer__data_8c.html#a987ef9f3767fa5e083bcf2dd1efed05c">testInput_f32</a>, <a class="code" href="arm__signal__converge__example__f32_8c.html#a4e370163c81ae2b72cc655a6b79e4c6a">wire2</a>, <a class="code" href="arm__signal__converge__example__f32_8c.html#a7e2cceadf6ec7f0aa0f698a680fa3a4b">wire3</a>, <a class="code" href="arm__fir__example__f32_8c.html#ab6558f40a619c2502fbc24c880fd4fb0">blockSize</a>);</div>
  233. <div class="line"></div>
  234. <div class="line"> <span class="comment">/* wire2 contains (x-x&#39;) */</span></div>
  235. <div class="line"> <a name="a15"></a><a class="code" href="group__copy.html#gadd1f737e677e0e6ca31767c7001417b3" title="Copies the elements of a floating-point vector.">arm_copy_f32</a>(<a class="code" href="arm__signal__converge__example__f32_8c.html#a7e2cceadf6ec7f0aa0f698a680fa3a4b">wire3</a>, <a class="code" href="arm__signal__converge__example__f32_8c.html#a4e370163c81ae2b72cc655a6b79e4c6a">wire2</a>, <a class="code" href="arm__fir__example__f32_8c.html#ab6558f40a619c2502fbc24c880fd4fb0">blockSize</a>);</div>
  236. <div class="line"></div>
  237. <div class="line"> <span class="comment">/* (x(0) - x&#39;) * (x(0) - x&#39;) + (x(1) - x&#39;) * (x(1) - x&#39;) + ... + (x(n-1) - x&#39;) * (x(n-1) - x&#39;) */</span></div>
  238. <div class="line"> <a class="code" href="group__dot__prod.html#ga55418d4362f6ba84c327f9b4f089a8c3" title="Dot product of floating-point vectors.">arm_dot_prod_f32</a>(<a class="code" href="arm__signal__converge__example__f32_8c.html#a4e370163c81ae2b72cc655a6b79e4c6a">wire2</a>, <a class="code" href="arm__signal__converge__example__f32_8c.html#a7e2cceadf6ec7f0aa0f698a680fa3a4b">wire3</a>, <a class="code" href="arm__fir__example__f32_8c.html#ab6558f40a619c2502fbc24c880fd4fb0">blockSize</a>, &amp;variance);</div>
  239. <div class="line"></div>
  240. <div class="line"> <span class="comment">/* Calculation of 1/blockSize */</span></div>
  241. <div class="line"> oneByBlockSize = 1.0 / (<a class="code" href="arm__fir__example__f32_8c.html#ab6558f40a619c2502fbc24c880fd4fb0">blockSize</a> - 1);</div>
  242. <div class="line"></div>
  243. <div class="line"> <span class="comment">/* Calculation of variance */</span></div>
  244. <div class="line"> <a class="code" href="group___basic_mult.html#gaca3f0b8227da431ab29225b88888aa32" title="Floating-point vector multiplication.">arm_mult_f32</a>(&amp;variance, &amp;oneByBlockSize, &amp;variance, 1);</div>
  245. <div class="line"></div>
  246. <div class="line"> <span class="comment">/* absolute value of difference between ref and test */</span></div>
  247. <div class="line"> diff = fabsf(<a class="code" href="arm__variance__example__f32_8c.html#a26cbbfe2a7905669e8440159465050df">refVarianceOut</a> - variance);</div>
  248. <div class="line"></div>
  249. <div class="line"> <span class="comment">/* Comparison of variance value with reference */</span></div>
  250. <div class="line"> <span class="keywordflow">if</span>(diff &gt; <a name="a16"></a><a class="code" href="_a_r_m_2arm__convolution__example__f32_8c.html#a3fd2b1bcd7ddcf506237987ad780f495">DELTA</a>)</div>
  251. <div class="line"> {</div>
  252. <div class="line"> status = <a name="a17"></a><a class="code" href="arm__math_8h.html#a5e459c6409dfcd2927bb8a57491d7cf6a09457f2be656b35015fd6d36202fa376">ARM_MATH_TEST_FAILURE</a>;</div>
  253. <div class="line"> }</div>
  254. <div class="line"></div>
  255. <div class="line"> <span class="keywordflow">if</span>( status != <a class="code" href="arm__math_8h.html#a5e459c6409dfcd2927bb8a57491d7cf6a9f8b2a10bd827fb4600e77d455902eb0">ARM_MATH_SUCCESS</a>)</div>
  256. <div class="line"> {</div>
  257. <div class="line"> <span class="keywordflow">while</span>(1);</div>
  258. <div class="line"> }</div>
  259. <div class="line"></div>
  260. <div class="line"> <span class="keywordflow">while</span>(1); <span class="comment">/* main function does not return */</span></div>
  261. <div class="line">}</div>
  262. <div class="line"></div>
  263. </div><!-- fragment --> </div><!-- contents -->
  264. </div><!-- doc-content -->
  265. <!-- start footer part -->
  266. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  267. <ul>
  268. <li class="footer">Generated on Tue Sep 23 2014 18:52:40 for CMSIS-DSP by ARM Ltd. All rights reserved.
  269. <!--
  270. <a href="http://www.doxygen.org/index.html">
  271. <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.2
  272. -->
  273. </li>
  274. </ul>
  275. </div>
  276. </body>
  277. </html>