Patent ID: 9664539
Date: 2017-05-30
CPC Classifications: G01D,G06F

Claim:
1. A processor implemented method of improving orientation detection at an electronic device, the method comprising: obtaining, by a processor, a sampling rate estimate for a sensor; determining, by the processor, an expected sample time for the sensor sample based on the sampling rate estimate; detecting, by the processor, the sensor sample; in response to detecting the sensor sample, detecting, by the processor, a reporting time for the detected sensor sample; assigning, by the processor, the reporting time to the detected sensor sample, the reporting time representing an identified time when the sensor sample was detected by the processor; determining, by the processor, based on comparing the expected sample time for the detected sensor sample and the assigned reporting time for the detected sensor sample, whether one or more sensor samples have been skipped, the one or more skipped sensor samples being undetected sensor samples generated at a time between the detected sensor sample and a previously detected sensor sample; in response to determining that one or more sensor samples have been skipped, updating, by the processor, the expected sample time for the detected sensor sample to reflect the one or more skipped samples; determining, by the processor, the timestamp for the detected sensor sample as a function of a weighting of the updated expected sample time and the reporting time for the detected sensor sample to mitigate errors that result when a period of time elapses after the sensor sample is generated but before the sensor sample is detected by the processor; associating, by the processor, the determined timestamp to the detected sensor sample; and determining, by the processor, an orientation of an electronic device based on the sensor sample and the determined timestamp.