Keywords

1 Introduction

With the explosive growth of mobile devices in the past decade, the application scenarios based on smartphone sensors have become more and more widespread. For example, a smartphone can exploit the direction sensor to identify its trajectory to automatically control the moving direction of a game character, so that users are provided with excellent gaming experiences; a smartphone is able to improve its localization accuracy by inferring its user’s trajectory based on PDR [7].

At present, by using the inertial sensors embedded in commercial off-the-shelf (COTS) smartphones, i.e. accelerometer, gyroscope and magnetometer, researches on smartphone sensors have achieved outstanding progress in human motion, game development, panoramic roaming, safe driving, etc. [2, 3, 5]. In [4], a variety of smartphone sensors were employed to design a monitoring algorithm which detects the falling event of elders. In [15], an effective method was proposed to detect the movement of the user’s body and head with accelerometers and gyroscopes to control the natural visualization of three dimensional game objects in smartphones. In [6], the direction sensor embedded in smartphones was used to realize the rotation and translation of the panorama. In [14], a smartphone was employed to identify the driving status of a vehicle, such as going straight-forward, turning and emergency braking, simply based on the accelerometer embedded in a smartphone.

More importantly, different step counting algorithms were proposed to accurately count pedestrian steps by only using an accelerometer. For instances, in [8, 11], gyroscope was employed to implement more accurate step counting algorithms; in [16], pedestrian heading was estimated by efficiently fusing all the three inertial sensors. In these application scenarios, sensor measurements are often assumed to be corrupted by white Gaussian noises [5], which has not been investigated in practice.

However, there are few studies in the literature on understanding the statistical characteristics of sensor measurement errors in practical environments. In order to enhance the feasibility of the existing studies relying on Gaussian distributed sensor measurements, we study the statistical characteristics of sensor measurement errors by making the following contributions.

  • We develop an APP, named Sensor Data Collector, to collect the real measurements of various smartphone sensors.

  • We employ the Xsens MTw to obtain the ground truth of sensor measurements, so that we can evaluate the measurement errors of smartphone sensors.

  • We process and analyze the sensor measurement errors by using MATLAB Toolbox to obtain the statistical characteristics of different sensor errors.

  • We conduct extensive experiments involving different smartphones under various scenarios, including stationary, low speed (i.e. smartphone is held by a walking person) and high speed (i.e. smartphone is held by a running person). The results reveal that, when the device is stationary, the sensor measurement errors fully obey the standard Gaussian distribution; when the speed of smartphones increases, the sensor measurement errors begin rising, and the discrepancy between its distribution and the Gaussian distribution is enlarged.

The rest of the paper is organized as follows. Section 2 introduces the work related to calibration of inertial sensor measurements, as well as studies on offsetting and compensating these sensor measurement errors. Section 3 presents the design details of the Sensor Data Collector (SDC). Section 4 provides details of the experiments in this paper, and gives a subtle analysis of the experimental results. Finally, Sect. 5 gives a conclusion about the statistical characteristics of the sensor measurement errors.

2 Related Work

In this section, we mainly present some researches related to the calibration of inertial sensor measurement errors, including accelerometer measurement errors, gyroscope measurement errors and magnetometer measurement errors.

Researchers utilized noise sources to reduce the accelerometer measurement errors. Yin et al. [17] proposed a comprehensive calibration scheme. They quantified the random noise term through the Allan variance, and used the least squares method to calculate a deterministic calibration coefficient to reduce the interference of random noise. Zhang et al. [18] analyzed the error sources of accelerometer through a large number of repetitive static experiments and established a mathematical model of the error compensation that affects the positioning accuracy of the navigation system.

Qiao et al. [12] utilized the Allan variance to identify the noise coefficient of a gyroscope, and designed the Kalman filter for dynamic simulation on the basis of the error model about the micro-machined gyroscope. The simulation results showed that the exportable mean value of the gyroscope is significantly higher than the original value and calibration value. Li et al. [9] proposed a posterior compensation method for the gyroscope measurement errors. Firstly, the coning compensation was calculated by using angle increment of a gyroscope to output the compensation without error, and then compensating the output errors of the gyroscope at the updating rate of coning compensation.

Li et al. [13] established the compass correction model to analyze the measurement errors of a magnetometer, and derived a calculation formula of the magnetic deviation coefficient. They reduced the heading errors of the magnetometer through some effective methods, such as elliptic hypothesis method, constrained least squares method, etc. Liu et al. [10] proposed a real-time calibration method based on the least square method and the “8” figure calibration method to effectively solve the problem of magnetic interference in the method of magnetometer calibration.

Undoubtedly, the work mentioned above has made outstanding contributions to the research on the sensor measurement errors, and various methods proposed by researchers have effectively decreased the impact of different sensor measurement errors. However, researchers do not propose an unified and effective model to explain the statistical characteristics of the sensor measurement errors in practical environments. Hence, this paper studies the statistical characteristics of the sensor measurement errors in depth and provides a theoretical basis for future research.

3 Sensor Data Collector

In order to study the statistical characteristics of the measurement errors about three sensors (i.e. accelerometer, gyroscope and magnetometer), we firstly need to develop an Android APP to collect real measurements of various smartphone sensors. In this section, we expound the architecture and implementation details of the Android APP, named Sensor Data Collector (SDC).

Fig. 1.
figure 1

The sensor invocation mechanism on the Android platform.

The Sensor Data Collector is able to collect X, Y, and Z triaxial measurements of the three sensors and their detailed parameters in real time. These parameters are device name, device version, device vendor, sensor resolution, and minimum collection delay of the sensor. These parameters can help us determine whether the range of different sensor measurement errors is reasonable. In these parameters, the pervious three pieces of these parameters describe the hardware information of a specific sensor. The sensor resolution represents the minimum resolution of the measurements collected by a sensor, and the minimum delay is related to the maximum sample frequency of the sensor. We choose Android Studio as the development tool, and the specific process for calling a specified sensor is shown in Fig. 1.

To be specific, the SDC should obtain management privileges by the Sensor Manager class at first. And then, it registers the specified sensor type (e.g. TYPE\(\_\)MAGNETIC\(\_\)FIELD, TYPE\(\_\)ACCELEROMETER and TYPE\(\_\)GYROSCOPE) through the registerListener function. Next, it calls the onSensorChanged function to collect real measurements from the specified sensor. Finally, the specified sensor is logged out by the unregisterListener function. We set the sensor sampling frequency of the SDC to 60 HZ, and store three kinds of sensor measurements in a txt file.

4 Experimental Results

In this section, we find out the statistical characteristics of the sensor measurement errors by using the toolbox in MATLAB.

4.1 Experiment Setup

Our experiments are only carried out on the flat road. In the course of the experiments, we ordered an experimenters to carry smartphones and xsens MTW to do a standing motion, walking motion or running motion, these motions correspond to the stationary scenario, the low speed scenario and the high speed scenario, respectively. Smartphones used in our experiments are Nexus5 and Huawei P7. Another device used in the experiments is Xsens MTw, an inertial-magnetic motion tracker made by Xsens [1]. The Xsens MTw can collect highly accurate and real-time 3D measurements with multiple sensors. We set all sensors sampling frequency to 60 Hz and collect 10, 000 data in each motion.

Three different scenarios considered in the experiments include the stationary, low speed and high speed. Specifically, in the stationary scenario, the smartphones are placed on a table; in the low speed scenario, the smartphones are held by a pedestrian who walks at a normal speed of around 1 m/s; in the high speed scenario, the smartphones are held by a person who runs in the playground at a speed of around 4 m/s.

In order to collect real and effective sensor measurements of smartphones and the Xsens MTw, we firstly align one Xsens sensor with the smartphone, such that their coordinate systems are overlapping, and then bind them together using double-side adhesive tape. Finally, we process the sensor measurements obtained by the two devices to calculate the sensor measurement errors used in the experiments. In addition, the magnetometer measurement units about two devices are inconsistent. The magnetometer measurement unit in a smartphone is \(\mu \)T, and the magnetometer measurement unit in MTw is Gauss. According to the unit conversion relationship between Tesla and Gauss, we reduce the magnetometer measurement of the former by 100 times to make the two magnetometer units consistent. Since two electromagnetic devices interfere with each other, we only collect the magnetometer measurement errors under the stationary scenario in a relatively non-magnetic interference environment.

4.2 Sensor Measurement Errors Under the Stationary Scenario

When a mobile device is stationary, we use the dfittool toolbox provided by Matlab to check the statistical characteristics of the sensor measurement errors. Due to the space limit, we have shown the probability density function plot of the different measurement errors collected by two devices in Fig. 2. The horizontal axis of Fig. 2 represents the range of sensor measurement errors, and the vertical axis represents density. Density depends on the group spacing and frequency of different elements. In Fig. 2, ‘hw’ and ‘n5’ respectively represent the HUAWEI P7 and NEXUS5. Looking carefully at Fig. 2, we find that the probability density function plot of sensor measurement errors conforms to the Gaussian distribution characteristics, and satisfies the boundedness, unimodality, symmetry and compensation. These characteristics can be judged that the sensor measurement errors obey the Gaussian distribution.

To further illustrate this discovery, we use the normplot function provided by MATLAB to draw some normal probability plots of various sensors, as shown in Fig. 3 and Fig. 4. Therein, the horizontal axis denotes the measurement errors and the red dashed lines measure the linear coincidence degree. It can be observed that the sensor measurement errors nearly always obey Gauss distributions.

Fig. 2.
figure 2

The probability density function plot in stationary scenario.

Fig. 3.
figure 3

The normal probability plot of various sensor measurement errors in Nexus5 in the stationary scenario.

Fig. 4.
figure 4

The normal probability plot of various sensor measurement errors in HUAWEI P7 in the stationary scenario.

4.3 Sensor Measurement Errors Under the Low Speed Scenario

When a device moves in a low speed, the magnetometers in the smartphones and Xsens MTw will interfere with each other, and affect the authenticity of the observed magnetometer measurements. Therefore, in the low speed scenario, we only study the statistical characteristics of accelerometer measurement errors and gyroscope measurement errors. As shown in Fig. 5, we can still observe that the probability density plots of various sensor measurement errors all conform to the Gaussian distribution characteristics.

In addition, Fig. 6 and Fig. 7 illustrate the normal probability plots of various sensor errors with respect to Nexus5 and HWP7, respectively. As can be seen, the various sensor measurements errors also obey the Gaussian distribution in most time, but there are also some outliers appearing in the head and tail of the sensor measurement errors. Thus, it can be concluded that the errors of accelerometer measurements and gyroscope measurements approximately obey the Gaussian distribution in the low speed scenario.

Fig. 5.
figure 5

The probability density function plot in the low speed scenario.

Fig. 6.
figure 6

The normal probability plot of various sensor measurement errors in Nexus5 in the low speed scenario.

Fig. 7.
figure 7

The normal probability plot of various sensor measurement errors in HUAWEI P7 in the low speed scenario.

Fig. 8.
figure 8

The probability density function plot in the high speed scenario.

Fig. 9.
figure 9

The normal probability plot of various sensor measurement errors in Nexus5 in the high speed scenario.

4.4 Sensor Measurement Errors Under the High Speed Scenario

The method of verifying the statistical characteristics of the sensor measurement errors in the high speed scenario is the same as the method mentioned before, and the conclusions are consistent with the sensor measurement errors in low speed scenario. However, observing Fig. 2, Fig. 5 and Fig. 8, we can conclude that the range of sensor measurement errors becomes larger with the increase of the moving speed. It is noticeable that the approximation to Gaussian distribution becomes degrading in the high speed scenario in comparison with the low speed scenario.

Finally, we present a detailed list of the distribution results of different sensor measurement errors under different scenarios and devices in Table 1, where \(\mu \) represents the sample mean of the sensor measurement errors, and \(\sigma \) represents the sample standard deviation of the sensor measurement errors. ‘HW’ and ‘N5’ respectively represent the HUAWEI P7 and NEXUS5.

Fig. 10.
figure 10

The normal probability plot of various sensor measurement errors in HUAWEI P7 in the high speed scenario.

Table 1. The results of three sensors in different smartphones under different scenarios.

5 Conclusion

In this work, we obtained the error characteristics of smartphone inertial sensors by making the following contributions. First of all, we developed an Android APP, named Sensor Data Collector, to collect the measurements of smartphone inertial sensors. The measurements collected by the Xsens MTw was used as the ground truth to evaluate sensor measurement errors. Finally, based on the experiments carried out under different scenarios, the sensor measurement errors were processed and analyzed by using the MATLAB Toolbox.

The experimental results show that the statistical characteristics of the sensor measurement errors are dependent on the moving speed of smartphones. To be specific, when the device is stationary, the sensor measurement errors fully obey the standard Gaussian distribution; when the speed of smartphones increases, the sensor measurement errors begin rising, and the discrepancy between its distribution and the Gaussian distribution is enlarged. Our studies not only confirm the assumptions of Gaussian distributed measurements of inertial sensor in many existing algorithms, but also provide more accurate descriptions of error characteristics of inertial sensor measurements in smartphones, which will definitely benefit future researches.