Averaging 3-axis data

I'm currently successfully streaming 3-axis accel, gyro, and mag data to my android phone. I wanted to add in a little averaging to the stream to smooth out the data spikes. Unfortunately, when I added the averaging processor into the mix, I stopped receiving streamed data. As a test I switched to streaming a single axis with the averaging filter and that worked as expected. Is it possible to average all 3 axes data in the same stream?

I also noticed that the time stamps on the streamed data messages aren't evenly distributed. I'll frequently get 3 or 4 samples that are very close together followed by a gap, followed by another group of closely spaced messages. Is this normal. I noticed the data saved off from the sample app is exactly spaced based on the sampling frequency. I looked in that code and saw that that logger completely ignores the time stamp and just keeps a running count of the number of messages received. It calculates the time stamp by multiplying the message count by the sampling frequency. Is this safe? Does the sensor always generate exactly 50 samples/sec if the freq is 50Hz? It seems that keeping a running count like this could cause my calculated time to drift from the actual sample time the longer i sample

Comments

  • You cannot use the average processor on multichannel data.

    Higher frequency data streams sends data faster than the BT connection interval.  This results in data exchanges happening slower than the rate of data being sent from the board causing several samples being stamped with an almost exact same time.  The accelerometers are very precise with timing; a 50Hz output data rate will consistently produce data every 20ms.
  • Thanks for the info Eric. Is it all the processors that can't work with multichannel data or just average?
  • Math (firmware v1.1.0+), rms, and rss work with multi channel data.  You should implement the failure callback to see what the errors are if a route is not working as intended.
This discussion has been closed.