Estimation of Pedestrian Altitude Inside a Multi-Story Building Using an Integrated Micro-IMU and Barometer Device

This paper presents a novel method of estimating the altitude of pedestrians who are walking in the indoor environment of a multi-story building. We will show that to achieve pedestrian altitude estimation, a pedestrian only needs to wear a small MEMS-based integrated sensing device consisting of a micro-IMU (i


I. INTRODUCTION
Walking is an important and basic motion of the human body.It generates a large amount of useful information of our body relative to the environment.Gait analysis of human motions, such as walking on flat ground and up and down stairs, is widely used in human body positioning, pedestrian The associate editor coordinating the review of this manuscript and approving it for publication was Noel Crespi.navigation, medical rehabilitation and etc.With the development of Micro-Electro-Mechanical Systems (MEMS) [1], small-size and low-cost sensors, such as accelerometers and gyroscopes, have been playing a key role in human tracking and analysis of positioning [2].However, the inherent drifts of Inertial Measurement Unit (IMU) sensors can cause lots of errors in altitude estimation, which limits the use of MEMS sensors in applications such as pedestrian navigation and position estimation of pedestrians in indoor environments.This is especially true when it comes to using IMU sensors for estimating the vertical altitude of a pedestrian in a multi-story building.
There are two conventional approaches to reduce the error of position estimation, Pedestrian Dead Reckoning (PDR) [3] and Inertial Navigation System (INS) [4], [5].In the PDR technique, step counting and step length estimation are used to determine a person's position [6]- [8].However, either unsteady walking or inaccurate step length calculation can result in huge errors.With an INS, the pedestrian position is estimated by double integration of the measured acceleration signals [9], [10].In order to limit the growth of estimation errors, many different techniques have been developed to aid IMU sensors for error correction.Examples include Radio Frequency Identification (RFID) [11], [12] map formation [13], ultrasound sensors [14], ground reaction sensors [15], optical sensors [16], UWB (Ultra-wide Bandwidth) [17], pressure sensors [18], and LADIR [19].Some of these systems can provide precise position estimates but involve problems on cost and portability.
While other researchers proposed approaches that are only based on MEMS sensors, where the methods of Extended Kalman Filter (EKF) [20]- [22], robust adaptive Kalman filtering (RAKF) [23], Unscented Kalman Filter (UKF) [24], and Zero Velocity Update (ZUPT) [25] are used to reduce drift errors.The Heuristic Drift Reduction (HDR) [22] and Zero Angular Rate Update (ZARU) [22] methods were also developed to reduce heading errors.However, these methods were mainly used in the position estimating in the horizontal direction.
Accurate altitude estimation of a person is critical in various important applications, such as the height positioning of firefighters during a fire rescue mission, or location-tracking of children or elderlies in multi-story buildings.A small, portable, and wearable, and reliable sensing device for altitude estimation is a solution to address these important applications.However, the cumulative altitude error brought by MEMS sensors always result in the drift of altitude positioning information provided by a wearable device.Generally, there are two methods for reducing the altitude estimation error.
(1) Prior work using multiple MEMS sensor nodes Utilizing the relative motion of the body joints, multisensor-based methods were developed to reduce the error of the estimated altitude.For examples, the Denavit-Hartenberg (DH) method was built based on three sensor nodes worn on one lower limb [26], and the Height Difference Information aided Barometer (HDIB) approach was developed using two sensor nodes worn on two different feet [27].But in general, people prefer wearing fewer sensing device on their body in order to minimize obstructions or weight from the wearable sensors.Therefore, solutions altitude estimation of pedestrians based on one sensor node are still desirable.
(2) Prior work using one MEMS sensor node Utilizing only one wearable sensor node, which consisted of Magnetic Angular Rate and Gravity sensor arrays (MARG), Qiu et al. [28] estimated the altitude position of a pedestrian in climbing stairs.However, they did not report the capability of altitude estimation in climbing the stairs with variable heights using their sensor node.And, in their experiments, the length of the vertical journey and time are very short.The long-time shift and stability of the sensor node were not fully evaluated.
In this paper, we presented our work of using also a single sensor node-which includes a 9 DOF IMU and a barometer; we have demonstrated that our sensor node gives a higher performance in altitude estimation than the DH, HDIB and MARG methods, as compared in TABLE 1.
Note: Total height refers to the sum of the absolute value of the height walked in each stairs climbing trial.
We have shown that a sensing device integrated with MEMS micro-IMU and barometer could be used to estimate pedestrian altitude, and long-time sensing stability could be achieved, i.e., it provides stable altitude estimation results in 12-hours testing, even in environments with variable step heights of stairs.And, we have shown that high-precision altitude estimation of pedestrians can be obtained by wearing this one single sensor node on the calf when two correction algorithms are used to process the sensor data.Firstly, the inherent drifts of the accelerometers and gyroscopes were corrected by using a complementary filter.Secondly, after we calculated the altitude based on the corrected acceleration data, the altitude was compensated using the height calculated by a barometer in the stance phase of each step.Therefore, our altitude estimating method has three main advantages: using only one sensor node, corrected drifts of IMU data, and compensated target height.A multi-threshold detection method was used to determine the stance and swing phases.The vertical acceleration was updated to zero in the stance phase to minimize the drift error when the single foot is stationary.In the swing phase, the motion direction was represented by quaternion, and the acceleration was corrected through Complementary Filter (CF).The pedestrians' altitude was estimated using the double integration of the corrected acceleration.The height of each stair was estimated based on the barometer height.Using a Target-error Compensation (TC) algorithm on these two estimated heights, our method sharply reduced the inherent drifts of IMU sensors and ensured highprecision altitude estimation of pedestrians walking inside a multi-story building.

II. SYSTEM OVERVIEW AND DATA CORRECTION
Two 21-year-old young males with an average height of 176 cm were selected as subjects to test the Altitude Estimation Device (AED).This AED was developed by our group integrating a MEMS-based IMU (consisting of a 3-D accelerometer, a gyroscope, and a 3-D magnetometer) and a micro-barometer.These subjects walked in their habitual speeds and gestures in the experiments.They were in good health and had no movement disorders.The AED was worn on the right calf of the subjects, as shown in Figure 1(a).The hardware performance specifications of AED are shown in TABLE 2. The raw data was recorded at a sampling rate of 74 Hz and then transmitted to the host via a Bluetooth module.After preprocessing, the data was used to detect the gait phase and estimate the altitude of the subject, as shown in Figure 1(b).
We kept the z-axis of worn sensor aligned with the vertical direction of the human lower limbs.And the IMU was initially calibrated at the beginning of the experiment, and the sensor coordinate system and the earth coordinate system were kept consistent.For the raw data in the experiment was washed by removing the outliers based on the criterion of 3 times the standard deviation.A median filter and a moving average filter were used to eliminate data noise.

III. METHOD A. GAIT PHASE DETECTION
To minimize the error when the foot is stationary, vertical acceleration and velocity need to be updated to zero.When the foot is swinging, the acceleration needs to be corrected by CF.Therefore, recognizing the different phases of the gait is the first step toward altitude estimation.The gait is a periodic movement that takes on various patterns.Each person has their unique gait pattern.There are four typical events in one normalized gait cycle: Heel-Strike (HS), Foot-Flat (FF), Heel-Off (HO), and Toe-Off (TO) [29].Usually, the HS event is considered as the beginning of a gait cycle.The gait cycle is set to start from the current HS to the next HS of the same foot.We divided the gait cycle into the stance phase and the swing phase [26].As shown in Figure 2, the stance phase lasts from HS to HO, which makes up about 60% of the gait cycle, and the swing phase lasts from HO to the next HS .
Continuous foot movement can be regarded as a state transition between the stance phase and the swing phase.Accurate detection of gait phases helps a lot with highprecision estimation of pedestrians' position.There are two commonly used methods for phase detection.One is the threshold detection method, which uses a sliding window to perform short-term statistical analysis on detected values [30], [31].The other one is the multi-threshold detection method, which add one more threshold on time to filter out fake phases.A fake phase is usually a smaller value than a real one [32].We improved the multi-threshold detection method by adding a new threshold, which is indicated by the normalized vertical acceleration (z-axis) change.It can greatly help discriminate the stance and swing phases in gait movement analysis.
In another word, we applied three constraint conditions to recognize the motion phases of the foot.The first constraint condition (equation 1) is established using the variance threshold of the acceleration in a sliding window to evaluate the changes of the foot motion.
where A i = acc z i /g, a cc z i is the vertical acceleration, i sampling point, and W size of the sliding window.In order to describe the fluctuations of the data, a small value is preferred for W.After multiple tests and comparisons, we set W = 3. λ 1 is the threshold of the acceleration variance in the sliding window, which was determined by multiple experiments [29].In this paper, we set λ 1 = 0.0096.
The second threshold (equation 2) is the time length ratio between two adjacent stance phases, which introduced the similarity of a sequential step to help recognize the stance phases of foot.
where  of the time length ratio between two adjacent stance phases.
In this paper, we set λ 2 = 0.75 after multiple experiments.
The third constraint condition (equation 3) is the threshold of the normalized acceleration change at the point of i to represent the direction changes of the target foot where x = (τ , A i+1 − A i ), and y = (τ , 0). τ is the sampling period.And λ 3 is the threshold of the normalized acceleration change at the point of i.In this paper, when λ 3 > 0.04 the acceleration sequences are considered as the stance phase.
Only when these three constraints are satisfied simultaneously, we consider the acceleration data serial as a complete stance phase.The phase detection result of walking upstairs is shown in Figure 3.The motion of walking upstairs is divided into the stance and swing phases.The stance phase includes Foot-Flat (FF), Heel-Off (HO), and Heel-Strike (HS), and the swing phase includes Rising (R) and Decline (D).

B. ALTITUDE ESTIMATION
The altitude of a pedestrian was estimated by using the double integration of vertical acceleration, as shown in equation ( 4). a z (t), v z (t), h z (t) are defined as vertical acceleration, vertical velocity and height, respectively, at time t.
In order to reduce the drift error, vertical acceleration in stance phases was corrected by updating the acceleration to zero when the single foot is stationary.And in swing phases, it was corrected by using the complementary filter (CF).And the three-dimensional motion direction was represented by quaternion.The target-error compensation (TC) was used to reduce estimation error, as shown in Figure 4(a).The algorithm of CF is shown in Figure 4(b).
Accelerometer data has better static characteristics but worse dynamic characteristics than gyroscope data.To get accurate results, researchers often choose to fuse these two types of data by using different algorithms, such as Kalman filters [26], [29], Complementary filters [33], and particle filters [34], [35].In this paper, the angular rate and acceleration data were fused using a CF algorithm, which is shown in equation (5).
where e is defined as the error between the measured acceleration and the corrected acceleration, and the cumulative error is represented by e a .Parameters P = 0.8 and I = 0.008 were set in the CF algorithm.The angular rate obtained by the gyroscope data is represented by w m .The corrected angular rate is represented by w c =[w x , w y , w z ] and is used to update quaternions and obtain the corrected vertical acceleration.
Quaternions S e q were used to describe the orientation of the foot and were updated by using the equation (6).Then we got the foot motion rotation matrix s e R, as shown in equation (7).
The estimated altitudeh of person was calculated by using double integration from Equation (4).However, if the altitude can be calculated using another scheme, then these two VOLUME 7, 2019 altitude results could be compared and corrected.A barometer system, integrated with an IMU, was therefore used for detecting pedestrian altitude to reduce the error of estimated altitude.The height of each stair was estimated based on the barometer height, and the stair height of each step was regarded as the target height.The error between the estimated altitude and the target height was calculated to perform Target-error Compensation (TC).We only used the barometer height data at the stance phase to calculate the target height.The barometer measurement error is rather poor due to several factors, such as systematic error, drifting behavior and sensitivity to environment changes.The sliding average filtering and median filtering were used to eliminate noise.Detrending was used to eliminate drifts of the barometer.We took the average altitude of the barometer in stance phase as the target altitude, which is shown in equation ( 9), where h t is the target height, h b i the barometer height in the stance phase, and n the number of sampling points in the stance phase.
After the target height h t was determined, the altitude of target error h, between h t and the estimated altitude in the stance phase h s , was defined as equation (10).
where the target height h t was calculated by the TC method under two different cases.In the first case, we assumed the stairs in a multi-story building may have different heights.
And the target height h t in each stance phase is variable, which should be calculated using the average barometer height (variable-TC), as shown in Equation ( 9).In the second case, we assumed the stairs have the same height.And the height of each step is treated as constant in TC algorithm (constant-TC).The detailed procedures of constant-TC are as follows.Firstly, the average value h a and standard deviation D h of the height increments h inc between the target heights of two adjacent steps were calculated.Secondly, when |h inc − h a | > D h , h inc was corrected by using the adjacent target heights.
In the swing phase, the estimated altitude was compensated based on the calculated target height h t in the stance phase.The swing period lasts for time t s = mτ , where m is the total number of samples in the swing phase.hi is the estimated altitude in the swing phase using CF, where i is sampling points.Then the altitude h i is compensated using the target error h in the stance phase (CF-TC), as shown in equation (11).
where h j is the corrected altitude in the swing phase using CF-TC, j = i =1• • • m.This compensation algorithm can accurately correct the altitude in the swing phase.The filtered barometer height was used to evaluate the effectiveness of altitude estimation.To verify the effectiveness of the altitude  On the condition that only single-foot motion was considered, subjects took 11 steps up the stairs, which included 10 steps upstairs and one step on the middle platform.The actual measured stair height is represented by bark mark.For example, the Stair-2 is 0.29m, the Stair-4 is 0.58m and Stair-6 is 0.87m.Altitude estimation was performed by using CF-TC.
To evaluate the accuracy of altitude estimation using CF-TC, an error analysis was performed as shown in Figure 6.The pedestrian altitude estimation was achieved by using different methods such as barometer, CF, CF and variable-TC (CF-Var-TC), and CF and constant-TC (CF-Cons-TC).The error of altitude estimation using a barometer was about 10cm even when the barometer is placed on a desk statically.
However, sometimes the walking speed affects the barometer's performance.A low walking speed tends to mean a low error.For example, the error is significantly lower when in stairs 8, 10, 18 and 20 than in other places.The accuracy of  TABLE 3.An analysis of the error between 5-minutes estimated altitude and true stairs height.
altitude estimation was improved using CF; however, there still existed a large cumulative estimation error of about 6cm.The estimation error was sharply reduced using CF-TC.The accurate altitude was achieved, and the height error of each step was limited to 0.5cm, with the cumulative height error accounting for 1.7% of the total height.

IV. EXPERIMENT RESULT AND VALIDATION A. MULTIPLE LONG-TIME EXPERIMENTS FOR ALTITUDE ESTIMATION
The IMU sensors (especially the 3D gyroscope) will drift after they are in operation for a period, resulting in a longterm cumulative error in the estimation of altitude.To verify our method which using CF-TC to reduce altitude error in long-term estimation, we conducted a series of experiments, as shown in Figure 7(a).The subjects walked from the first floor to the fourth floor for about 5 minutes.The altitude of each floor was 4.31 m, 3.46 m, and 3.46 m, respectively.Activities in the multi-story building included walking on flat, walking upstairs and going downstairs by elevator.Based on the above basic motion scenarios, the pedestrians' altitude was estimated by using CF-TC, as shown in Figure 7(b).
The black curve represents the pedestrians' altitude.To evaluate the accuracy of altitude estimation, an analysis of the error between the estimated altitude and the actual stair height was made.And the step counting was performed, as shown in TABLE 3.And the correct value is the actually measured height data.Experimental results show that the estimation error can be reduced by using CF-TC, with error of altitude estimation accounting for about 2% of the total height.
To evaluate the CF-TC method's stability and precision in long-time altitude estimation, three altitude estimation experiments, each lasting for 20 minutes, were conducted by wearing the sensor on the calf of a subject in 12 hours.In the whole experiments, as shown in Figure 8, the subject had 3 walking periods (T1, T2, T3) and 2 resting periods.During the walking period, the subject walked upstairs from Floor 1 to Floor 4 (F1-F4), and then went down stairs by elevator.The sensor kept collecting data in the walking period, even when the pedestrian was going down by elevator.After 3 cycles of going up and down stairs (S1, S2, S3), the subject had a rest by taking off the sensor and placing it on a desk.In the resting period when the sensor couldn't detect the walking motions, it went into the sleeping mode to save energy.And the sensor can be awakened easily when the pedestrian puts it back on and goes on walking.After the multiple longtime experiments for altitude estimation, an analysis was   conducted to detect the error between the estimated altitude in the stance phase and the correct value, as shown in TABLE 4. The results show that the altitude estimation error accounts for about 2% of the total height.

B. ESTIMATION OF PEDESTRIANS' ALTITUDE IN THE CASE OF DIFFERENT STAIR HEIGHTS
In the preliminary study the height of stairs was the same, so the target height of each step was the constant in the estimation.To further verify the robustness of estimation by using CF-TC, an experiment was carried out at different stair heights and with the motion modes including walking upstairs, walking on the middle platform and walking downstairs.The correct height of each step was different in the whole experiment.To solve the problem that the target height is variable during altitude estimation, an improved method of obtaining the target height increment was proposed as shown in Equation (12).
where h 1 is the altitude constant of the first step in the stance phase, which is set as 0.125m in the experiment.h j t represents target height of the j step, where j is the step number.And h j t represents the increment of target height of j step.An indoor analysis platform was built, as shown in Figure 9(a).The actual target height increment of each step was 0.12m, 0.24m, 0.40m, 0.00m, −0.22m, −0.36m, and −0.18m.The first three  steps were walking upstairs, the fourth step was walking on the middle platform, and the last three steps were walking downstairs.A comparison was made between the altitude estimated using CF-TC and that measured by the barometer, as shown in Figure 9(b).
As shown in Figure 9, pedestrian altitude calculated using the CF-TC method are represented by the red curve.Pedestrian altitude measured by the barometer-raw and the barometer-filter are represented by a grey curve and a blue curve, respectively.The actual target height of each step is represented by a black mark, which changes while a pedestrian walked upstairs from Ground to Step 3 and walked downstairs from Step 4 to Ground.Obviously, the estimated results are close to the actual target altitude and the barometer altitude.To evaluate the accuracy and robustness of estimation by using CF-TC, the same experiment was repeated for 5 times.A comparison was made between the pedestrian altitude estimated using the CF-TC, CF, Barometer methods, and the actual stair height, as shown in Figure 10.
The error of altitude estimation using CF-TC is within 2 cm and is significantly lower than that using barometer and complementary filter (CF).This experiment demonstrated that the CF-TC method achieved accurate altitude estimation when the actual stair height is variable.Furthermore, using this experimental platform, the altitudes of the pedestrians with different height, weight, and walking velocity were accurately estimated using the CF-TC algorithm.The specific physical characteristics and velocity parameters of the subjects are shown in TABLE 5.
In the experiments, the subjects went up and down the stairs at their individual velocities.The actual height increment of each step was 0.12m, 0.24m, 0.40m, 0.00m, −0.22m, −0.36m, and −0.18m.Subjects (1,2,3) were selected to conduct altitude estimation using CF-TC, and the results of estimated pedestrian altitude are shown in Figure 11(a).Subjects (4,5,6) were selected to conduct altitude estimation when the target height increment was changed to 0.20m, 040m, 0.16m, 0.00m, −0.22m, −0.36m, and −0.18m.And the altitude estimation results are shown in Figure 11(b).
As shown in Figure 11, similar altitude estimation results are obtained when the experiments are carried out by different persons with different physical characteristics and walking velocities.These results indicate that the CF-TC algorithm works very stably.A comparison was made between the pedestrian altitude estimated using CF-TC and the actual stair height, as shown in  Root mean square error (RMSE) between altitude estimation values and actual stair height, and the Ratio of cumulative error to total height (RCET).
In the experimental scenario where the target height of each step is different, the average error of the estimated altitude of subjects with different physical characteristics and velocities is 2cm, and cumulative height error accounts for about 2% of the total height.The above experiments show that the CF-TC-based pedestrian altitude estimation method is accurate and robust.

V. CONCLUSION
In this paper, we accurately estimated the pedestrian altitude (i.e., within ∼ 2% from ground-level to height of 11.23m) when pedestrians were walking up and down stairs inside a multi-story building by using an integrated device that consists of a MEMS-based IMU and a barometer.To reduce the drift error of the IMU, the accelerations in the stance were corrected by updating the acceleration to zero and the accelerations in swing phases were corrected by the complementary filter.The target height of each step was estimated based on the barometer height, and error compensation was performed to reduce estimation error.The experimental results demonstrate that our method can accurately estimate the altitude of the subjects when they are walking up and down the stairs inside a building.The altitude detection method based on the data acquired from the micro-IMU and the barometer (collectively called the Altitude Estimation Device in this paper) is stable and accurate for at least 12 hours.And it also performed very well on a self-built pedestrian platform with different step heights.The final estimated error of the step height is 0.5 cm when these stairs are of the same height.The cumulative height error is 1.7% of the total height.In the long-time experiments, the cumulative error accounts for about 2% of the total height of 11.23m.When the stairs have different heights, the estimated height error of each step is within 2cm.These results show that the Altitude Estimated Device discussed in this paper may be used in a range of applications, including indoor pedestrian navigation, human motion tracking, and medical rehabilitation.

FIGURE 1 .
FIGURE 1.(a) The experiment of pedestrian altitude estimation and (b) the whole implementation of altitude estimation.

FIGURE 2 .
FIGURE 2. Typical gait phase in a gait cycle.

FIGURE 3 .
FIGURE 3. Phase detection of gait of walking upstairs based on multi-threshold detection.

FIGURE 4 .
FIGURE 4. The method flow chart of altitude estimation of pedestrian based on (a) target-error compensation and (b) a complementary filter.

FIGURE 5 .
FIGURE 5. Comparison of the estimated altitude of pedestrians walking upstairs in a multi-story building based on CF-TC and the raw barometer height, filtered barometer height as well the estimated altitude based on complementary filter (CF).

FIGURE 6 .
FIGURE 6.An error bar chart showing the comparison of the estimated height with the actual stair height using methods based on CF-Cons-TC, CF-Var-TC, CF, and barometer.

FIGURE 7 .
FIGURE 7. (a) Experimental scheme and (b) estimated results of a pedestrians' altitude from the first floor to the fourth floor for 5 minutes using the CF-TC method.

FIGURE 8 .
FIGURE 8. (a) The estimated results of pedestrians' altitude in a multi-story building in 12 hours using the CF-TC method.The enlarged altitude estimating result at (b) the beginning and (c) the end of the experiments when walking upstairs.

TABLE 4 .
An analysis of the error between estimated altitude and true stairs height in long-time testing.

FIGURE 9 .
FIGURE 9. (a) Experiment platform and (b) altitude estimating results in the case of variable target stair heights.

FIGURE 10 .
FIGURE 10. Analysis of the error between the estimated pedestrian altitude and the actual target height using different altitude estimation methods.

TABLE 1 .
Comparison of different altitude estimation methods.

TABLE 5 .
physical characteristics and velocity parameters of different subjects.

FIGURE 11 .
Altitude estimation results in the case of variable target stair heights using CF-TC.

TABLE 6 ,
which includes Step counts,

TABLE 6 .
An analysis of the error between estimated altitude and true stairs height.