cancel
Showing results for 
Search instead for 
Did you mean: 

Outliers after moving average processing

CKolh.1
Associate

Hello community,

in my current project I use a NUCLEO-H743ZI2 to acquireaccelerations and angular velocities from a LSM9DS1 (high and low byte - let's call it raw data). The serial transmission to my computer works well.

Due to errors in acquired values I use a moving average for noise damping. After computation the computed moving average values (I call them processed data) are split into high and low byte again for transmision to my computer. Looking at the processed values I can recognize that the mean value is nearly equal to the one of the raw data.

In the processed data I occure outliers that cannot be found in the raw data. I have no solution for this problem and I wonder if it has been seen before. Even the use of a quadratic average produces these outliers.

Has anyone seen this effct before and maybe solved it? I would be very appreciated for all kinds of help!!!

3 REPLIES 3
Eleon BORLINI
ST Employee

Hi @CKolh.1​ ,

this might be an issue related to some inaccuracy on the acquired data. To check this, and to improve data accuracy, you could try using for example the MotionAC accelerometer calibration library of the X-CUBE-MEMS1 package.

It should be portable also on H7 microcontrollers since it has been tested also on STM32 microcontrollers based on the ARM Cortex-M7 architecture.

-Eleon

CKolh.1
Associate

Hi Eleon,

I tried to apply some filters etc. to the data on the controller and the outliers still occur. Using the same code on my notebook works fine and shows no outliers. Can this be a problem of floating comma operations? Can I avoid this in any way? I read about FPUs which are part of my controller but I have no idea how to use it.

Ozone
Lead II

> In the processed data I occure outliers that cannot be found in the raw data. I have no solution for this problem and I wonder if it has been seen before. Even the use of a quadratic average produces these outliers.

This sounds like an overflow or a bug in some of your processing operations.

Integer-based operations tend to react quite drastic on overflows.

> Using the same code on my notebook works fine and shows no outliers.

Data types are not necessarily the same on different platforms.

I would suggest to subject your processing code to more rigorous tests, trying to provoke the issue.