# An Improved Particle Filter Algorithm for Geomagnetic Indoor Positioning

Authors: He Huang; Wei Li; De An Luo; Dong Wei Qiu; Yang Gao
Journal: Journal of Sensors
 (2018)

---

## Abstract

Geomagnetic indoor positioning is an attractive indoor positioning technology due to its infrastructure-free feature. In the matching algorithm for geomagnetic indoor localization, the particle filter has been the most widely used. The algorithm however often suffers filtering divergence when there is continuous variation of the indoor magnetic distribution. The resampling step in the process of implementation would make the situation even worse, which directly lead to the loss of indoor positioning solution. Aiming at this problem, we have proposed an improved particle filter algorithm based on initial positioning error constraint, inspired by the Hausdorff distance measurement point set matching theory. Since the operating range of the particle filter cannot exceed the magnitude of the initial positioning error, it avoids the adverse effect of sampling particles with the same magnetic intensity but away from the target during the iteration process on the positioning system. The effectiveness and reliability of the improved algorithm are verified by experiments.


---

## Body

## 1. Introduction

With the rapid development of location-based services, indoor positioning is receiving increased attention. Indoor positioning technology can be applied to public security, location tracking, intelligent transportation, and so forth. For example, a hospital can locate and monitor patients using indoor positioning technology. Indoor positioning can solve the problem of finding cars in large complexes and underground parking lots; it can also quickly find an optimal shopping route in large shopping malls. Indoor positioning is currently based on technologies such as Wi-Fi, RFID, Bluetooth, UMB, and geomagnetism. Among different technologies for indoor positioning, the geomagnetic indoor positioning approach has broad application prospects because it is infrastructure-free and has geomagnetic signal stability [1].As early as the 1950s, the geomagnetic positioning technology based on geomagnetic field vector matching was applied to large-scale outdoor environment navigation, including those of surface ships, submarines, and missiles. In the past, the geomagnetic positioning techniques typically used the correlation matching algorithms [2–4] or the recursive filtering algorithms [5, 6]. More recent use of the geomagnetic positioning technology in the indoor environment is considered an important breakthrough. The geomagnetic field in a modern building is disturbed by the steel-reinforced concrete, steel structure, power systems, electronic equipment, and other artificial sources, which forms a unique and spatially continuous geomagnetic signature [7, 8]. The indoor magnetic field can be collected to construct a fingerprint model based on Wi-Fi fingerprint technology. In general, the construction of geomagnetic perturbation fingerprint model can use a variety of characteristic variables, including a single variable (total geomagnetic intensity), double variables (H and V direction magnetic field components), or three variables (X, Y, and Z direction magnetic field components). The more characteristic variables are included for the position determination, the more improvement can be made on the positioning accuracy [9]. The indoor positioning technology based on the magnetic field matches the magnetic field intensity, which is obtained by the indoor moving carrier, with the geomagnetic disturbance fingerprint model to enable indoor positioning.At present, the particle filter algorithm,k-nearest neighbor [10], and extended Kalman filter (EKF) [11] have been applied in indoor positioning systems based on a fingerprint model. The particle filter developed by Monte Carlo techniques has been widely used as one effective matching algorithm, because of its advantages of broad adaptability in nonlinear and non-Gaussian systems [12–14]. Grand and Thrun [12] presented a real-time indoor localization method that utilizes a single 3-axis magnetometer to estimate the position of a handheld device. Using a particle filter, a localization accuracy of 0.7 meters in position and 25 degrees in orientation was achieved for a simple straight-line trajectory. Haverinen and Kemppainen [13] equipped a robot with a single magnetic sensor that measured three planes. They ran their robot through a corridor, had it collect data at a set of locations to create a map of the hallway, and used Monte Carlo localization (a particle filter) to accurately determine its location from any starting point. The maximum error was about 28 centimeters, but the robot needed to travel 25 meters in order to localize itself in general. Kim et al. [15] proposed an indoor positioning system using smartphones. They used a particle filter to estimate the users’ location based on geomagnetic anomalies [15] and used the distance between the user and the wall as a conditional constraint. The experimental results in the corridor showed that the positioning accuracy is within 3 meters.The use of particle filters requires the carrier to complete a continuous recursive filter location over a period of time, and it suffers the problem of filtering divergence [16]. The filter convergence however is affected by the distribution of indoor geomagnetic, and a divergence would occur if it lacks indoor geomagnetism signatures. The sparser the characteristics of the indoor geomagnetic field, as many locations have similar magnetic field patterns, the more likely the divergence of the particle filter algorithm occurs, which eventually leads to excessive positioning error.In response to this challenge, this paper proposes the use of point set matching in the Hausdorff distance measurement method to improve the particle filter algorithm as well as the method of positioning error constraints. In the new particle filter algorithm, the initial positioning error is used as the distance constraint, only allowing particles that meet the constraints to iterate, and resampling. Coupled with the convergence characteristics of the resampling step, we can suppress the effect of persistent divergence. The main contributions of this work include (1) the development of a geomagnetic data acquisition platform, (2) an improved particle filter algorithm to prevent filter divergence, and (3) the design of an offline test system to estimate the location of mobile robots carrying magnetic sensors.The paper is organized as follows. The classical particle filter algorithm is described in Section2.1. Section 2.2 briefly outlines the improved algorithm based on the Hausdorff distance. In Section 3, the data acquisition robot is first briefly described, then the data collection is presented, and finally the analysis of the positioning results is provided. The conclusion is given in Section 4.


## 2. An Improved Particle Filtering Algorithm

### 2.1. Classical Particle Filter Algorithm

The particle filter algorithm is an optimal Bayesian estimation method based on Monte Carlo’s idea [17]. It is often used to estimate the position of a target moving along the corridor from an unknown location. The particle filter uses Monte Carlo localization (MCL) method to approximate the posterior probability distribution pxt∣zt when it is too complex to directly sampled, but the prior probability density pxt∣xt−1i can be sampled and the measurement density pzt∣xti can be evaluated, where xt represents the target positioning, xti represents the particle positioning, and zt is the observation. The entire particle filtering process consists of three steps, namely, forecasting, updating, and resampling.The particle filter algorithm follows the general framework of a sequential importance sampling (SIS) algorithm, and it adds the sampling importance resampling (SIR) to solve the sample impoverishment caused by the iterative process. It first generates a set of samples withN particles from the prior probability density and then generates the weight wi according to the measurement density pzt∣xti of each particle. The weights are normalized to make their sum equal to one before the resampling. The basic idea of resampling is to remove particles with small weight and concentrate on particles with large weight. Due to easy implementation, the particle filter widely uses such resampling algorithm. The two-dimensional motion model is given by
(1)xti=xt−1i+Hl,where l∼U0,L, U0,L which obeys a uniform distribution; L is the moving distance; and
(2)H=sinθ00cosθ.In (2), θ is the moving direction. We can roughly choose the size of L according to the length of the person’s step. The measurement density pzt∣xti is based on the single variable Gaussian probability density function, which is given by
(3)pzt∣xti=1σr2πexp−zt−fxti22σr2,where σr is the covariance of the observation zt. The function fxti returns the magnetic field intensity of the position xti in the fingerprint model. Finally, the position x^t of the target is estimated based on the weight w of the sample particles, which is given by
(4)x^t=∑i=1Nwtixti,and the positioning error is given by
(5)err=xt−x^t2.For geomagnetic indoor positioning based on the particle filter, the particle weight is determined by (3) according to the magnetic field intensity of the target and particle in which the closer the geomagnetic intensity, the greater the weight. After removing the particles with the small weights, the estimated position is then calculated by (4). When the difference in the weight of the particle is not large, the deviation of the distance between the particle position xti and the target position is large [16]. If the particle position is far from the target position, the error between the estimated position and the target position is large. In other words, the estimated position is obtained by weighted sum of the individual particle positions. The greater the value of the Euclidean distance dh between the target and particles with large weight, the greater the value of x^t. Finally, it will cause greater positioning error as shown by (5). We have further explained it in Section 3.2 by an example.


### 2.2. An Improved Algorithm Based on Hausdorff Distance

Increasing the characteristic elements of the geomagnetic matching can effectively solve the divergence problem in the particle filter algorithm, but it will also greatly increase the complexity of the original algorithm and the time required for positioning. Inspired by the Hausdorff distance matching, an improved particle filter algorithm based on the Hausdorff distance is proposed and described in the following.We know that the magnetic field at any point is stable in the static environment and it is unique within a certain range. If the particle filter starts within a reasonable range, the deviation of estimated position will be reduced. The Hausdorff distance can then be applied to determine this reasonable range for the particle filter. The Hausdorff distance is the maximum value of the distance between the two sets of points in space which is defined as follows [4]:
(6)dHA,B=maxdhA,B,dhB,A,where dh represents the maximum distance between ai and bi in the two point sets of dhA,B=maxa∈Aminb∈Ba−b and dhB,A=minb∈Bmaxa∈Ab−a, • is a distance norm, A=a1,a2,…,ap and B=b1,b2,…,bq represent two finite sets of points. The Hausdorff distance represents the degree of matching between A and B.In general, in the geomagnetic feature matching based on classical particle filtering, we can control the weight of the particles that participate in calculating the estimated position in (4) when their weight becomes large. However, dh is difficult to control, once its value becomes too large. This will cause filtering divergence. Since dH is the maximum distance between each particle and the target, it can be controlled. As a result, if this maximum value can be controlled within a reasonable range, we can avoid the problem that dh becomes large. In order to avoid the effect of human factors, we use the positioning system to estimate the initial position of the target. The constraint to be applied is the initial positioning error between the estimated initial position and the true position of the target in the measurement environment. Let the initial positioning error as dH; the following initial positioning error constraint can be established:
(7)dh<dH.The positionx^t of the target estimated based on the weight w of the sample particles in (4) must satisfy the condition in (7). Using the improved particle filter algorithm, the divergence problem can be avoided because we have removed those particles that had a larger weight but were far from the target. As a result, the positioning results of the positioning system can converge more quickly. The implementation steps of the improved algorithm is given in Algorithm 1 and the flowchart of the implementation process is given in Figure 1.Algorithm 1
Step 1. Initialization:
t = 0, draw particles x0i uniformly with wi=1/N
Step 2. Calculate the positioning error:
t = 1, the initial positioning error is treated as the dH
Step 3. Particle iteration:
For time stepst = 1, 2, …
For particle numbersi = 1: N
IFdh<dH
The particle state is shifted:xti∼pxt∣xt−1i
Get mobile vector online observations:zt
Weight update:wti=pzt∣xti
END IF
END FOR
Step 4.
Make CDF ofwti and
For particle numbersi = 1: N
Drawui=U0,1
Resamplex~ti=CDFui
END FOR
Step 5. Output the weighted position:
x^t=∑i=1Nwtixti.Figure 1
Flowchart of improved particle filter algorithm.


## 2.1. Classical Particle Filter Algorithm

The particle filter algorithm is an optimal Bayesian estimation method based on Monte Carlo’s idea [17]. It is often used to estimate the position of a target moving along the corridor from an unknown location. The particle filter uses Monte Carlo localization (MCL) method to approximate the posterior probability distribution pxt∣zt when it is too complex to directly sampled, but the prior probability density pxt∣xt−1i can be sampled and the measurement density pzt∣xti can be evaluated, where xt represents the target positioning, xti represents the particle positioning, and zt is the observation. The entire particle filtering process consists of three steps, namely, forecasting, updating, and resampling.The particle filter algorithm follows the general framework of a sequential importance sampling (SIS) algorithm, and it adds the sampling importance resampling (SIR) to solve the sample impoverishment caused by the iterative process. It first generates a set of samples withN particles from the prior probability density and then generates the weight wi according to the measurement density pzt∣xti of each particle. The weights are normalized to make their sum equal to one before the resampling. The basic idea of resampling is to remove particles with small weight and concentrate on particles with large weight. Due to easy implementation, the particle filter widely uses such resampling algorithm. The two-dimensional motion model is given by
(1)xti=xt−1i+Hl,where l∼U0,L, U0,L which obeys a uniform distribution; L is the moving distance; and
(2)H=sinθ00cosθ.In (2), θ is the moving direction. We can roughly choose the size of L according to the length of the person’s step. The measurement density pzt∣xti is based on the single variable Gaussian probability density function, which is given by
(3)pzt∣xti=1σr2πexp−zt−fxti22σr2,where σr is the covariance of the observation zt. The function fxti returns the magnetic field intensity of the position xti in the fingerprint model. Finally, the position x^t of the target is estimated based on the weight w of the sample particles, which is given by
(4)x^t=∑i=1Nwtixti,and the positioning error is given by
(5)err=xt−x^t2.For geomagnetic indoor positioning based on the particle filter, the particle weight is determined by (3) according to the magnetic field intensity of the target and particle in which the closer the geomagnetic intensity, the greater the weight. After removing the particles with the small weights, the estimated position is then calculated by (4). When the difference in the weight of the particle is not large, the deviation of the distance between the particle position xti and the target position is large [16]. If the particle position is far from the target position, the error between the estimated position and the target position is large. In other words, the estimated position is obtained by weighted sum of the individual particle positions. The greater the value of the Euclidean distance dh between the target and particles with large weight, the greater the value of x^t. Finally, it will cause greater positioning error as shown by (5). We have further explained it in Section 3.2 by an example.


## 2.2. An Improved Algorithm Based on Hausdorff Distance

Increasing the characteristic elements of the geomagnetic matching can effectively solve the divergence problem in the particle filter algorithm, but it will also greatly increase the complexity of the original algorithm and the time required for positioning. Inspired by the Hausdorff distance matching, an improved particle filter algorithm based on the Hausdorff distance is proposed and described in the following.We know that the magnetic field at any point is stable in the static environment and it is unique within a certain range. If the particle filter starts within a reasonable range, the deviation of estimated position will be reduced. The Hausdorff distance can then be applied to determine this reasonable range for the particle filter. The Hausdorff distance is the maximum value of the distance between the two sets of points in space which is defined as follows [4]:
(6)dHA,B=maxdhA,B,dhB,A,where dh represents the maximum distance between ai and bi in the two point sets of dhA,B=maxa∈Aminb∈Ba−b and dhB,A=minb∈Bmaxa∈Ab−a, • is a distance norm, A=a1,a2,…,ap and B=b1,b2,…,bq represent two finite sets of points. The Hausdorff distance represents the degree of matching between A and B.In general, in the geomagnetic feature matching based on classical particle filtering, we can control the weight of the particles that participate in calculating the estimated position in (4) when their weight becomes large. However, dh is difficult to control, once its value becomes too large. This will cause filtering divergence. Since dH is the maximum distance between each particle and the target, it can be controlled. As a result, if this maximum value can be controlled within a reasonable range, we can avoid the problem that dh becomes large. In order to avoid the effect of human factors, we use the positioning system to estimate the initial position of the target. The constraint to be applied is the initial positioning error between the estimated initial position and the true position of the target in the measurement environment. Let the initial positioning error as dH; the following initial positioning error constraint can be established:
(7)dh<dH.The positionx^t of the target estimated based on the weight w of the sample particles in (4) must satisfy the condition in (7). Using the improved particle filter algorithm, the divergence problem can be avoided because we have removed those particles that had a larger weight but were far from the target. As a result, the positioning results of the positioning system can converge more quickly. The implementation steps of the improved algorithm is given in Algorithm 1 and the flowchart of the implementation process is given in Figure 1.Algorithm 1
Step 1. Initialization:
t = 0, draw particles x0i uniformly with wi=1/N
Step 2. Calculate the positioning error:
t = 1, the initial positioning error is treated as the dH
Step 3. Particle iteration:
For time stepst = 1, 2, …
For particle numbersi = 1: N
IFdh<dH
The particle state is shifted:xti∼pxt∣xt−1i
Get mobile vector online observations:zt
Weight update:wti=pzt∣xti
END IF
END FOR
Step 4.
Make CDF ofwti and
For particle numbersi = 1: N
Drawui=U0,1
Resamplex~ti=CDFui
END FOR
Step 5. Output the weighted position:
x^t=∑i=1Nwtixti.Figure 1
Flowchart of improved particle filter algorithm.


## 3. Experiments and Analysis

### 3.1. Data Collection System Development: A Geomagnetic Data Acquisition Robot

The construction of a geomagnetic fingerprint model is a prerequisite for geomagnetic indoor positioning technology. In order to quickly and effectively establish a fingerprint model, a data acquisition robot has been developed by Urban Surveying and Mapping Institute which includes data acquisition module and control module as shown in Figure2 [18]. The robot is loaded with a HMC5983 three-axis magnetic sensor placed at a height of 1.3 meters above the floor. The placement of sensor at such a height is to separate the magnetic sensor to avoid interference by the robot itself. The robot is controlled by the control module. Data through the USB cable real-time are imported to the computer, through openMAT software to save geomagnetic data and record, while the magnitude was calculated. Finally, we use the MATLAB-based software to conduct position determination in the computer. Since the magnetic sensor itself will produce a relatively stable interference field when energized [19], we must correct the HMC5983 magnetic sensor in the data acquisition module to ensure the authenticity of the data before collecting data. The rotation of the magnetic sensor around the z-axis of its own coordinate system will generate the corresponding circle based on the magnitude of the x-axis and the y-axis magnetic field. However, due to the presence of an interference field, the location of the center of the circle will move a short distance. The interference can be eliminated by adding a fixed value to the output value of the magnetic sensor, as shown in Figure 3.Figure 2
Geomagnetic data acquisition robot platform. (a) Front view. (b) Bottom view.
(a)
(b)Figure 3
Comparison of magnetic field values after magnetic sensor compensation.The method to correct the valuexsf,ysf of the HMC5983 magnetic sensor and the x-axis and y-axis magnetic field offset xoff,yoff is given as follows:
(8)xsf=max1,ymax−yminxmax−xmin,ysf=max1,xmax−xminymax−ymin,xoff=xmax−xmin2−xmaxxsf,yoff=ymax−ymin2−ymaxysf,xυ=hxxsf+xoff,yυ=hyysf+yoff,where xmax,xmin and ymax,ymin are the maximum and minimum values, respectively; hx,hy is the original magnetic field value on the x-axis and y-axis; and xυ,yυ is the compensation of the x-axis and y-axis direction of the magnetic field value.


### 3.2. Experimental Data Collection and Fingerprint Model Construction

The experimental data acquisition was conducted in the 2nd floor of the Institute of Surveying and Mapping at Beijing University of Civil Engineering and Architecture (BUCEA). The frames of the building are reinforced concrete. Figure4 shows a simple plan of the corridor with a total length of 68 meters. The magnetic field was measured every 25 Hz producing a three-dimensional vector m=mx,my,mz, in units of μT.Figure 4
Floor map of the Institute of Surveying and Mapping.In order to prove the defect of particle filter algorithm, we randomly collected a row of data in the corridor. Figure5 shows the magnetic field distribution in the corridor which is linear and continuous, and the magnetic field intensity of different locations is likely to be the same. This proves that when the particle position xti is far from the target, it will lead to biased estimate x^t in the particle filter algorithm. An example is shown in Figure 6.Figure 5
Distribution of the magnitude of the magnetic field in a row of the corridor. Blue spots indicate points with the same magnetic field intensity.Figure 6
According to (4), we find that if the w of number 1 is the same as that of number 2, but the distance between number 1 and the true position is very far, will cause the estimated position away from the true position.In the corridor, we collected geomagnetic data along four lines of 60 cm apart. For building the fingerprint model, we control the acquisition robot along the planned route to move forward which the step length of robot is 0.2 m with geomagnetic data measurement at a sampling rate of 5 Hz. To perform localization, we use the norm of the magnetic fieldm=mx,my,mz as the observation, because magnetic field intensity m is a rotation invariant scalar quantity. The m is given by
(9)m=mx2+my2+mz2.The final fingerprint model is created by applying a linear interpolation to the magnetic field intensity using a 0.02 m step size in the computer, as shown in Figure7, and the map adds the grid coordinates as its relative coordinate frame after it is generated.Figure 7
Geomagnetic fingerprint model. Straight-line AB is any one row of the corridors.


## 3.1. Data Collection System Development: A Geomagnetic Data Acquisition Robot

The construction of a geomagnetic fingerprint model is a prerequisite for geomagnetic indoor positioning technology. In order to quickly and effectively establish a fingerprint model, a data acquisition robot has been developed by Urban Surveying and Mapping Institute which includes data acquisition module and control module as shown in Figure2 [18]. The robot is loaded with a HMC5983 three-axis magnetic sensor placed at a height of 1.3 meters above the floor. The placement of sensor at such a height is to separate the magnetic sensor to avoid interference by the robot itself. The robot is controlled by the control module. Data through the USB cable real-time are imported to the computer, through openMAT software to save geomagnetic data and record, while the magnitude was calculated. Finally, we use the MATLAB-based software to conduct position determination in the computer. Since the magnetic sensor itself will produce a relatively stable interference field when energized [19], we must correct the HMC5983 magnetic sensor in the data acquisition module to ensure the authenticity of the data before collecting data. The rotation of the magnetic sensor around the z-axis of its own coordinate system will generate the corresponding circle based on the magnitude of the x-axis and the y-axis magnetic field. However, due to the presence of an interference field, the location of the center of the circle will move a short distance. The interference can be eliminated by adding a fixed value to the output value of the magnetic sensor, as shown in Figure 3.Figure 2
Geomagnetic data acquisition robot platform. (a) Front view. (b) Bottom view.
(a)
(b)Figure 3
Comparison of magnetic field values after magnetic sensor compensation.The method to correct the valuexsf,ysf of the HMC5983 magnetic sensor and the x-axis and y-axis magnetic field offset xoff,yoff is given as follows:
(8)xsf=max1,ymax−yminxmax−xmin,ysf=max1,xmax−xminymax−ymin,xoff=xmax−xmin2−xmaxxsf,yoff=ymax−ymin2−ymaxysf,xυ=hxxsf+xoff,yυ=hyysf+yoff,where xmax,xmin and ymax,ymin are the maximum and minimum values, respectively; hx,hy is the original magnetic field value on the x-axis and y-axis; and xυ,yυ is the compensation of the x-axis and y-axis direction of the magnetic field value.


## 3.2. Experimental Data Collection and Fingerprint Model Construction

The experimental data acquisition was conducted in the 2nd floor of the Institute of Surveying and Mapping at Beijing University of Civil Engineering and Architecture (BUCEA). The frames of the building are reinforced concrete. Figure4 shows a simple plan of the corridor with a total length of 68 meters. The magnetic field was measured every 25 Hz producing a three-dimensional vector m=mx,my,mz, in units of μT.Figure 4
Floor map of the Institute of Surveying and Mapping.In order to prove the defect of particle filter algorithm, we randomly collected a row of data in the corridor. Figure5 shows the magnetic field distribution in the corridor which is linear and continuous, and the magnetic field intensity of different locations is likely to be the same. This proves that when the particle position xti is far from the target, it will lead to biased estimate x^t in the particle filter algorithm. An example is shown in Figure 6.Figure 5
Distribution of the magnitude of the magnetic field in a row of the corridor. Blue spots indicate points with the same magnetic field intensity.Figure 6
According to (4), we find that if the w of number 1 is the same as that of number 2, but the distance between number 1 and the true position is very far, will cause the estimated position away from the true position.In the corridor, we collected geomagnetic data along four lines of 60 cm apart. For building the fingerprint model, we control the acquisition robot along the planned route to move forward which the step length of robot is 0.2 m with geomagnetic data measurement at a sampling rate of 5 Hz. To perform localization, we use the norm of the magnetic fieldm=mx,my,mz as the observation, because magnetic field intensity m is a rotation invariant scalar quantity. The m is given by
(9)m=mx2+my2+mz2.The final fingerprint model is created by applying a linear interpolation to the magnetic field intensity using a 0.02 m step size in the computer, as shown in Figure7, and the map adds the grid coordinates as its relative coordinate frame after it is generated.Figure 7
Geomagnetic fingerprint model. Straight-line AB is any one row of the corridors.


## 4. Positioning Results

The acquisition robot used to take measurements was controlled to travel straight along the corridor, with a step length of 0.6 m. It recorded data every second, iteration timest = 16. In the positioning system, the number of sample particles N is set to 400; each test set was conducted using the same value of the standard deviation of the measurement model σr=5.0μT, and a total of 20 time tests. The SIS algorithm and the particle filter algorithm with the SIR algorithm are used to investigate the geomagnetic matching precision and the degree of continuous filtering divergence.The burr in Figure8 shows that the SIS algorithm has the problem of filtering divergence and geomagnetic matching instability in the geomagnetic matching process. Although the positioning error shows an overall decreasing trend, there is no convergence.Figure 8
Positioning error based on SIS algorithm.As shown in Figure9, the addition of the SIR algorithm makes the filtering divergence more serious, and the continuous filtering divergence phenomenon results in the loss of positioning (see ①, ②, ③ in Figure 9). Most of the experiments began to converge after t = 5. The average matching accuracy was 1.78 m and the average run time was 10.9 s. We can see from the comparison of Figures 8 and 9 that after the SIR algorithm is added, the particle is convergent after iteration calculation for a period of time due to its resampling step. The matching accuracy is far superior to that of the SIS algorithm, although positioning loss is also inevitable.Figure 9
Positioning error based on particle filter algorithm with the SIR.The idea of the positioning error constraint method is shown in Figures10 and 11. In Figure 10, the dots indicate the sample particles that are randomly selected in the positioning area; the hollow circle represents the initial position of the weighted position and the ∗ sign indicates the position of the moving carrier at time t = 1. In Figure 11, the circle which is deformed due to the limitation of the geomagnetic fingerprint model range represents the initial positioning error range. It can be concluded from Figures 10 and 11 that with the establishment of the positioning error constraint after the initial positioning, the sampling particles have a restriction on their maximum distance dH. It does not use the particles which are far from the true location of target in the positioning process. Due to the reduction in the number of particles, the time of the whole system iterating 16 times is saved (the average running time is 9.1 s).Figure 10
Initial positioning oft = 1.Figure 11
Positioning error constraint.Figure12 shows that the initial positioning errors are all within 10 m, which is acceptable for indoor positioning. The experimental results and the positioning error analysis based on the improved particle filter algorithm are shown in Figure 13. In the experiments using the improved algorithm, most particles began to converge at t = 2 and have no loss of positioning as in Figure 9, with an average matching accuracy improved to 0.62 meters. Compared to the particle filter with the SIR algorithm, the improved algorithm can effectively prevent the filter divergence, eliminating location losses. Its convergence rate is faster than that of the classic particle filter algorithm, with an average running time of the whole system iterating 16 times is reduced by 16.15%.Figure 12
Initial positioning errors. Maximum value: 8.81 m, average value: 7.30 m, and minimum value: 5.10 m.Figure 13
Positioning errors based on improved algorithm.


## 5. Conclusions and Future Work

Indoor geomagnetic disturbance prevents the classical particle filter algorithm from stably finding the location in real time. Although the particle filter algorithm has a strong convergence in the matching accuracy, the particle iteration process is accompanied by the loss of positioning. In this paper, we add the position error constraint to the particle filter algorithm and compare and analyze the advantages and disadvantages of the classical particle filter algorithm with the improved algorithm in matching accuracy, running time, and other aspects by real-field test. The results show that the improved algorithm can solve the persistent divergence problem in the particle filter and avoid the loss of positioning. Under the premise of the single variable feature, it can improve the indoor positioning speed and effectively solve the technical defect in geomagnetic matching. In the future work we will try to combine WLAN and other technologies to achieve effective initial positioning accuracy better than 5 meters.



---

*Source: 5989678-2018-03-19.xml*