Improved Pedestrian Dead Reckoning Based on a Robust Adaptive Kalman Filter for Indoor Inertial Location System

Pedestrian dead reckoning (PDR) systems based on a microelectromechanical-inertial measurement unit (MEMS-IMU) providing advantages of full autonomy and strong anti-jamming performance are becoming a feasible choice for pedestrian indoor positioning. In order to realize the accurate positioning of pedestrians in a closed environment, an improved pedestrian dead reckoning algorithm, mainly including improved step estimation and heading estimation, is proposed in this paper. Firstly, the original signal is preprocessed using the wavelet denoising algorithm. Then, the multi-threshold method is proposed to ameliorate the step estimation algorithm. For heading estimation suffering from accumulated error and outliers, robust adaptive Kalman filter (RAKF) algorithm is proposed in this paper, and combined with complementary filter to improve positioning accuracy. Finally, an experimental platform with inertial sensors as the core is constructed. Experimental results show that positioning error is less than 2.5% of the total distance, which is ideal for accurate positioning of pedestrians in enclosed environment.


Introduction
Indoor positioning is a technology for positioning in an indoor environment, which shows great prospects in industries such as emergency rescue, logistics, wireless games and shopping malls [1][2][3]. The Global Navigation Satellite System, such as the Global Positioning System (GPS), BeiDou Navigation Satellite System (BDS), and Global Navigation Satellite System (GLONASS), can provide absolute accurate positioning, but its performance in some enclosed environments, such as tunnels and mines, is not satisfied; as the Global Navigation Satellite System may suffer heavily from satellite signal blockage [4]. Therefore, how to obtain accurate position information of indoor objects has attracted wide attention. At present, indoor positioning methods have been proposed, including Ultra Wideband (UWB) [5], ZigBee [6], Wi-Fi [7], Bluetooth [8], Radio Frequency Identification (RFID) [9], and visual positioning [10]. However, performances of these positioning methods are easily affected by external environment. UWB positioning is susceptible to non-line-of-sight interference such as occlusion, external collision and strong magnetic field interference [11]. Wi-Fi positioning is susceptible materials. There are serious cumulative errors when using the gyroscope alone, especially at corners. The longer the time is, the larger the cumulative error will be [34]. In order to improve the heading accuracy of the inertial measurement unit, fusion filtering algorithms are proposed, such as Kalman filtering [35] and complementary filtering [36]. The authors in [37] use an extended Kalman filter based on two-level quaternions to fuse signals of acceleration, angular velocity and magnetic to minimize the cumulative error, but ignores the change in noise characteristics. Therefore, the adaptive filtering algorithm is proposed. In the literature [38], the fuzzy adaptive Kalman filter is used to fuse the signals of gyroscope and accelerometer, but it is limited by the precision of the fuzzy control, and the calculation amount is large. Sage-Husa adaptive filtering [39] can correct the statistical characteristics of process noise and measurement noise in real time to improve the filtering accuracy, but it is difficult to give accurate noise characteristics and the calculation amount is large. In comparison, the complementary fusion filter [40] complements the signals of accelerometer, magnetometer and gyroscope with a small amount of calculation, but high precision. The paper is structured as follows: Section 2 briefly introduces the indoor positioning model based on the PDR algorithm firstly, and then the wavelet decomposition is used to preprocess the original signal, finally the proposed improved PDR algorithm is discussed in detail, including improved step estimation, length estimation, and heading estimation based on fusion filtering. In Section 3, several experiments are performed and the experimental results are analyzed based on established experimental platform. Some final remakes in Section 4 end the paper.

Pedestrian Dead Reckoning
Pedestrian dead reckoning algorithm is an effective way to achieve pedestrian positioning in a closed environment. In PDR algorithm, the step frequency and length of penetration are estimated based on information of acceleration, respectively. The pedestrian's movement direction can be determined from the gyroscope's output. Thus the position of pedestrian can be calculated based on the step, step length and heading. The pedestrian positioning model based on PDR is expressed as follows: In Figure 1, black marks represent footprint of pedestrian, and arrows indicate the direction of pedestrian movement. L k and ϕ k represent pedestrian's step length and heading at step k. (x k , y k ) represents the pedestrian position at step k. Pedestrian positioning equation is shown as follows: x k+1 = x k + L k sin ϕ k y k+1 = y k + L k cos ϕ k (1) Sensors 2019, 19, x FOR PEER REVIEW 3 of 22 filtering [35] and complementary filtering [36]. The authors in [37] use an extended Kalman filter based on two-level quaternions to fuse signals of acceleration, angular velocity and magnetic to minimize the cumulative error, but ignores the change in noise characteristics. Therefore, the adaptive filtering algorithm is proposed. In the literature [38], the fuzzy adaptive Kalman filter is used to fuse the signals of gyroscope and accelerometer, but it is limited by the precision of the fuzzy control, and the calculation amount is large. Sage-Husa adaptive filtering [39] can correct the statistical characteristics of process noise and measurement noise in real time to improve the filtering accuracy, but it is difficult to give accurate noise characteristics and the calculation amount is large. In comparison, the complementary fusion filter [40] complements the signals of accelerometer, magnetometer and gyroscope with a small amount of calculation, but high precision. The paper is structured as follows: Section 2 briefly introduces the indoor positioning model based on the PDR algorithm firstly, and then the wavelet decomposition is used to preprocess the original signal, finally the proposed improved PDR algorithm is discussed in detail, including improved step estimation, length estimation, and heading estimation based on fusion filtering. In Section 3, several experiments are performed and the experimental results are analyzed based on established experimental platform. Some final remakes in Section 4 end the paper.

Pedestrian Dead Reckoning
Pedestrian dead reckoning algorithm is an effective way to achieve pedestrian positioning in a closed environment. In PDR algorithm, the step frequency and length of penetration are estimated based on information of acceleration, respectively. The pedestrian's movement direction can be determined from the gyroscope's output. Thus the position of pedestrian can be calculated based on the step, step length and heading. The pedestrian positioning model based on PDR is expressed as follows: In Figure 1, black marks represent footprint of pedestrian, and arrows indicate the direction of pedestrian movement. Lk and φk represent pedestrian's step length and heading at step k. (xk, yk) represents the pedestrian position at step k. Pedestrian positioning equation is shown as follows:   Pedestrian indoor positioning model describes the whole process from data acquisition to position output, as shown in Figure 2. In this model, MEMS-IMU part integrates several inertial sensors such as accelerometer, magnetometer, and gyroscope. The raw data of acceleration, angular velocity and magnetic field strength acquired through the MEMS-IMU suffers seriously from low signal to noise ratio. Therefore, it is necessary to preprocess the raw signal by wavelet denoising. After preprocessing, the information of acceleration is used to estimate steps and step length. Accelerometer and gyroscope complement each other to get the initial attitude angle by complementary filter, which then are taken as measured value of robust adaptive Kalman filter (RAKF). To suppress the interference of outliers, RAKF is proposed based on adaptive Kalman filter, and optimal heading angle ϕ is obtained. According to the information of step n, length l and heading angle, the pedestrian's position is calculated based on Equation (1).

Wavelet denoising
Step estimation

Signal Preprocessing
The MEMS inertial system is widely used in positioning systems because of its low cost, light weight, and complete autonomy. However, the inertial sensor is easily affected by the determination error and the random error. The determination error is closely related to the MEMS structure and the processing technology, and reducing this error is expensive and difficult. Therefore, random error's processing of inertial sensors becomes the focus of MEMS data processing [41]. Typical denoising methods include digital filtering and wavelet denoising. Digital filtering separates the wanted signal and noise to denoise without overlapping the spectrum of the signal and the spectrum of the noise. The spectrum of the actual situation signal and the spectrum of the noise tend to overlap. For example, the spectrum of Gaussian white noise is distributed almost in the entire frequency domain. Wavelet denoising can be used to well separate random noise. Therefore, the original signal is preprocessed by wavelet denoising.
As an effective signal digital processing method, wavelet denoising is based on the different characteristics of signals and noise at various scales. The wavelet coefficients are obtained by following certain threshold criteria to achieve effective denoising. Wavelet denoising can be divided into the following three steps: (1) Wavelet decomposition of signals containing noise: select the appropriate wavelet base and decomposition layer; (2) Threshold quantization processing: select appropriate thresholds and threshold functions to process the coefficients of each layer; (3) Wavelet reconstruction: reconstruct the processed coefficients to obtain the denoised signal.
In the process of wavelet denoising, the choice of threshold is very important, usually using hard threshold and soft threshold method. The hard threshold method is prone to edge blurring and Gibbs phenomenon; the soft threshold method changes the degree of approximation between the reconstructed signal and the original signal. The improved threshold function is proposed from the literature [42]: where T is the denoising operation, that is, by the threshold and the threshold function, filtering out the noise coefficient and retaining the detail coefficient. u is the wavelet coefficient before denoising, and λ 1 and λ 2 are the lower threshold and the upper threshold. The adjustment parameter m can change the lower threshold so that the improved threshold function tends to be between the soft threshold function and the hard threshold function, having both the advantages of them.

Pedestrian Dead Reckoning
Pedestrian dead reckoning uses the inertial measurement unit to calculate the position of the next moment based on current position. It has advantages of simple structure, small size, full autonomy, and strong anti-interference characteristics. The algorithm includes three important parts: step estimation, length estimation, and heading estimation.

Step Estimation
Acceleration has periodicity during normal pedestrian motion, and peak detection is an effective means to determine the pedestrian's step. In order to avoid the influence of system errors and the specific orientation of the accelerometer, the total acceleration A of the three axes is calculated: where A x , A y , A z represent the corresponding acceleration of three axes of accelerometer.
The key to peak detection is to avoid interference from abnormal peaks, and conventional peak detection uses a fixed time window to constrain the peaks, which ignores the constraints of adjacent peaks on acceleration. In this paper, the multi-threshold is used to constrain the acceleration peak to improve the accuracy of the step estimation. A set of constraints (p, v, ∆p t , ∆v t , |∆p|, |∆v|) represent peaks, valleys, time differences of adjacent peak, time differences of adjacent valley, differences of adjacent peak-to-peak, and differences of adjacent valley-to-valley. The effective peak and valley discriminant equations are shown as follows: wherein peak = 1 indicates it is an effective peak; and peak = 0 indicates a pseudo peak. (p η , ∆p tη− , ∆p tη+ , ∆p η ) is the threshold group for peak detection.
wherein valley = 1 indicates it is an effective valley; and valley = 0 indicates a pseudo valley. (v η , ∆v tη − , ∆v tη+ , ∆v η ) is the threshold group for valley detection. When stationary, the accelerometer is affected by the acceleration of gravity, and the total acceleration A is approximately equal to 10. The cycle of foot movement starts with the footstep off the ground and ends with the footstep touching the ground again. At the start, the upward acceleration is opposite to the direction of gravity acceleration, and the direction is the same when re-contacting, so set p η > 10 and v η < 10. An effective peak and a valley adjacent to each other constitute an effective step. In summary, the step detection based on the triple constraint condition considers the constraint of the adjacent peaks on the pedestrian acceleration, which can avoid the misjudgment problem of the traditional PDR gait detection method, and thus realize the accurate judgment of the step number.

Length Estimation
A precise accurate dynamic length estimation model allows researchers to improve the accuracy of pedestrian dead reckoning. The authors in [43] use the nonlinear step size model to estimate the step length, and the improved model is in this paper is effective for step length estimation of different pedestrian individuals.
As known to all, different individuals have different parameters α and β. To enable this model suitable for different individual, α and β should be obtained by performing the least-multiplication fitting of the training data before positioning.

Heading Estimation
The heading estimate is a crucial part of the pedestrian dead reckoning algorithm, which is calculated from measurement data of strapdown MEMS-IMU. A data fusion algorithm of attitude angle can be roughly divided into two categories. One is based on the frequency domain characteristics, the typical algorithm of which is complementary filter. This fusion algorithm does not need to consider the statistical characteristics of the signal and noise. The other is to design filters in the time domain using the state-space approach, such as the Kalman filter. As complementary filters generally do not require an accurate noise model, it has advantages of less computation and higher accuracy. However, complementary filters cannot suppress the measurement of outliers. Therefore, this paper proposes a fusion filter algorithm consisting of complementary filter and robust adaptive Kalman filter (RAKF). Take pitch θ as an example, and the fusion filter model is shown as follows: (1) Complementary Filter MEMS inertial sensors have some inherent problems. There is a static drift in the gyroscope, and errors will accumulate when the attitude is calculated; the dynamic response of the accelerometer and magnetometer is poor, but there is no cumulative error. Therefore, the attitude of accelerometer and magnetometer, the attitude of gyroscope are calculated under static and dynamic conditions, respectively, and then the outputs are complementary to each other to improve the accuracy of the attitude. Complementary filter algorithm is shown in Figure 3 in details.
Sensors 2019, 19, x FOR PEER REVIEW 6 of 22 In summary, the step detection based on the triple constraint condition considers the constraint of the adjacent peaks on the pedestrian acceleration, which can avoid the misjudgment problem of the traditional PDR gait detection method, and thus realize the accurate judgment of the step number.

Length Estimation
A precise accurate dynamic length estimation model allows researchers to improve the accuracy of pedestrian dead reckoning. The authors in [43] use the nonlinear step size model to estimate the step length, and the improved model is in this paper is effective for step length estimation of different pedestrian individuals.
As known to all, different individuals have different parameters α and β. To enable this model suitable for different individual, α and β should be obtained by performing the least-multiplication fitting of the training data before positioning.

Heading Estimation
The heading estimate is a crucial part of the pedestrian dead reckoning algorithm, which is calculated from measurement data of strapdown MEMS-IMU. A data fusion algorithm of attitude angle can be roughly divided into two categories. One is based on the frequency domain characteristics, the typical algorithm of which is complementary filter. This fusion algorithm does not need to consider the statistical characteristics of the signal and noise. The other is to design filters in the time domain using the state-space approach, such as the Kalman filter. As complementary filters generally do not require an accurate noise model, it has advantages of less computation and higher accuracy. However, complementary filters cannot suppress the measurement of outliers. Therefore, this paper proposes a fusion filter algorithm consisting of complementary filter and robust adaptive Kalman filter (RAKF). Take pitch θ as an example, and the fusion filter model is shown as follows: (1) Complementary Filter MEMS inertial sensors have some inherent problems. There is a static drift in the gyroscope, and errors will accumulate when the attitude is calculated; the dynamic response of the accelerometer and magnetometer is poor, but there is no cumulative error. Therefore, the attitude of accelerometer and magnetometer, the attitude of gyroscope are calculated under static and dynamic conditions, respectively, and then the outputs are complementary to each other to improve the accuracy of the attitude. Complementary filter algorithm is shown in Figure 3 in details.   filter. The error between the attitude angle calculated by accelerometer and magnetometer, and the post-filtering attitude angle are PI-controlled. Then the complementary filter algorithm is used to fuse the attitude information and improve the accuracy of the attitude. In Figure 3, τ/τ + dt is high-pass filter and dt/τ + dt is low-pass filter. The output of the accelerometer and magnetometer passes through a low-pass filter to limit the high-frequency jitter in the attitude measurement; accumulated drift error of the gyroscope can be suppressed through the high-pass filter. The parameters are selected according to reference [44]. K p is the switching frequency of the low-pass filter and the high-pass filter, which is selected according to the frequency characteristics of the accelerometer and the output of the gyroscope, and K p = K i 2 /2. The parameters K p , K i of the complementary filter in this paper are set to 0.7 and 1.2 respectively, where the error correction effect is obvious.
(2) Robust Adaptive Kalman Filter Complementary filter complements accelerometer, magnetometer with gyroscope to suppress cumulative errors, which improves the accuracy of heading. However, the complementary algorithm is limited by the inaccurate measurement of the sensors. The outliers in the measured value cannot be identified and the interference cannot be suppressed, which severely reduces the accuracy and affects stability of the positioning system. On the basis of a complementary filter, the robust adaptive Kalman filter algorithm is proposed in this paper. The post-complementary filtered attitude and Optimal attitude are measured value and state value, respectively, to suppress the influence of the measured outliers on the heading estimation.
The basic idea of Kalman filter is that based on the state model of signal and noise, the estimate of the current state variable is updated using the previous time's estimated value and the current time's observation value. The equation of state for the pedestrian positioning system is described below: is the state variable, w(k) represents system noise vector, which is ignored in this stable positioning system. The complementary filtered attitude angles are selected as the measured value Z(k) = [Φ(k), θ(k), ψ(k)], the observation equation is shown as follow: where H(k) = diag [1,1,1], and v(k + 1) is the observation noise vector. The Kalman filter consists of a prediction process and an update process. The calculation steps are as follows: (1) Forecasting process: Covariance matrix of state prediction (2) Updating process: Covariance matrix of state estimation By adding a measurement noise estimator to the traditional Kalman [45], the statistical properties of the measurement noise can be estimated and corrected in real time.
where in b is forgetting factor, and the range of b is 0.95-0.99 in reference [45], which is set to 0.98 in the paper; the definition innovation matrix e k and the corresponding covariance matrix C k at time k are: When the system is not faulty, the innovation is a zero-mean white noise sequence. If the actual statistical characteristics of the innovation are not consistent with the theory, the process is considered to be abnormal. In terms of fault detection, the innovation χ 2 detection algorithm is an effective method.
Assume test statistic The innovation e k is a normal distribution with zero mean, so T k obeys the χ 2 distribution with a degree of freedom m (m is the dimension of the observation). Transform the fault detection condition into a hypothesis test condition, according to the definition of the χ 2 distribution: In the formula, H 0 indicates that there is no gross error in the observed value, H 1 indicates that the observed value has an abnormal value, and λ is a non-centralized parameter. The significance level α indicates the probability that the null hypothesis is established but rejects the hypothesis selection alternative hypothesis. The selection of the significance level determines the threshold of the innovation statistic. The smaller the value of α, the larger the threshold, and too large or too small threshold will affect the system's robust performance. A suitable value for the alpha should be in the range of 0.01 to 0.15, and we make α = 0.1 in the paper. The boundary condition is set to T D = χ 2 a (m, 0).
If T k ≤ T D , it is judged that there is no abnormality in the observation. Otherwise, there is an abnormal value in the observation. It is necessary to introduce a weighting factor to amplify the new covariance and reduce the influence of the wild value on the filtering. Construct weighting factor using Huber functions: And a = diag [a 1 , a 2 . . . a n ], I = 1, 2 . . . n. The equivalent covariance of the observations is updated to It can be seen from Equation (12) that the adaptive innovation weighting factor (a i ≤ 1) reduces the gain matrix when the observed gross error occurs. The weight of the gross error in the state estimation is reduced, the interference of the wild value on the filtering is suppressed, and the fault tolerance of the system is improved. The whole RAKF algorithm is shown as below in details in Figure 4:

Laboratory Equipment
The Mti series MEMS-IMU from Xsens is used in the experiment, which is fixed on the instep. The MEMS-IMU is mainly composed of a triaxle orthogonal accelerometer, a triaxle orthogonal magnetometer and a triaxle orthogonal gyroscope. Keep the foot unmoved for 1 s before the start of the experiment to coincide with the starting point. The MEMS-IMU used in the experiment meets the experimental requirements.

Analysis of Signal Preprocessing
In order to verify the validity of the wavelet decomposition, the angular velocity of the gyro X-axis in the static case is selected for analysis. In this paper, the wavelet decomposition selects 'db6 as the wavelet basis function according to reference [42]. The number of decomposition layers of 3 to 9 wavelets is selected for comparative study, and the optimal decomposition layer number of 9 is selected. The wavelet coefficients are processed by the improved threshold function. The parameters of improved threshold function are set according to the literature [42], where upper threshold λ 2 is a fixed value 0.8; m is an integer from 2-13; and lower threshold λ 1 is set to λ 2 /(m + 1). Draw a comparison of the original signal and the reconstructed colored noise, as shown in Figure 5. Compared with the original signal, the reconstructed signals are all closer to the true value, no matter what threshold functions are used, which proves the filtering effectiveness of the wavelet decomposition. Compared with traditional threshold functions, the improved threshold function in [42] perform better, which is adopted in this paper to improve the credibility of data.

Analysis of Signal Preprocessing
In order to verify the validity of the wavelet decomposition, the angular velocity of the gyro X-axis in the static case is selected for analysis. In this paper, the wavelet decomposition selects 'db6′ as the wavelet basis function according to reference [42]. The number of decomposition layers of 3 to 9 wavelets is selected for comparative study, and the optimal decomposition layer number of 9 is selected. The wavelet coefficients are processed by the improved threshold function. The parameters of improved threshold function are set according to the literature [42], where upper threshold λ2 is a fixed value 0.8; m is an integer from 2-13; and lower threshold λ1 is set to λ2/(m + 1). Draw a comparison of the original signal and the reconstructed colored noise, as shown in Figure 5. Compared with the original signal, the reconstructed signals are all closer to the true value, no matter what threshold functions are used, which proves the filtering effectiveness of the wavelet decomposition. Compared with traditional threshold functions, the improved threshold function in [42] perform better, which is adopted in this paper to improve the credibility of data.

Analysis of Improved PDR Algorithm
In order to verify the effectivity of the proposed improved PDR algorithm, step estimation, step length estimation, and heading estimation are tested separately before the formal experiment. The experimental site is arranged on the second floor of the entire School of Internet of Things Engineering. The satellite image of the experimental site is shown in Figure 6a. The structure and installation of the pedestrian inertial navigation system is shown in Figure 6b. A three-axis

Analysis of Improved PDR Algorithm
In order to verify the effectivity of the proposed improved PDR algorithm, step estimation, step length estimation, and heading estimation are tested separately before the formal experiment. The experimental site is arranged on the second floor of the entire School of Internet of Things Engineering. The satellite image of the experimental site is shown in Figure 6a. The structure and installation of the pedestrian inertial navigation system is shown in Figure 6b. A three-axis accelerometer, three-axis gyroscope, and three-axis magnetometer are mounted on the I2C bus and data are transmitted from the serial port to the host computer through the DSP. Acceleration, angular rate, and magnetic field strength measurements are obtained. The inertial navigation module is tied on the foot to obtain pedestrian movement information.
In Figure 6a, the red circle represents the starting point and the ending point. The direction of movement is indicated by the arrow. The area enclosed by the black dotted line is used to test the performance of the step estimation algorithm. The MEMS-IMU is fixed on the back of the pedestrian, and the subject moves along the arrow as shown in Figure 6b. accelerometer, three-axis gyroscope, and three-axis magnetometer are mounted on the I2C bus and data are transmitted from the serial port to the host computer through the DSP. Acceleration, angular rate, and magnetic field strength measurements are obtained. The inertial navigation module is tied on the foot to obtain pedestrian movement information. In Figure 6a, the red circle represents the starting point and the ending point. The direction of movement is indicated by the arrow. The area enclosed by the black dotted line is used to test the performance of the step estimation algorithm. The MEMS-IMU is fixed on the back of the pedestrian, and the subject moves along the arrow as shown in Figure 6b.
In order to verify the validity of the algorithm, the pedestrian moves at the above experimental site, and the acceleration information of the strap-down MEMS-IMU is obtained. Then, the wavelet denoising is adopted to improve reliability of acceleration data. Finally, the new data is processed to
In order to verify the validity of the algorithm, the pedestrian moves at the above experimental site, and the acceleration information of the strap-down MEMS-IMU is obtained. Then, the wavelet denoising is adopted to improve reliability of acceleration data. Finally, the new data is processed to obtain the total acceleration of the three axes, and the multi-threshold method is used to discriminate the effective peaks and valleys, which form effective steps, as shown in Figure 7. Figure 7a is the global processed acceleration waveform, and Figure 7b is a partial enlarged view of the first 15 s part. In Figure 7, it is obvious that A is approximately equal to 10 when stationary. According to the previously proposed step estimation algorithm, effective peaks and valleys are found as shown in Figure 7b, which are marked with red squares, and adjacent effective peak and valley can form an effective step. After multiple tests, the average detection accuracy is roughly 99%, which prove the stability and effectiveness of the step estimation algorithm. obtain the total acceleration of the three axes, and the multi-threshold method is used to discriminate the effective peaks and valleys, which form effective steps, as shown in Figure 7.   Figure 7, it is obvious that A is approximately equal to 10 when stationary. According to the previously proposed step estimation algorithm, effective peaks and valleys are found as shown in Figure 7b, which are marked with red squares, and adjacent effective peak and valley can form an effective step. After multiple tests, the average detection accuracy is roughly 99%, which prove the stability and effectiveness of the step estimation algorithm.

Step Length Analysis
The parameters α and β in Equation (6) vary from person to person due to factors such as height, weight, and gender, so different individuals must be trained to obtain the applicable parameters before positioning. In this paper, two subjects participated in length experiment, subject 1 is female, 165 cm height, 56 kg weight; subject 2 is male, 176 cm, and 72 kg. Two subjects are required to move at random to record training data as much as possible. Then the training data including step length and acceleration information is processed by the least squares method to obtain the corresponding parameters α and β. The parameters α and β of subjects are −0.6291 and 0.0868, −0.7291, and 0.0922, respectively.
For quantitative analysis, two subjects performed multiple tests in site shown in Figure 6b, including status of walking and running. Subjects move from red frame, along direction of arrows in a fixed step of 1 m (length of 2 tiles), and the realistic distance (RD) for length estimation is about 181m. Data is processed using the length estimation model in reference [43] and improved model of this paper, respectively. The step length and error of two subjects are intuitively compared in the Figure 8. Finally, the solution distance (SD) and mean absolute error (MAE) of length of both two subjects processed by different models are calculated. The results of same subject in the same state are averaged and shown in Table 1, where Run-1 represents the results of subject 1 under running.

Table 1.
Step length analysis of two subjects using different models. RD: realistic distance; SD: solution distance; MAE: mean absolute error.

RD [m]
Original

Step Length Analysis
The parameters α and β in Equation (6) vary from person to person due to factors such as height, weight, and gender, so different individuals must be trained to obtain the applicable parameters before positioning. In this paper, two subjects participated in length experiment, subject 1 is female, 165 cm height, 56 kg weight; subject 2 is male, 176 cm, and 72 kg. Two subjects are required to move at random to record training data as much as possible. Then the training data including step length and acceleration information is processed by the least squares method to obtain the corresponding parameters α and β. The parameters α and β of subjects are −0.6291 and 0.0868, −0.7291, and 0.0922, respectively.
For quantitative analysis, two subjects performed multiple tests in site shown in Figure 6b, including status of walking and running. Subjects move from red frame, along direction of arrows in a fixed step of 1 m (length of 2 tiles), and the realistic distance (RD) for length estimation is about 181m. Data is processed using the length estimation model in reference [43] and improved model of this paper, respectively. The step length and error of two subjects are intuitively compared in the Figure 8. Finally, the solution distance (SD) and mean absolute error (MAE) of length of both two subjects processed by different models are calculated. The results of same subject in the same state are averaged and shown in Table 1, where Run-1 represents the results of subject 1 under running.
In Figure 8, the left and right part represents the measured results in walking and running respectively. Through observing each single step, the length estimation accuracy of improved model is generally a little better than the original model, although not very obvious. In qualitative analysis of both two models, experimental data of the entire path, which contains both subjects is used to calculate mean absolute error and Solution distance. As shown in Table 1, the improved model performs better than the original model, regardless of subjects or motions. The accuracy of length estimation of run-2 is relatively poor, but the accuracy is still higher than 94%. The improved model can provide accurate length estimation in PDR algorithm, where parameters α and β need to be determined by individual in advance. Table 1.
Step length analysis of two subjects using different models. RD: realistic distance; SD: solution distance; MAE: mean absolute error.

RD [m]
Original  Step length and error comparison of two subjects in different motions using different models.
In Figure 8, the left and right part represents the measured results in walking and running respectively. Through observing each single step, the length estimation accuracy of improved model is generally a little better than the original model, although not very obvious. In qualitative analysis of both two models, experimental data of the entire path, which contains both subjects is used to calculate mean absolute error and Solution distance. As shown in Table 1, the improved model performs better than the original model, regardless of subjects or motions. The accuracy of length estimation of run-2 is relatively poor, but the accuracy is still higher than 94%. The improved model can provide accurate length estimation in PDR algorithm, where parameters α and β need to be determined by individual in advance.
Different individuals need corresponding parameters. In order to highlight the importance of the corresponding parameters, the parameters of subject 1 are used to solve subject 2, and the results under two different motions are both shown as follows: the SD and MAE of subject 2 under running are 238.2 and 0.32, respectively. In the walking state, the solution distance and mean absolute error are 231.8 and 0.27, respectively. Compare the solution results of subject 2 using two different parameters, it is obvious that the results using the corresponding parameters, no matter original or improved model is used, are much better than the results under mismatched parameters. Therefore, it is necessary that different individuals should obtain the matching parameters before performing the positioning experiments. Step length and error comparison of two subjects in different motions using different models. Different individuals need corresponding parameters. In order to highlight the importance of the corresponding parameters, the parameters of subject 1 are used to solve subject 2, and the results under two different motions are both shown as follows: the SD and MAE of subject 2 under running are 238.2 and 0.32, respectively. In the walking state, the solution distance and mean absolute error are 231.8 and 0.27, respectively. Compare the solution results of subject 2 using two different parameters, it is obvious that the results using the corresponding parameters, no matter original or improved model is used, are much better than the results under mismatched parameters. Therefore, it is necessary that different individuals should obtain the matching parameters before performing the positioning experiments.

Heading Analysis
The improved heading estimation is the core of the proposed PDR algorithm, inheriting the advantages of complementary filtering (CF) and robust adaptive Kalman filter. In the PDR algorithm, subtle heading deviation will cause pedestrian to deviate significantly from the real position because of the cumulative effect, which severely affects the accuracy of the inertial positioning system. The heading tests are carried out in the above environment, and Figure 9 shows comparisons of performance of different algorithms in terms of heading error.
The improved heading estimation is the core of the proposed PDR algorithm, inheriting the advantages of complementary filtering (CF) and robust adaptive Kalman filter. In the PDR algorithm, subtle heading deviation will cause pedestrian to deviate significantly from the real position because of the cumulative effect, which severely affects the accuracy of the inertial positioning system. The heading tests are carried out in the above environment, and Figure 9 shows comparisons of performance of different algorithms in terms of heading error. As shown in Figure 9, the performance of complementary filtering is not good enough, whose MAE is 18.6°. Compared to complementary filtering, CF + KF performs better, but still suffers from interference of abnormal values. In contrast, fusion filter introduces RAKF with complementary filtering, which can effectively reduce the influence of outliers on filtering to improve the accuracy of PDR positioning system. As shown in Figure 9b, the dynamic error of complementary filter and CF + KF are −58.6-12.8° and −10.8-39.8, showing that there are individual outliers. In comparison, the heading dynamic error of the fusion filter is −18.1-9.8, indicating that individual outliers are effectively suppressed.

Trajectory Comparison Analysis
In order to verify the performance of the complete PDR positioning system combined of improved step estimation, adaptive step length model, and fusion filtering, several sets of pedestrian positioning experiments are carried out indoors.
Multiple tests of pedestrian positioning are performed under status of walking and running in the presented location, respectively. The measured data is stored and then processed evenly to obtain the following simulation map, where the starting point is preset to (0, 0) in matlab. Figures 10 and 11 are actual trajectories and error comparisons in the walking state; Actual trajectories and error comparison diagrams in the running state are shown in Figures 12 and 13. For the quantitative analysis of the improved PDR positioning system, the error range, mean absolute error, and root mean square error of the east and north directions of each trajectory are calculated, as shown in Tables 2 and 3. As shown in Figure 9, the performance of complementary filtering is not good enough, whose MAE is 18.6 • . Compared to complementary filtering, CF + KF performs better, but still suffers from interference of abnormal values. In contrast, fusion filter introduces RAKF with complementary filtering, which can effectively reduce the influence of outliers on filtering to improve the accuracy of PDR positioning system. As shown in Figure 9b, the dynamic error of complementary filter and CF + KF are −58.6-12.8 • and −10. 8-39.8, showing that there are individual outliers. In comparison, the heading dynamic error of the fusion filter is −18.1-9.8, indicating that individual outliers are effectively suppressed.

Trajectory Comparison Analysis
In order to verify the performance of the complete PDR positioning system combined of improved step estimation, adaptive step length model, and fusion filtering, several sets of pedestrian positioning experiments are carried out indoors.
Multiple tests of pedestrian positioning are performed under status of walking and running in the presented location, respectively. The measured data is stored and then processed evenly to obtain the following simulation map, where the starting point is preset to (0, 0) in matlab. Figures 10 and 11 are actual trajectories and error comparisons in the walking state; Actual trajectories and error comparison diagrams in the running state are shown in Figures 12 and 13. For the quantitative analysis of the improved PDR positioning system, the error range, mean absolute error, and root mean square error of the east and north directions of each trajectory are calculated, as shown in Tables 2 and 3.
According to the trajectory map under walking, the pedestrian's trajectory is slowly offset from the real trajectory due to the existence of the cumulative error, and the end point does not coincide with the preset end point. With fusion filter composed of CF and RAKF, the east and north error ranges are −9.8-6.3 m and −5.2-5.1 m, respectively. The mean absolute errors of east and north are 5.3 and 3.8 m. The error analysis with complementary filter and CF + KF are also shown in Table 2. In contrast, the positioning accuracy of fusion filter composed of CF and RAKF is obviously better. The error of the improved PDR positioning system is lower than 2.5% of the total length under walking, which can be well used to conduct accurate positioning in the closed environment.
According to the above figures and Table 3, the positioning accuracy of fusion filter is significantly higher than single complementary filter and CF + KF, which is consistent with the results in the walking state.  Table 2. In contrast, the positioning accuracy of fusion filter composed of CF and RAKF is obviously better. The error of the improved PDR positioning system is lower than 2.5% of the total length under walking, which can be well used to conduct accurate positioning in the closed environment.  Table 2. In contrast, the positioning accuracy of fusion filter composed of CF and RAKF is obviously better. The error of the improved PDR positioning system is lower than 2.5% of the total length under walking, which can be well used to conduct accurate positioning in the closed environment.     According to the above figures and Table 3, the positioning accuracy of fusion filter is significantly higher than single complementary filter and CF + KF, which is consistent with the results in the walking state.

Additional Experiments
In this section, in order to verify the scope of the proposed algorithm, the additional experiments in typical sites are performed using two kinds of sensors for testing and comparison. As shown in Figure 14, one is the high-performance sensor Mti series MEMS-IMU from Xsens, and the other is the low-cost IMU AH-100B. The typical sites are divided into complex and broad place.

Additional Experiments
In this section, in order to verify the scope of the proposed algorithm, the additional experiments in typical sites are performed using two kinds of sensors for testing and comparison. As shown in Figure 14, one is the high-performance sensor Mti series MEMS-IMU from Xsens, and the other is the low-cost IMU AH-100B. The typical sites are divided into complex and broad place. Typical case 1: The complex site is selected in the laboratory, and the schematic diagram of the laboratory is shown in Figure 15a. Figure 15b displays the setting of experiment: The shadows represent the desks, the blanks represent the walkways, where subject moves. The red circle Typical case 1: The complex site is selected in the laboratory, and the schematic diagram of the laboratory is shown in Figure 15a. Figure 15b displays the setting of experiment: The shadows represent the desks, the blanks represent the walkways, where subject moves. The red circle represents starting point, which is established as the point [0, 0], and the subject moves in the laboratory along the direction of the arrow. The experimental results of Mti series MEMS-IMU are shown in Figure 15c, and Figure 15d represents the positioning trajectory of AH-100B. According to the two figures, it is obvious that the proposed algorithm has better performance than the original model. At the same time, according to Figure 15d, the positioning accuracy of the improved algorithm is significantly improved compared with the traditional algorithm, but it is limited to the performance of the sensor to some extent.  According to Figure 16, the experimental results performed in library are consistent with the results in laboratory. In some places where the requirements are not demanding, low-cost MEMS are recommended to be used, whose performance is reluctantly acceptable. However, in some demanding places, such as mines and fire rescue, it is recommended to use high-performance MEMS, which can provide accurate positioning using improved model proposed in this paper.

Conclusions
In this paper, an improved PDR positioning system based on pure inertial sensors is proposed. First of all, thanks to the development of MEMS-IMU, portable sensors can be carried around. In view of the low signal-to-noise ratio of inertial sensors, wavelet decomposition is used to pre-filter the inertial signals to improve the credibility of the data. In the PDR algorithm, the step estimation and the dynamic step length model are improved to obtain pedestrian's high precision step and step length. The heading estimation is the core of the PDR algorithm, whose subtle accumulation will seriously affect the accuracy of pedestrian positioning. In heading estimation algorithm, the complementary algorithm is firstly used to fuse magnetometer, accelerometer, and gyroscope to suppress the accumulated errors. Then robust adaptive Kalman filter algorithm is proposed, which can identify and suppress the outliers to improve the stability and accuracy of the positioning system. Finally, the experimental platform with inertial sensors as is established, and the experimental results According to Figure 16, the experimental results performed in library are consistent with the results in laboratory. In some places where the requirements are not demanding, low-cost MEMS are recommended to be used, whose performance is reluctantly acceptable. However, in some demanding places, such as mines and fire rescue, it is recommended to use high-performance MEMS, which can provide accurate positioning using improved model proposed in this paper.

Conclusions
In this paper, an improved PDR positioning system based on pure inertial sensors is proposed. First of all, thanks to the development of MEMS-IMU, portable sensors can be carried around. In view of the low signal-to-noise ratio of inertial sensors, wavelet decomposition is used to pre-filter the inertial signals to improve the credibility of the data. In the PDR algorithm, the step estimation and the dynamic step length model are improved to obtain pedestrian's high precision step and step length. The heading estimation is the core of the PDR algorithm, whose subtle accumulation will seriously affect the accuracy of pedestrian positioning. In heading estimation algorithm, the complementary algorithm is firstly used to fuse magnetometer, accelerometer, and gyroscope to suppress the accumulated errors. Then robust adaptive Kalman filter algorithm is proposed, which can identify and suppress the outliers to improve the stability and accuracy of the positioning system. Finally, the experimental platform with inertial sensors as is established, and the experimental results demonstrate the feasibility and effectivity of the proposed PDR positioning system. Future research will be conducted to study the body kinematics model to improve the PDR algorithm. In addition, the accuracy of the PDR-based algorithm is closely related to the location of the MEMS-IMU is the focus of future research.

Conflicts of Interest:
The authors declare no conflict of interest.