<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: DSP library error: standard deviation always 0 in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/DSP-library-error-standard-deviation-always-0/m-p/542655#M7922</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by starblue on Fri Jan 16 02:28:17 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Your numbers are too small.&amp;nbsp; According to the documentation the lower 8 bits are discarded:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.keil.com%2Fpack%2Fdoc%2FCMSIS%2FDSP%2Fhtml%2Fgroup___s_t_d.html%23ga39495e74f96116178be085c9dc7742f5" rel="nofollow" target="_blank"&gt;https://www.keil.com/pack/doc/CMSIS/DSP/html/group___s_t_d.html#ga39495e74f96116178be085c9dc7742f5&lt;/A&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 21:56:21 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T21:56:21Z</dc:date>
    <item>
      <title>DSP library error: standard deviation always 0</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/DSP-library-error-standard-deviation-always-0/m-p/542653#M7920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by djukazg on Thu Jan 15 12:52:23 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a problem with arm_std_q31 function from DSP cortex M0 library. The function always returns 0 although the numbers in the array sent to the function are totaly different. For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;w[0]int32_t488&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;w[1]int32_t327&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;w[2]int32_t172&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;w[3]int32_t68&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;w[4]int32_t44&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;w[5]int32_t39&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;w[6]int32_t34&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;w[7]int32_t249&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;w[8]int32_t132&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;w[9]int32_t7&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The function &lt;/SPAN&gt;&lt;I&gt;arm_mean_q31 &lt;/I&gt;&lt;SPAN&gt;works OK (returns 156 in the upper case).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Version of LPCXpresso is 7.3.0, on Linux Fedora&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCU is LPC1114&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
static int tmr_hx711_ready = 0;
int32_t w[10];
int32_t mw, stdw;
char str[33];
&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t i = 0;
while(1){
&amp;nbsp;&amp;nbsp; if(tmr_hx711_ready &amp;gt; 0){//read
&amp;nbsp;&amp;nbsp;&amp;nbsp; w[i++] = hx711_get_weight();
&amp;nbsp;&amp;nbsp;&amp;nbsp; tmr_hx711_ready = 0;
if(i == 10){
 arm_mean_q31 (w, 10, &amp;amp;mw);
arm_std_q31(w, 10, &amp;amp;stdw);
i = 0;
sprintf(str,"Result: %d g", mw/10);
}
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can't find any mistake here. Have I missed something or there's error in the library?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Djuka&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:56:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/DSP-library-error-standard-deviation-always-0/m-p/542653#M7920</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: DSP library error: standard deviation always 0</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/DSP-library-error-standard-deviation-always-0/m-p/542654#M7921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by cfb on Fri Jan 16 00:43:47 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;sprintf(str,"Result: %d g", mw/10); ???&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You are not outputting the value of stdw. &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:56:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/DSP-library-error-standard-deviation-always-0/m-p/542654#M7921</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: DSP library error: standard deviation always 0</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/DSP-library-error-standard-deviation-always-0/m-p/542655#M7922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by starblue on Fri Jan 16 02:28:17 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Your numbers are too small.&amp;nbsp; According to the documentation the lower 8 bits are discarded:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.keil.com%2Fpack%2Fdoc%2FCMSIS%2FDSP%2Fhtml%2Fgroup___s_t_d.html%23ga39495e74f96116178be085c9dc7742f5" rel="nofollow" target="_blank"&gt;https://www.keil.com/pack/doc/CMSIS/DSP/html/group___s_t_d.html#ga39495e74f96116178be085c9dc7742f5&lt;/A&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:56:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/DSP-library-error-standard-deviation-always-0/m-p/542655#M7922</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: DSP library error: standard deviation always 0</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/DSP-library-error-standard-deviation-always-0/m-p/542656#M7923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by djukazg on Fri Jan 16 23:16:31 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;You're right Starblue. I've shifted the values and it works now...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you all.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:56:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/DSP-library-error-standard-deviation-always-0/m-p/542656#M7923</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:56:21Z</dc:date>
    </item>
  </channel>
</rss>

