Step detection for smartphones plays an important role in the pedestrian dead reckoning (PDR) for indoor positioning. Aiming at the problem of low step detection accuracy of smartphones in complex unconstrained states in PDR, smartphone-based unconstrained step detection method fusing a variable sliding window and an adaptive threshold is proposed. In this method, the dynamic updating algorithm of a peak threshold is developed, and the minimum peak value filtered after a sliding window filter is used as the adaptive peak threshold, which solves the problem that the peak threshold of different motion states is difficult to update adaptively. Then, a variable sliding window collaborative time threshold method is proposed, which solves the problem that the adjacent windows cannot be contacted, and the initial peak and the end peak are difficult to accurately identify. To evaluate the performance of the proposed unconstrained step detection algorithm, 50 experiments in constrained and unconstrained states are conducted by 25 volunteers holding 21 different types of smartphones. Experimental results show: The average step counting accuracy of the proposed unconstrained step detection algorithm is over 98%. Compared with the open source program Stepcount, the average step counting accuracy of the proposed algorithm is improved by 10.0%. The smartphone-based unconstrained step detection fusing a variable sliding window and an adaptive threshold has a strong ability to adapt to complex unconstrained states, and the average step counting accuracy rate is only 0.6% lower than that of constrained states. This algorithm has a wide audience and is friendly for different genders and smartphones with different prices.
Along with the IoT technology, the importance of indoor positioning is increasing, but the accuracy of the traditional fingerprint positioning algorithm is negatively affected by the complex indoor environment. This issue of low indoor spatial geolocation localization accuracy when the signal is collected away from the present stage occurs due to the signal instability of the iBeacon in the traditional fingerprint localization algorithm, which generates a variety of factors such as object blocking and reflection, multipath effect, etc., as well as the scarcity of reference fingerprint data points. In response, this study proposes an inverse distance-weighted optimization WKNN algorithm for indoor localization based on the GM(1,1) model. By implementing GM(1,1) model pre-process leveling, the original fingerprint library was reconstructed into a large-capacity fingerprint database using the inverse distance-weighted interpolation method. The local inverse distance-weighted interpolation was used for interpolation, combined with the WKNN algorithm to complete the coordinate solution in real time. This effectively solved the issue of low localization accuracy caused by the large fluctuation of the received signal strength (RSS) sampling measurement data and the existence of few reference fingerprint datapoints in the fingerprint database. The results show that this algorithm reduced the average positioning error by 5.9% compared with ordinary kriging (OK) interpolation leveling and reduced the average positioning error by 18.2% compared with the indoor spatial location accuracy of the original fingerprint database, which can effectively improve the positioning accuracy and provide technical support for indoor location and navigation services.