Indoor Magnetic Signature Based Localization Algorithm without Person-Dependent Parameter Calibration

Location-dependent differences of ambient magnetic fields inside a building can be used to estimate location. In this paper, an inertial/magnetic sensor is attached to a belt position and its location is estimated using the ambient magnetic field. The walking distance is estimated using the linear relationship between the walking step length and the maximum acceleration during the step. The magnetic field data during walking is compared with a pre-collected magnetic signature. In this process, calibration steps are required for two person-dependent parameters : the walking step length estimation parameter and the hard iron parameter. An adaptive algorithm is proposed, in which these person-dependent parameters are estimated in addition to the location. Thus no person-dependent parameter calibration process is required. Through experiments, it is shown that the location and parameters are estimated accurately.


Introduction
Recently much attention has been paid to indoor navigation [1], where a person's location is estimated in an indoor environment. The main applications of an indoor navigation algorithm are for first responders [2], handicapped people [3] and entertainment [4].
Techniques for indoor navigation can be divided into two groups. One is an inertial sensor-based method, which provides relative position by estimating heading and walking distance [5][6][7][8]. The main advantage of this method is that it does not require any infrastructure in the environment or prior knowledge of it. The main disadvantage is that only the relative position is provided and its position error becomes larger over time.
The other techniques are methods that require infrastructure in the building or prior knowledge of it. In [9], wireless signals are used to estimate the absolute location in the building. In [3,10,11], location-to-location variation of the magnetic field has been used to estimate position. The main advantage of this method is that it provides the absolute position and its position error is bounded. The main disadvantage is that it requires full knowledge of the indoor environment and it could be sensitive to wireless or magnetic disturbances.
Many practical navigation algorithms have tried to combine inertial sensor-based navigation algorithms with an absolute positioning method to compensate for each method's weakness [11,12]. In the combined algorithms, the inertial navigation algorithm is usually the primary navigation algorithm. The error accumulation of the inertial navigation algorithm is prevented by using an absolute positioning method. Compared with an absolute positioning only method, it requires less thorough knowledge of the indoor environment: if a person is in areas with no knowledge of the environment, the location can still be estimated using the inertial navigation algorithm.
Inertial sensor-based algorithms can be classified into two groups: one is using the inertial navigation algorithm to accurately estimate the position using an inertial sensor unit attached on a shoe [6]. The movement of the foot is estimated using an inertial navigation algorithm providing the three dimensional location. The other group roughly estimates walking length based on the output of accelerometer [8]. The accelerometer output can be used to detect how many steps a person has walked from the fact that one step walking length is related to one step walking time and the maximum acceleration (due to shock when a foot touches the ground). For example, it is known that one step walking length is proportional to the maximum acceleration during the walking step.
Although the first algorithm provides much more accurate position estimation, we used the latter algorithm since the inertial sensor location is not limited to the shoe. We note that inertial sensors should be placed on a shoe in the first algorithm to take advantage of zero velocity updating [13], where the velocity error is compensated using the fact that the velocity is zero when the foot is on the ground. Also, a cheaper accelerometer can be used in the latter algorithm.
Due to iron and other material, magnetic fields inside a building are not the same in different locations [14]. We measure and record magnetic field inside a building (this data is called magnetic signature data). When a person is walking inside a building, the measured magnetic field during walking (using three axis magnetic sensor) can be compared with the magnetic signature data to estimate the location. There are many algorithms that use this magnetic signature. They differ in regard to whether one-point data or multiple-point data are used, and whether the norm or the direct value of the sensor is used.
In [10], a one-dimensional location estimation problem has been considered both for a mobile robot and people. One-point magnetic sensor data was used in the measurement equation of a particle filter, where both the direct sensor value and norm value are tested. It was shown that the direct sensor value gives a better result. In [11], two dimensional location estimation problem was considered for people. A particle filter and one-point magnetic sensor data was used. In [3], multiple-point norms of magnetic sensor values are used to estimate a person's one-dimensional location. Magnetic signature data was collected at certain distance intervals. Magnetic sensor data during walking has also been collected at certain time intervals, where distance information is not known perfectly. This distance uncertainty was resolved using the dynamic warping method [15].
In previous studies, two parameters had to be obtained for each person. One parameter is a magnetic-related parameter due to magnetic elements in clothing, belt, and other items such as keys. This parameter is different for each person. Usually, to identify this magnetic parameter, a procedure of moving a magnetic sensor in a certain pattern is required (for example, a figure eight pattern) [16,17]. When a sensor is attached to the body, it is not always easy to move in a predetermined pattern. The other parameter is related to inertial sensor values and walking distance. Since walking pattern and style are different for each person, this parameter is also person-dependent [18]. To identify this walking parameter, a person needs to walk some known length (for example, using the method in [19]).
If the magnetic parameter is unknown, it is not easy to apply existing methods ( [3,10,11]) for location estimation since the measured magnetic sensor data is corrupted by person-dependent magnetic elements. Thus the estimation accuracy using the magnetic signature becomes poor.
If the walking parameter is unknown, the walking distance is inaccurately estimated. Walking distance estimation is important because it is necessary for comparison between magnetic signature data (in which the distance between sampling points is exactly known) and the measured magnetic data during walking (in which the distance between the sampling points is estimated based on the walking distance estimation). Additionally, the location must be estimated using the walking distance when the magnetic signature is not available.
We propose an improved location estimation algorithm using the magnetic signature and assuming that we have the magnetic signature information about a building. The main merit of the proposed method is that it does not require any person-dependent calibration procedure. The two parameters are identified by the algorithm automatically, making the person-dependent calibration unnecessary. To the best of our knowledge, there has been no attempt to identify both parameters using magnetic signature information. The identification of the walking parameter is related to dynamic time warping techniques in [15], where walking distance is estimated. We note that walking parameter identification is not considered in [15].

Problem Formulation
The location estimation problem in a one-dimensional corridor is considered (see Figure 1). The corridor is divided into N cell cells, where G is the length of one cell. The location is represented by the cell number m.
Two coordinate frames are considered: the navigation coordinate system and the body coordinate system. The z axis of the navigation coordinate system is assumed to coincide with the local gravitation direction (the z axis is in the upward direction). The x axis of the navigation coordinate system coincides with the right direction of the corridor (see Figure 1). The 3 axes of the body coordinate system coincide with the 3 axes of the sensor unit. The magnetic field data at the center of each cell is measured (see Figure 2). The magnetic sensor is located on top of a 93 cm plastic bar (to avoid magnetic disturbance from the bar) and 10 s data (100 samplings per second) are recorded. The average value is used as the magnetic signature for the cell. The symbol z sig,m ∈ R 3 denotes the magnetic signature of the m-th cell. The three axes of the sensor during signature data measurement coincide with the three axes of the navigation coordinate system (see Figure 2). Thus z sig,m is the magnetic field of the m-th cell expressed in the navigation coordinate system. The magnetic signature data is compared with the magnetic data during walking to estimate the location. A person carries an inertial/magnetic sensor unit (XSens MTi sensor) on the belt (see Figure 3). The belt location is chosen since the attitude of the sensor unit is almost constant during walking. In the proposed method, the attitude change must be small, or else our modeling (1) in Section 3 would not be valid. Thus a sensor unit could be attached on a belt or the chest. The proposed algorithm cannot be used for a sensor unit on a cell phone since its attitude change during walking is large if a person is holding the phone. The sensor unit consists of 3 axis accelerometers, 3 axis gyroscopes and 3 axis magnetic sensors. The accelerometers are used to estimate walking step length and the magnetic sensors are used to estimate heading (using the earth's magnetic field) and specific location (using the location-specific magnetic signature). Gyroscopes are not used since the proposed algorithm does not require them. If an attitude/heading estimation algorithm or an inertial navigation algorithm were combined with the proposed algorithm, a gyroscope could contribute to enhance the accuracy.

Segment-Based Location Estimation Using Magnetic Signature Data
Suppose a person is standing at the center of the m-th cell and let y m be the measured magnetic data from the sensor attached to the body. In general, the measured value y m is different from the magnetic signature data z sig,m although they are measured at the same location.
The relationship between y m and z sig,m can be approximated by the following equation: where C ∈ R 3×3 is the rotation matrix and h ∈ R 3 represents the hard iron effect due to magnetized iron (such as steel parts in clothing or keys) or a magnetic source (such as a cell phone or a computer). The vector h is a person-dependent parameter since clothes and carried items are different for each person.
When h = 0, y m is the magnetic field of the m-th cell expressed in the body coordinate system (recall that z sig,m is the same vector expressed in the navigation coordinate system). Thus rotation matrix C represents the rotation between the navigation coordinate system and the body coordinate system. In existing studies [3,10,11], it is assumed that h is known in advance through the calibration process. Once h is known, we have the following from the fact that C is an orthogonal matrix: Equation (2) is used to compare y m and z sig,m in existing studies. An algorithm, which does not require prior knowledge of h, is proposed. Since it is difficult to estimate the location using only one magnetic data, a number of magnetic data are grouped into a segment, which is compared with the magnetic signature data. Suppose a person walked a distance (N seg − 1)G, where N seg is a positive integer. Let y seg,i ∈ R 3 (1 ≤ i ≤ N seg ) be the magnetic data obtained during walking, where y seg,i is the magnetic sensor data obtained when the walking length is (i − 1)G. Thus y seg,i is magnetic data obtained at equally spaced locations along the walking path. We call {y seg,i } a magnetic data segment during walking. The way to obtain this segment is explained in Section 4. Here we just note that the segment value depends on a person-dependent walking-related parameter α and thus y seg,i (α) notation is used to emphasize the dependency on α. Also note that y seg,1 is the starting point. If a person is walking to the right direction, y seg,1 is the magnetic data obtained at the leftmost position of the segment. If a person is walking to the left direction, y seg,1 is the magnetic data obtained at the rightmost position of the segment.
We want to know the location of this segment on the corridor cells (see Figure 4). For this purpose, we introduce the performance index f (m, α, direction): where C is the rotation matrix, h ∈ R 3 is the magnetic disturbance vector and w i is a positive weighting factor. If the segment location (the leftmost position of the segment) is the m-th cell, f (m, α, direction) is small assuming α is the correct walking parameter. Thus the location estimation problem can be solved by minimizing f (m, α, direction) over 1 ≤ m ≤ N cell − N seg + 1. This approach sometimes could give a wrong answer since f (m, α, direction) could be small even if the segment location is not the m-th cell. As a fail-safe measure, we check whether the computed C in Equation (3) satisfies the assumption that the attitude change is small in Equation (1), and the process is given in Equations (4)- (7).
Suppose a person is standing before starting to walk. Let y a,init ∈ R 3 be the accelerometer output of the sensor attached to the body. Then, there is no external acceleration since there is no movement. Thus, y a,init only contains the gravitational acceleration: where g earth is the gravitational acceleration. Let b z be the unit vector in the direction of y a,init : b z = y a,init ∥y a,init ∥ Note that b z is computed from y a,init , which can be obtained if a person stands for 1 to 2 seconds before starting to walk. For example, consider the body coordinate system in Figure 3. In this case, b z becomes the x axis unit vector of the body coordinate system. During walking, the b z direction maintains the upward direction. Thus the following can be assumed: where C is the rotation matrix from Equation (3). The similarity of two unit vectors in Equation (5) is tested by measuring the angle between them. The angle θ between the vectors a ∈ R 3 and b ∈ R 3 can be computed by Thus the two vectors are similar if a ′ b is large (that is, if θ is small). Using Equation (6), we introducef (m, α) where γ 1 is a positive threshold value. Now the segment location can be estimated by minimizingf (m, α, direction). We note that the minimizing m still may not be the correct position although it rarely happens. We introduce a quantitative index g(α, direction) representing the confidence of the estimated location by minimizing Equation (7).
The coefficients a 1 , b 1 , a 2 and b 2 are all positive. Note that g(α, direction) is small if the absolute and relative (with respect to the second minimum value) minimum values are small. In this case, it is more likely that the minimizing m is the true cell position. g(α, direction) plays a similar role as the estimation error covariance of the estimated cell position and g is called a pseudo error covariance. In the minimization process, we also compute C and h in Equation (3). If g(α, direction) is small, the computed C and h are generally more accurate.
In the minimization off , we have to find C (rotation matrix) and h in Equation (3). This minimization problem is often encountered in computer vision problems. There is an analytic solution to compute C and h and the result [20] is given in Lemma 1.
The rotation matrix C and a translation vector h ∈ R 3 satisfying are given by Orthogonal matrices U and V are from the singular value decomposition of S: Using Lemma 1, we can compute C and h in Equation (3) easily, and instead of using a numerical optimization, C and h are given in the closed-form. The singular value decomposition of a 3 × 3 matrix, which is easy to compute, is the most computationally demanding part. Thus the computational cost of finding C and h in Equation (3) is small. This is important since Equation (3) is used as an inner algorithm in Equations (3) and (14) thus is computed many times.
In Equation (9), n should be at least 2. Otherwise, the problem becomes underdetermined and there are infinitely many solutions. Thus N seg in Equation (3) should be at least 2. This number is the minimum when there is no magnetic noise (sensor noise and temporary magnetic disturbances). N seg should be much larger (practically, at least 5) to obtain a reliable solution.

Segment Data Generation
In this section, the generation of segment data y seg,i (used in Section 3) is explained. In Figure 5, a typical plot of the norm of the accelerometer output during walking is given. It is not difficult to identify each walking step from the norm data. Let y a,max,j be the maximum norm value of the j-th walking step and T j be the walking time. It is known that the walking length of the j-th step is proportional to y a,max,j [8]. Thus walking length l j for each step can be estimated using the following formula: where α is a person-dependent parameter satisfying the following: where α min and α max can be determined from experiments on a number of people. Equation (10) is not a new result and there are many similar algorithms [21]. Since the walking distance estimation algorithm is not the main topic of this paper, any other algorithms can be used.
A walking segment consists of several walking steps. Whenever the walking direction change is larger than a certain threshold value, a new segment is formed. Thus a segment consists of almost straight line walking data. To prevent the segment length from becoming too long, a new segment is formed if the segment length is larger than a certain threshold value. A new segment is formed if the following are not satisfied (γ 2 and γ 3 are positive parameters): • Segment not too long ∑ y a,max,j < γ 3 The segment index is denoted by k and the number of walking steps in the k-th segment is denoted by M k . With j denoting the walking step index, the walking step interval k 1 ≤ j ≤ k M k is assumed to belong to the k-th segment. Figure 6. y seg,i generation: (1,7), (2,6) and (3,5) are the same graph drawn twice for the explanation.
Note that y seg,i and y seg,i+1 are two magnetic data obtained at positions with distance G. Using the computed l j , y seg,i data is constructed as follows (see Figure 6).
• Steps 1-3: Using accelerometer data, walking step length l j is computed for each walking step j using Equation (10).
• Steps 4-5: Based on the computed l j , the walking path is divided into positions with equal spacing (by length G). • Steps 6-7: Using a simple interpolation algorithm, the time instances corresponding to these equally spaced positions are computed. The magnetic sensor data at these time instances are denoted by y seg,i .

Proposed Location Estimation Algorithm
In this section, a location estimation algorithm using the results in Sections 3 and 4 is provided. Let m k ,α k andĥ k be the estimated values of m, α and h after the k-th segment data is processed. Let P k ∈ R be a pseudo estimation error covariance (see the discussion for Equation (8)) after the k-th segment data is processed. A small P k value means thatm k is more accurate.

Initialization
When a sensor is installed on a person for the first time, we do not have any information on α and h. If h is unknown, it is not possible to determine the walking direction. In this case, initial values of α and h should be found in addition to the location m . The location and initial value estimation problem can be formulated as a minimization problem over all possible combinations of parameters: wheref * is the minimum value. Let m * , h * , C * and α * be the minimizing parameters. The direction (right or left) and m are discrete parameters. The continuous parameter α can be discretized in the minimization problem with the discretization interval ∆α: that is, discrete values α min , α min + ∆α, α min + 2∆α, · · · , α max are used in the minimization of Equation (14).
In the minimization problem, the direction is determined and the initial values of α and h are given. If the value g (see Equation (8)) is larger than a threshold value γ 4 , the result is not used. We then proceed to the next segment to determine the initial values.
Suppose the minimization problem is solved for the first walking segment. Thenα 1 ,ĥ 1 and P 1 are given byα where direction * represents the determined direction (right or left). Symbolsα k andĥ k denote the estimated values of α and h using the segment data up to the k-th segment.

Walking Direction Determination after the Initialization
Suppose we have segment magnetic data y seg,i (1 ≤ i ≤ N seg ) for a new segment. From Equation (1), we know that (assuming y seg,i is measured on the m + i − 1-th cell) where C, h and m are unknown.
In the initialization step, we obtainedĥ 1 = h * andĈ 1 = C * . We can assume that h does not change much during walking. The rotation matrix C could take two values. If the direction of the current segment is the same as that of the first segment, the rotation matrix C is given by If the direction is opposite, the rotation matrix C can be obtained by rotating the z axis of the body coordinate system in the first segment by π rad along the b z axis (since a person has turned π rad along this axis): where C(b z , π) is the rotation matrix representing a π rad rotation along the b z axis [22]. Thus from Equations (15)- (17), we have Since m is unknown, we cannot use z sig,m+i−1 in Equation (18). Instead, the mean value of z sig,i is used. Let z sig,mean and y seg,mean be defined by Based on the preceding observation, the direction determination algorithm is summarized as follows: • The direction is determined as the same direction with the first segment if the following is satisfied ∥y seg,mean −Ĉ 1 z mean +ĥ 1 ∥ ≤ min(γ 5 , ∥y seg,mean − C(b z , π)Ĉ 1 z mean +ĥ 1 ∥) (19) where γ 5 is a positive parameter. • The direction is determined as the opposite direction to the first segment if the following is satisfied • The direction is undetermined if neither Equation (19) nor Equation (20) is satisfied. In this case, the method in the initialization step should be used.
We note thatĥ k−1 andĈ k−1 (which are generally more accurate) could be used for the k-th segment instead ofĥ 1 andĈ 1 .

Location Estimation Algorithm for k-th Walking Segment
Suppose the location is estimated up to the k − 1-th segment and we have computedα k−1 ,ĥ k−1 and P k−1 . The location estimation algorithm for the k-th walking segment is explained.
• The direction is estimated using the method in Section 5.2.
• The position (m) and α are estimated using the following optimization problem: • Let α * k , h * k , C * k and m * k be the minimizing solution and g * k be the g value at the minimizing solution. •α k ,ĥ k ,Ĉ k and P k are updated as follows: In Equation (22),α k−1 is the estimated value of α based on up to the k − 1-th segment while α * k is the estimated value of α based on the k-th segment. If P k−1 and g * k are the estimation error covariances ofα k−1 andα * k , thenα k in Equation (22) is the optimal estimate and P k becomes the estimation error covariance ofα k [23]. Similar logic applies toĥ k . Since P k−1 andĝ * k are not the covariances, the computedα k is just a suboptimal estimate (lacking theoretical justification) and P k is not the estimation error covariance.
Some comments are given for the computational aspects of Equation (14). The computation off depends on c 1 N seg + c 2 , where c 1 and c 2 are constants. To solve Equation (21),f should be computed for all possible combinations. Thus the computation of Equation (21) The largest number in Equation (23) is N gird , which is proportional to 1/G. Thus the computational cost is inversely proportional to the cell size G.

Experiments
Experiments were done on the 4th floor of building 7 in the University of Ulsan. In the corridor, there are floor lines forming cells with approximately the same size (see Figure 7). There are a total of 60 cells (N cell = 60) and the total length is 89.7 m (the average length of each cell is 1.495 m). Magnetic signature data z sig,m is recorded using the procedure in Section 2. The norm of z sig,m is given in Figure 8. It can be seen that there are significant location-to-location variations. To see the magnetic signature variation in the vector form, x and y elements of z cal,m are given in the left graph of Figure 9 and x and z elements of z cal,m are given in the right graph. Each vector represents the vector element of z cal,m in a cell, where location-dependent magnetic field differences can be noticed. We can also observe that the magnetic disturbance from the building is small compared with the earth's magnetic field. Otherwise, the vector distribution would be much wider.
To use this location-dependent variation in z sig,m as a magnetic signature, the value should be fairly time-invariant. To investigate the time dependence of z cal,m , we recorded z sig,m (for m = 3) for seven days (six times a day at 10 am, 12 pm, 2pm, 6 pm, 8 pm, and 10 pm). In Figure 10, we can see that the time-dependent variation is small compared with the location-dependent variation: 0.6546 ≤ z sim,3 ≤ 0.6625. Since we use multiple cell data (segment data) to estimate the location, we believe this small time-dependent variation can be ignored. We conjecture this variation is due to sensor noise and changes of the environment (door opening/closing, people passing).
In the first walking experiment, a person walked from the end of cell 1 to the end of cell 60, a length of 89.7 m. This walking test was performed by 9 people whose information is given in Table 1. The parameters of the proposed algorithm are given in Table 2.  The results are given in Table 3. The walking paths are divided into 4 to 5 segments according to the rules in Section 4. The second column (m) represents the estimated location (in cell numbers) for each segment. For example, the estimated locations are 1 → 15 → 29 → 43 in the case of person (A). If a segment is too short, it is not used for the location estimation. In this case, the symbol '?' is used. This can happen in the final segment as in the cases of person (B), (C), (D) and (G). The third column represents the walking distance estimated by the proposed algorithm and the fourth column represents the percentage error in the estimated walking distance. The absolute average error percentage is 3.1%, which is rather good considering the fact that the walking parameter α is automatically estimated. Table 2. Parameters used in the experiment.
Persons (B)-(H) used the same belt (a military-style belt with some metal parts) where the sensor is attached. In the case of persons (A) and (I), the sensor is inserted inside the trousers (around the belt position). It can be seen thatĥ values are similar for persons (B)-(H), which is probably due to the fact h is affected by the same metal parts in the belt.
In the second walking experiment, a person walked three round trips between cell 1 and cell 60. The estimated location result is given in Table 4. In Figure 11, the estimation results for the first five segments are illustrated with four segments in the first row and one segment in the second row in Table 4. As in Table 3, '?' is used to indicate that the location is not estimated since the segment length is too short. In the second row, it can be seen that a person walked to the right 1 → 15 → 29 → 42 (cell numbers). When a person turned around at the end of cell 60, short segments are formed due to the large direction change (see the segment generation rule in Section 4). The location estimation is not used for these short segments. After turning around, when a person walked to the left (4th row), the proposed algorithm identifies the direction change correctly. In the second experiment, it can be seen that the walking direction can be correctly identified in all segments. The total walking length is 538.2 m (89.7 m × 6) and the sum of the estimated walking length of all segments is 538.2m (two values were accidentally the same). The same experiment was also done for person (B) and the estimated distance is 536.8 m. To see howα k changes during walking,α * k andα k values for person (A) are given in Figure 12. Through this long distance walking test, we can verify that the proposed algorithm can estimate the direction, location and walking distance relatively accurately. Table 4. Long walking test: three round trips between cell 1 and cell 60 ('?' symbol means the segment is too short for the location estimation).

Action Estimated Cell Number Estimated (Estimated Walking Distance) Direction
Walking to the right direction 1(21.  Table 4 (first 5 segments).
To test the location estimation accuracy, persons (A) and (B) walked on four paths as shown in Table 5. One segment is formed for each path by setting γ 3 to a large value. When a person starts from the center of cell 30, the location is correctly estimated as cell 30 in all cases. When a person starts from the borderline of cells 9 and 10, the location is estimated either as cell 9 or 10. In all cases, the location is correctly estimated with one cell length resolution. The estimated walking distance is also given in Table 5, where the true distance is 29.3 m. Finally, we investigate how G (cell size) and N seg (number of magnetic data in a segment) affect the location estimation performance. In the experiment, the cell size was 1.5 m and the magnetic signature data was obtained at positions 1.5 m apart. In Figure 13 (left figure), the magnetic signature data was obtained with fine cells (0.3m cell size) along 24 m intervals. There is no significant fluctuation in magnetic signature data between 1.5 m cell magnetic signature data (marked with '*' in Figure 13). Based on this observation, simulated magnetic signature data is generated assuming that the cell size is 0.1 cm in Figure 13 (right figure): magnetic signature data (cell size 0.1 cm) is interpolated (a linear interpolation) using 1.5 m cell size magnetic signature data (middle graph in Figure 13) and noise is added to the interpolated data (bottom graph in Figure 13). Using this simulated data, we investigated the effect of G and N seg . The simulation data in Figure 13 is just a part of the simulation data to show how the simulation data is generated. Although there is no large magnetic signature variation between 1.5 m magnetic data, there could be large variation if there are magnetic anomalies such as fire extinguishers between the measurement points.   To focus on the effect of G and N seg , we assume that α, h and C are exactly known. The y seg,i data is generated by adding noise to simulated magnetic signature data z sig,m . When the noise is too small, the location estimation performance is good for all G and N seg values. Thus large noise is used to generate y seg,i (magnetic data obtained during walking).
Three different cell sizes (0.5 m, 1.0 m, 1.5 m) and different N seg (1 ≤ N seg ≤ 10) are used in the simulation. Assuming that the total length of a corridor is 88.5 m, we checked whether the algorithm correctly identifies the location for every location. For example, if G = 1.5 m and N seg = 2, then the total number of cells is N cell = 60. Assuming that the starting x position is 0 m, we checked whether the algorithm gives the correct location. Then assuming that the starting x position is 1.5 m, we checked again. This process is repeated until the starting x position is 87 m (so that the final position of the segment is 88.5 m). If the estimated location error is smaller than 1m, we consider the location estimation successful. We compute the success rate for the given combination (G and N seg ) as the average value of 100 simulation results.
The simulation result is given in Table 6. We can see that the success rate increases with N seg . This is not surprising since large N seg means that more magnetic data is used for location estimation and thus the location estimation is robust to sensor noise. However, large N seg means large latency (for example, G = 1.5 and N seg = 7 mean that we should walk (N seg − 1)G = 9 m to estimate the location). Table 6. Location estimation performance with different N seg and cell sizes (100 simulations, estimation error smaller than 1m is considered as success).  Now the effect of G on the location estimation performance is investigated. There are drawbacks and merits of using a smaller cell size. For the same N seg value, a larger G value gives a better success rate. For example, for N seg = 5, the success rate is 69.08 % for a 0.5 m cell. The success rate 91.80% for a 1.5 m cell is significantly better. Also, a smaller cell requires more computation: N cell is proportional to 1/G and thus the computational complexity is proportional to 1/G. On the other hand, the merit of a smaller cell size is its small latency. If we compare the cases of (N seg , G) = (10, 0.5) and (N seg , G) = (7, 1.0), the success rate is similar. However, the required walking length for G = 0.5 is 4.5 m while the required walking length for G = 1 is 6 m. Thus, we can estimate location with a smaller walking length if we use a smaller cell size.
One guideline for N seg and G is given as follows: G should be chosen based on the required estimation accuracy. If 1.5 m estimation error is the acceptable upper limit, G =1.5 m can be chosen. Next, N seg can be chosen based on the magnetic disturbance level (from on-off electric machines for example). The larger N seg chosen, the more robust the estimated location becomes at the sacrifice of large latency.

Conclusions
In this paper, the location in the one-dimensional corridor is estimated using location-dependent ambient magnetic fields inside buildings. The sensor (inertial/magnetic) is attached to the belt. The walking length is estimated using the accelerometer output. The magnetic data during walking is compared with pre-recorded magnetic signature data.
The main contribution is that person-dependent parameters (walking parameter α and hard iron parameter h) are adaptively estimated in the proposed algorithm. Thus no person-dependent calibration procedure is required and it can be used for the location estimation as soon as the device is attached to the belt.
The proposed algorithm was tested on 9 people (weight : 48-72 Kg, height: 155-181 cm, age: 22-47). With 89.7 m walking tests, the average distance estimation error was 3.1%. The location estimation was also accurate with the resolution depending on the cell size (about 1.5 m).
The proposed algorithm is not a full-scale localization algorithm such as in [24]. It essentially solves the location estimation problem of a one segment. There is no dynamic modeling about people or map matching algorithms. The proposed algorithm can be used in a full-scale localization problem as a useful subroutine. For example, the measurement equations of filters in [10,11] could be replaced by the proposed algorithm.
Future work is to increase the location estimation accuracy and to extend the result to two-dimensional location estimation problem.