## 4 Methodology
### Adaptive Position Estimation
#### 4.1.1 Step Segmentation Detection  
In this study, step length is defined as the distance between the current foot position and the previous foot position when one foot of the pedestrian touches the ground. The corresponding step segmentation refers to the inertial data interval generated during that motion. The accuracy of step segmentation division directly affects the accuracy of step length estimation. To improve the accuracy of step segmentation, an adaptive peak detection method combining adaptive peak thresholding, adaptive time thresholding, and edge detection is designed to segment and extract step segmentation data. (1) Adaptive Peak Threshold  
The accuracy of peak detection is primarily influenced by the pedestrian's walking speed and the set threshold. This paper proposes an adaptive threshold calculation method based on the feature variations of chest inertial data, allowing the threshold to adjust according to changes in the pedestrian's acceleration data. The adaptive threshold is set based on the standard deviation of the step detection signal within a sliding window and the maximum amplitude of the acceleration. This approach avoids the need to set separate thresholds for different motion states. The curve of adaptive threshold is shown as the red curve in Figure 4.  
The standard deviation of the step detection signal is calculated as follows:  
\[\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}\]  
where \(\sigma_{\mathrm{s}}(t)\) represents the standard deviation of the step detection signal at the most recent sampling time \(t\), \(W\) is the sliding window size, \(\Phi_{W}(t)=\{t_{W}|t_{W}>-W\}\) represents the set of the latest \(W\) data sampling times, and \(\overline{\alpha}_{\mathrm{s}}(t)\) is the mean acceleration in the sliding window, calculated as:  
\[\overline{\alpha}_{\mathrm{s}}(t)=\frac{1}{W}{\sum}_{t_{W}\in\Phi_{W}(t)} \left(\alpha_{\mathrm{s}}(t_{W})\right) \tag{5}\]  
The filtered step detection signal's peak is influenced by the walking speed. The faster speed, the greater standard deviation. The adaptive threshold formula is:  
\[\mu(t)=a_{\mathrm{s}}\sigma_{\mathrm{s}}(t)+b_{\mathrm{s}}\alpha_{\mathrm{s} }^{\mathrm{max}}+c_{\mathrm{s}}\mu_{\mathrm{s}}+d \tag{6}\]  
where \(\alpha_{\mathrm{s}}^{\mathrm{max}}=\max\{\alpha_{\mathrm{s}}(t_{W})\}\), \(t_{W}\in\Phi_{W}(t)\) is the maximum value of acceleration amplitude in the sliding window, \(\mu_{\mathrm{s}}\) is the mean value of acceleration amplitude, and \(d\) is a constant to ensure that the adaptive threshold is no smaller than \(d\). The coefficients \(a_{\mathrm{s}}\), \(b_{\mathrm{s}}\), \(c_{\mathrm{s}}\) and \(d\) were determined by fitting the model, and the final values of the parameters were set to 0.41, 0.2, 0.69, and 0.14, respectively. Figure 4: Adaptive peak threshold detection. (**a**) Comprehensive data curve overview. (**b**) Zoomed-in view of red-outlined area from left figure. 2. Adaptive Time Constraint Since the pedestrian's walking frequency remains within a narrow range, a reasonable time interval exists between adjacent peaks of the acceleration signal. However, sensor noise or irregular body movements may lead to the detection of multiple peaks within a single step period, while pauses or stops during walking can cause significantly longer intervals between consecutive peaks. A fixed time threshold may result in erroneous step segmentation. To address this issue, this paper proposes an adaptive time threshold method that dynamically adjusts the allowable peak interval based on the temporal characteristics of adjacent peaks, thereby reducing incorrect gait segmentation.