2015-08-19 06:02 AM
Hi,
I have encountered the following problem on the STM32F4 using the CMSIS DSP Library V1.4.2:When calculating the standard deviation using arm_std_f32() of the following values </colgroup>7111.15283
7111.38672
7111.40527
7111.50684
7111.59375
7112.03369
7112.12793
7112.1416
7112.68164
7113.02783
the result is 0. This has been verified using the CM4 implementation with FPU. Also, quite often I get results of exactly 2.0 or 4.0 which is very unlikely as my input values are noisy.Can someone reproduce this behavior? Am I running into the limits of single precision floats?thanks, Martin2015-08-19 07:55 AM
There are significantly more recent versions of the DSP Library, V1.4.4 is included in the most recent F4 DSP Library release. ARM has V1.4.5 for download.
May be you could post a more complete example?2015-08-19 09:04 AM
Nevermind
DSP arm_std_f32 test CMSIS DSP V1.4.4mean = 7111.906250std = 0.000000 (M4F)std = 0.000000 (M0)std = 0.607880 (double)Loss of precision causes var to go negative, can't square root that.2015-08-20 03:54 AM