samedi 26 juillet 2014

iOS - détermination des sources de variabilité des taux de vote de la Motion Core - Stack Overflow


I am trying to determine the source of the time stamps included with Core Motion updates. This is for a human physiology and medical research app that leverages the accelerometer to determine device orientation, particularly angular deviation from an initial zero position. There seem to be two possibilities when I set accelerometerUpdateInterval in my CMMotionManager instance:



  1. The update interval is driven by some thread associated with the Core Motion Framework. Timestamps generated for motion events are then the result of that thread polling the hardware interface and should be accurate except for any lag time in getting and processing the response. So, if I am setting accelerometerUpdateInterval at 25 ms / 40 Hz and I am getting deltas that are typically 24 ms but may deviate by about 10 ms above that value or a a few ms below, I can assume that the deltas represent the correct increments between measurements.


  2. The update interval is governed by some physical clock attached to the accelerometer, similar to the type of motion tracking equipment you might find in a physics or human physiology lab. Discrepancy in time stamps / intervals in this situation is the result of readings piling up in the buffer or something of the like and it can be assumed that readings are actually separated by a constant time interval.



This distinction is important because the researcher who will use the app wants to know how he should extract information (angular acceleration, etc.) from the data; can he do a simple calculation of the derivative assuming constant dt or should he be taking a time series approach?


I have read through the relevant documentation , looked up the hardware specifications , and fished around on relevant research forums. From looking at the specifications for the bus used by the accelerometer (see link in article), it appears that a polling frequency is set every time communication is started with the chip. From this, it would seem to make sense that communication is started when the motion manager starts querying acceleration and updates are then driven by the physical clock. However, this is outside my area of expertise and I have not been able to find verification of that assumption.


I may also be missing other issues, such as prioritization of threading and any related effects on processing the data stream and generating timestamps. For instance, at the end of each run I am using a worker thread to save data locally and upload to a web service. This operation continues into the start of the next run, and during its continuance I see the most instability in the collection interval.


The variability I am seeing does not affect the usability of the app by test subjects or the researcher's ability to identify important thresholds. However, it is important from a research and publication standpoint to use the appropriate method and future analysis may need to be more sensitive.



I am trying to determine the source of the time stamps included with Core Motion updates. This is for a human physiology and medical research app that leverages the accelerometer to determine device orientation, particularly angular deviation from an initial zero position. There seem to be two possibilities when I set accelerometerUpdateInterval in my CMMotionManager instance:



  1. The update interval is driven by some thread associated with the Core Motion Framework. Timestamps generated for motion events are then the result of that thread polling the hardware interface and should be accurate except for any lag time in getting and processing the response. So, if I am setting accelerometerUpdateInterval at 25 ms / 40 Hz and I am getting deltas that are typically 24 ms but may deviate by about 10 ms above that value or a a few ms below, I can assume that the deltas represent the correct increments between measurements.


  2. The update interval is governed by some physical clock attached to the accelerometer, similar to the type of motion tracking equipment you might find in a physics or human physiology lab. Discrepancy in time stamps / intervals in this situation is the result of readings piling up in the buffer or something of the like and it can be assumed that readings are actually separated by a constant time interval.



This distinction is important because the researcher who will use the app wants to know how he should extract information (angular acceleration, etc.) from the data; can he do a simple calculation of the derivative assuming constant dt or should he be taking a time series approach?


I have read through the relevant documentation , looked up the hardware specifications , and fished around on relevant research forums. From looking at the specifications for the bus used by the accelerometer (see link in article), it appears that a polling frequency is set every time communication is started with the chip. From this, it would seem to make sense that communication is started when the motion manager starts querying acceleration and updates are then driven by the physical clock. However, this is outside my area of expertise and I have not been able to find verification of that assumption.


I may also be missing other issues, such as prioritization of threading and any related effects on processing the data stream and generating timestamps. For instance, at the end of each run I am using a worker thread to save data locally and upload to a web service. This operation continues into the start of the next run, and during its continuance I see the most instability in the collection interval.


The variability I am seeing does not affect the usability of the app by test subjects or the researcher's ability to identify important thresholds. However, it is important from a research and publication standpoint to use the appropriate method and future analysis may need to be more sensitive.


0 commentaires:

Enregistrer un commentaire