## 4 Methodology
### Adaptive Position Estimation
#### 4.1.1 Step Segmentation Detection
First, the time interval between the most recent adjacent peaks is calculated:  
\[t_{\text{s}}(i)=t_{\text{s}}^{\text{P}}(i)-t_{\text{s}}^{\text{P}}(i-1) \tag{7}\]  
where \(t_{\text{s}}(i)\) represents the time interval between the \(i\)-th and the previous peak of the step detection signal, and \(t_{\text{s}}^{\text{P}}(i)\) represents the sampling time of the \(i\)-th peak in the acceleration signal. The time interval \(t_{\text{s}}(i)\) should satisfy the following constraint:  
\[(1-a_{t})\cdot T_{i-1}\leq t_{\text{s}}(i)\leq(1+a_{t})\cdot T_{i-1} \tag{8}\]  
where \(a_{t}\) is the constraint range parameter, and \(T_{i-1}\) is the time threshold, updated as follows:  
\[T_{i}=\frac{T_{i-1}+t_{\text{s}}(i)}{2} \tag{9}\]  
\[a_{t}=(T_{i}-T_{i-1})^{2} \tag{10}\]  
This time interval constraint effectively reduces the false detection rate of step segmentations. The results of the peak detection method with time constraints are shown in Figure 5. Peaks that do not satisfy the constraint conditions will be discarded, such as the peaks in the red frame. (3) Edge Detection Peak detection primarily relies on changes in the pedestrian's center of mass. The improved peak detection method is capable of accurately identifying typical walking movements. However, when pedestrians perform unconventional actions, such as bending, squatting, or leaning backward, false peaks may be generated due to changes in their center of mass, which can lead to errors in step counting and position estimation. To mitigate such  
\[\sigma_{\mathrm{s}}(t)=\sqrt{\frac{1}{W}{\sum}_{t_{W}\in\Phi_{W}(t)}\left( \alpha_{\mathrm{s}}(t_{W})-\overline{\alpha}_{\mathrm{s}}(t)\right)^{2}} \tag{4}\]0 Adaptive time-constrained peak detection. misdetections, edge detection based on the acceleration information before and after a peak is applied to minimize the impact of erroneous detections. A complete step segmentation should consist of the descent edge after the previous peak, the ascent edge, and the peak generated when the foot strikes the ground. Figure 6 illustrates inertial data generated when a pedestrian bends during walking. The peak indicated by the arrow is caused by the sudden bending of the pedestrian. Since no descent or ascent edges were detected before this peak, it is discarded during edge detection, confirming that this data does not represent a valid step segmentation and should not be used for step length estimation or position calculation. After filtering, the step detection signal shows a periodic sine wave, allowing step detection to be performed using the peaks. To reduce the false detection rate, multiple constraints are applied to accurately delineate the step segmentation, as shown in \[\sigma_{\mathrm{s}}(t)=\sqrt{\frac{1}{W}{\sum}_{t_{W}\in\Phi_{W}(t)}\left( \alpha_{\mathrm{s}}(t_{W})-\overline{\alpha}_{\mathrm{s}}(t)\right)^{2}} \tag{4}\]1 The step segmentation data is defined as the interval between two adjacent peaks. The conditions for a valid step segmentation include the presence of an upward zero-crossing, a downward zero-crossing, a time interval, and a peak caused by foot strike. The green curve segment within the red box represents the data of a single stride.