# Indoor PDR Positioning Assisted by Acoustic Source Localization, and Pedestrian Movement Behavior Recognition, Using a Dual-Microphone Smartphone

Authors: Mei Wang; Nan Duan; Zou Zhou; Fei Zheng; Hongbing Qiu; Xiaopeng Li; Guoli Zhang
Journal: Wireless Communications and Mobile Computing
 (2021)

---

## Abstract

In recent years, the public’s demand for location services has increased significantly. As outdoor positioning has matured, indoor positioning has become a focus area for researchers. Various indoor positioning methods have emerged. Pedestrian dead reckoning (PDR) has become a research hotspot since it does not require a positioning infrastructure. An integral equation is used in PDR positioning; thus, errors accumulate during long-term operation. To eliminate the accumulated errors in PDR localisation, this paper proposes a PDR localisation system applied to complex scenarios with multiple buildings and large areas. The system is based on the pedestrian movement behavior recognition algorithm proposed in this paper, which recognises the behavior of pedestrians for each gait and improves the stride length estimation for PDR localisation based on the recognition results to reduce the accumulation of errors in the PDR localisation algorithm itself. At the same time, the system uses self-researched hardware to modify the audio equipment used for broadcasting within the indoor environment, to locate the acoustic source through a Hamming distance-based localisation algorithm, and to correct the estimated acoustic source estimated location based on the known source location in order to eliminate the accumulated error in PDR localisation. Through analysis and experimental verification, the recognition accuracy of pedestrian movement behavior recognition proposed in this paper reaches 95% and the acoustic source localisation accuracy of 0.32 m during movement, thus, producing an excellent effect on eliminating the cumulative error of PDR localisation.


---

## Body

## 1. Introduction

In recent years, the public’s demand for location-based services (LBS) has become more robust, and LBS has affected many aspects of people’s work and life. The Global Navigation Satellite System (GNSS) is a significant component of LBS, and the accuracy has reached the submeter level [1, 2]. Although GNSS can provide good coverage and high accuracy outdoors, it does not meet the positioning requirements indoors and in other sheltered environments due to the low satellite signal strength and quality in these locations [3]. Therefore, there is an urgent need for indoor LBS with real-time, stable, and accurate positioning performance, especially in schools, hospitals, and large commercial shopping centers due to the large and complex area and numerous users [4].Commonly used indoor positioning technology can be divided into three categories based on the positioning principle: trilateral positioning [5], fingerprint positioning [6], and track estimation [7]. In complex scenarios, these three indoor positioning technologies can provide relatively good positioning performance. However, trilateral positioning requires a receiver and a reference source, and it is necessary to deploy the equipment in the area in advance. Therefore, full coverage is required in the facility to prevent blind spots, increasing the positioning cost. Fingerprint positioning can achieve good positioning accuracy in scenarios without or sparsely deployed positioning facilities. In recent years, Wi-Fi-based fingerprint positioning has attracted attention due to its deployment practicability. However, the construction and update of fingerprint maps is a complex and tedious task. Besides, a fingerprint map has the problem of timeliness [6], which reduces the positioning accuracy and substantially increases the positioning cost. The typical trajectory calculation principle in indoor positioning is pedestrian dead reckoning (PDR) positioning. Levi and Judd proposed PDR positioning in 1996 [7]; it has been widely used in complex environments because of its advantages, such as no infrastructure. It achieves good positioning accuracy.We compared the latest indoor positioning solutions reported in the literature [8–12] regarding positioning accuracy, coverage, cost, smartphone compatibility, and other parameters, as shown in Table 1.Table 1
Comparison of the latest indoor positioning methods.
SolutionPrinciplePrecision (m)DimensionCoverage area (m2)Cost ($/m2)Compatible with smartphoneBluetoothTrilateral positioning<22D300.4YesWiFiFingerprint positioning<22D500.6YesPDRTrack estimation<42D//YesUWBTrilateral positioning<0.043D10060NoAcousticsTrilateral positioning<0.33D600.9YesThe comparison shows the advantages of PDR over other indoor positioning solutions, but it is rarely used alone for positioning in complex scenes. The main reason is that PDR positioning has good short-distance positioning accuracy, but errors are accumulated due to long-term operation. Most scholars have researched these two aspects to reduce the cumulative error in PDR positioning and improve the positioning accuracy. One solution is to combine PDR with other positioning methods to improve the positioning accuracy, such as Bluetooth low energy (BLE)/PDR fusion [13], PDR/WiFi fusion [14], PDR/WiFi/geomagnetic fusion, and other methods [15]. However, positioning infrastructure is required, which increases and is not conducive to large-scale applications. Another solution is to reduce the cumulative error using step detection, stride length estimation, and heading determination to reduce the impact of noise [16]. This approach reduces the error accumulation but fails to eliminate the root cause of the error. In addition, in previous PDR positioning research, the default smartphone was rigidly linked to the user, i.e., the user holds the smartphone for PDR positioning. Numerous studies were conducted on the smartphone’s position and attitude and user movement in PDR positioning [17, 18]. Although many optimization methods exist for PDR positioning, we believe that the optimal PDR positioning method should reduce the error accumulation and the cost to achieve the most practical and cost-effective solution.In addition to optimizing the PDR positioning method, it is also necessary to investigate the infrastructure necessary for indoor positioning applications, such as schools, hospitals, and large commercial shopping centers. Besides the standard public WiFi and visible light equipment, audio playback equipment used for broadcasting is often ignored. Audio equipment is widely deployed in indoor locations, supporting the positioning method proposed in this article. This article proposes a PDR positioning method based on an acoustic source for positioning correction using dual-microphone smartphones. The main contributions of this article are as follows:(1)
We propose a practical and cost-effective indoor positioning method that is suitable for multiple buildings and large areas. The method introduces pedestrian movement behavior recognition to improve PDR localisation accuracy, while using acoustic source localisation to reverse the cumulative error of PDR localisation(2)
We propose an acoustic localisation algorithm based on Hamming distance. The algorithm uses pseudoultrasonic sound, which is inaudible to the human ear and can be processed by ordinary speakers and microphones, at frequencies between 18 kHz and 20 kHz as the localisation signal. And use the known position of the sound source to correct the estimated position, in order to achieve the purpose of eliminating the accumulated error of PDR positioning(3)
We propose a method to improve the accuracy of PDR localisation using pedestrian movement behavior recognition. The method uses the proposed method based on gait periodicity features proposed in this paper to extract features from the data collected by smartphones, uses support vector machine (SVM) as a classifier to recognize the movement behavior of each gait, and uses Dempster–Shafer (D-S) evidence theory to fuse the recognition results for the problem of low recognition accuracy in certain complex scenes, improving the overall recognition accuracy to 96%. Based on the excellent recognition accuracy, this paper improves the stride length estimation for PDR localization and eliminates the cumulative error of PDR localization using map matchingThis paper is organized as follows: Section2 describes the related work of PDR positioning, pseudoultrasonic positioning, and acoustic source positioning based on dual-microphone smartphones. Section 3 presents the proposed system framework. In Section 4, we introduce the methods, and Section 5 describes the experiments. Section 6 provides the conclusion and future work.


## 2. Related Works

PDR positioning requires the establishment of an integral equation; thus, minimizing or eliminating the accumulated errors has been a research focus. Studies have shown [13–15] that fusion methods have several advantages and can significantly reduce the accumulated error of PDR positioning. The disadvantage is that the infrastructure needs to be deployed in advance, which requires access to the facilities and increases the costs. The optimization of the PDR algorithm includes the optimization of the step detection part [19, 20] or the continuous iteration of the step estimation model [15, 21, 22]. The advantage of PDR optimization is the minimization of the error generated in each step, which reduces the cumulative error. However, the disadvantage is that the cumulative error cannot be entirely eliminated.Scholars have used PDR positioning in increasingly complex scenarios in addition to efforts to eliminate the accumulated error. Most previous PDR studies assumed that the smartphone remained in the same position (maintain a horizontal hand-held position) at different pedestrian locations, the person and the smartphone were rigidly connected, and the positioning area was two-dimensional. In real-world conditions, the behavior of pedestrians is complex and variable. In other words, pedestrians may walk, run, or go up and downstairs in an indoor environment, and the smartphone may be placed horizontally in front of the chest, held by the hand, or placed in a pocket. Researchers often ignore these variable conditions, resulting in a single PDR positioning scenario and significant use limitations. Dirican and Aksoy [23] proposed a spectrum analysis method based on fast Fourier transform (FFT) for step detection to convert the time-domain information of the step frequency to the frequency domain to deal with more complex application scenarios. However, this approach requires a fixed time window, making it impossible to identify walking at different speeds accurately. Mohssen et al. [24] analyzed scenarios where the pedestrian heading direction was inconsistent with the device and proposed a heading estimation model based on principal component analysis. This method improved the PDR positioning accuracy in different scenarios. However, only a two-dimensional structure was considered.Scholars have also used machine learning methods to solve this problem due to recent developments in this field. References [11, 17, 25, 26] used different classification methods, such as K-nearest neighbor, dynamic time warping, SVMs, neural networks, decision trees, and hidden Markov model to analyze acceleration, angular velocity, and magnetic field strength related to pedestrian behavior recognition. Wang et al. [17] separated the recognition of pedestrian movement/behavior into two steps: recognition of the smartphone pose (hold, calling, swinging, and pocket) and recognition of the pedestrian movement (walk, run, upstairs, and downstairs). SVM and decision tree were used to detect the pedestrian movements and smartphone pose with a recognition rate of 92.4%. The authors used only PDR positioning and reduced the positioning error in a 164 m trajectory to 3.5 m for different pedestrian movements and smartphone poses.The improvement in the PDR positioning accuracy for pedestrian movement recognition requires optimization of the PDR algorithm. Therefore, it is essential to develop low-cost positioning methods and eliminate the accumulated error of PDR. Acoustic positioning has a lower equipment cost than other smartphone-based positioning methods. Therefore, this approach has attracted the interest of many research teams. Acoustic-based indoor positioning can be divided into three categories: time of arrival (TOA), time difference of arrival (TDOA), and difference of arrival (DOA) methods. In the past ten years, several acoustic positioning methods have emerged, such as the ASSIST positioning system proposed by Höflinger et al. in 2012 [27]. It uses acoustic signals in the 18 kHz-21 kHz frequency band and the TDOA positioning principle to increase the positioning accuracy to 0.26 m. The GuoGuo positioning system proposed by Liu et al. [28] in 2015 uses acoustic signals in the 17 kHz-22 kHz frequency band and the TOA positioning principle to increase the positioning accuracy to 0.25 m in a static scene. In the past two years, the research group led by Wang et al. at Zhejiang University used acoustic signals in the frequency band of 20 kHz, resulting in high accuracy [12, 29]. Acoustic signals in the frequency band of 20 kHz have unique ultrasonic characteristics, i.e., strong anti-interference ability, as well as broader transmission than other ultrasonic wavelengths. Since ultrasonic wavelengths are not perceived by humans, there is no danger of noise pollution. Therefore, pseudoultrasound is suitable for use as positioning signals.Few studies were conducted on acoustic source localization using dual-microphone smartphones. Acoustic source localization is different from acoustic-based indoor positioning in that acoustic source localization is used to locate the location of the acoustic emitting source, while acoustic-based indoor positioning uses acoustic as a positioning signal for information transmission to achieve the purpose of localization. These two are essentially different elements. The acoustic source localization principle is to use the dual microphones of smartphones to create a microphone array. The localization method is the same as for acoustic source localization of a microphone array. For example, Jin et al. [30, 31] used a dual-microphone smartphone, a Hamming window, and weighted probability to achieve acoustic source localization accuracy of 0.19 m in a static scene. This study uses a dual-microphone smartphone for acoustic source localization in dynamic scenarios to eliminate the cumulative error of PDR localization.


## 3. System Overview

The proposed system framework consists of three parts: pedestrian movement behavior recognition, PDR positioning, and PDR positioning correction. The smartphone represents the system input, and the current pedestrian position is the output. The system block diagram is shown in Figure1.Figure 1
The system block diagram. The data are collected by the smartphone, and the estimated position is the output.In PDR positioning, the estimated position of thek-th step of the walking pedestrian can be expressed as an integral equation:(1)xk^yk^=x0y0+∑i=1kLi^·sinθi^cosθi^,where xk^yk^ represents the estimated position of the k-th step, x0y0 represents the initial position, Li^ is the estimated step length of the i-th step, and θi^ is the estimated heading angle of the i-th step. The cumulative error is expressed independently by rewriting Equation (1) as:(2)xk^yk^=x0y0+∑i=1kLi·sinθicosθi+∑i=1kΔxiΔyi,where Li represents the step length of the i-th step, and ΔxiΔyi represents the position estimation error of the i-th step. In this article, we consider the primary error source of the position estimation the step size estimation term when the heading angle estimation error is small; thus,(3)min∑i=1kΔxiΔyi=min∑i=1kΔLi·sinθicosθi.The proposed pedestrian movement behavior recognition method adaptively estimates the step length for 16 combinations of pedestrian movements and smartphone poses, reducing the step length term’s cumulative error.Although the recognition of the pedestrian movement behavior can reduce the cumulative error of PDR positioning, the error is not entirely eliminated. Therefore, we incorporate two global optimization items: map matching and acoustic source localization. Therefore, Equation (1) can be expressed as:(4)xk^yk^=x0y0+∑i=1kLi·sinθicosθi+∑i=1kΔLi·sinθicosθi−∑i=1nxLyL−∑i=1pxAyA,where ∑i=1nxLyL represents the position coordinate parameter that needs to be corrected after n times of map matching, ∑i=1pxAyA represents the position coordinate parameter that needs to be adjusted after p times of acoustic source positioning correction.


## 4. Pedestrian Dead Reckoning (PDR)

The PDR system comprises three parts: step detection, stride length estimation, and heading determination, and all three parts contain errors. Most previous studies assumed that the smartphone was rigidly connected to the human body. However, this state does not apply in actual scenarios. This section describes the method of using pedestrian movement behavior recognition to improve the stride length estimation accuracy of PDR positioning. In addition, a map matching algorithm is used to distinguish moving upstairs and downstairs to eliminate the cumulative error of the PDR.


## 5. Movement Behavior Recognition

The proposed pedestrian movement behavior recognition method is described in detail in one of our recent conference papers. This section describes the details of this method. We divide the pedestrian movement behavior recognition into smartphone pose recognition and pedestrian movement recognition. We believe that a nonmoving pedestrian does not have to be considered in indoor positioning because the sensor of the smartphone does not record movement, and no positioning errors are created. Thus, this state will be discussed separately. The categories of pedestrian movement behavior recognition considered in this article are shown in Figure2.Figure 2
Schematic diagram of the recognition category of the pedestrian movement behavior. Four pedestrian movements and four smartphone poses are considered in pairs, resulting in 16 pedestrian movement behavior types.


### 5.1. Smartphone Pose Recognition

Compared with PCs, smartphones have limited computing capabilities. Therefore, complex machine learning algorithms used in smartphone pose recognition will significantly increase the system’s calculations, which is not conducive to the fast and stable operation of the system. The internal resources of smartphones are often not considered for implementing functions. For example, Android smartphones have many built-in sensors, referred to as hardware sensors. Therefore, the Android kernel functions are accessible; those are referred to as software sensors. A software sensor performs calculations using data obtained from hardware sensors. An example is the angle sensor.On the Android platform, the angle sensor is called “TYPE_ORIENTATION.” The official document shows that it provides the device’s pitch and rotation (roll). Therefore, we can use clustering to obtain the smartphone pose, as expressed in Equation (5):(5)PhonePose=Holding,x11<pitch<x12,y11<pitch<y12;Calling,x21<pitch<x22,y21<pitch<y22;Swinging,x31<pitch<x32,y31<pitch<y32;Pocket,x41<pitch<x42,y41<pitch<y42,where xi1 and xi2i=1,2,3,4 represent the upper and lower limits of the pitch angle, and yi1 and yi2i=1,2,3,4 represent the upper and lower limits of the roll angle, respectively.


### 5.2. Feature Extraction

We use the feature extraction method described in our previous paper [32]. It is based on the periodicity of pedestrian movement, and the acceleration and angular velocity data are segmented and transformed into feature vectors. This section discusses the use of this method in this study. The proposed method’s advantages over commonly used sliding window methods for feature extraction are as follows: (a) the sliding window method commonly uses a redundant design to avoid data leakage. The proposed method does not use this approach, improving the system’s operating efficiency. (b) The eigenvectors obtained after segmentation include the acceleration and angular velocity information of each gait, providing information on the movement behavior at each gait. The vector length maps the gait frequency, resulting in a high recognition rate of the movement behavior with few dimensional features. (c) The pedestrian movement behavior in each gait can be determined accurately.


### 5.3. State Recognition Algorithm of the Movement Transition Zone Based on SVM and D-S Evidence Theory

In complex positioning scenarios such as connected buildings, stairs are located at the buildings’ junctions and between floors. Therefore, pedestrians need to change their movement states continually. The previous discussion shows that we can accurately recognize the pedestrian’s current movement state. However, when the pedestrian transitions between different movements, a transition zone occurs, leading to recognition errors. We use an SVM and D-S evidence theory to reduce these errors.Few scholars investigated the errors occurring in the transition between different states, but this error exists and reduces the positioning accuracy. Figure3(a) shows typical stairs in connected buildings, Figure 3(b) is a schematic diagram of the longitudinal section of the stairs, and Figure 3(c) shows the acceleration curve as a pedestrian is walking on the stairs. When the pedestrians are walking on level ground and the stairs, the acceleration curve shows periodicity, and when a transition occurs between walking on level ground and the stairs, the acceleration value curve shows fewer fluctuations. Therefore, it is difficult to identify the current state of motion accurately, and we confirmed this in experiments.Figure 3
Schematic diagram of the scene. (a) Typical stairs found in connected buildings. (b) Longitudinal section view of stairs. (c) Curve of acceleration values as a pedestrian is walking on the stairs.
(a)(b)(c)Although this process is concise, and there are only two or three steps that cause errors, we believe that the stride lengths are different when the pedestrian walks downstairs or upstairs. If we mistakenly use the wrong stride length for walking downstairs, the error of each step is close to 0.5 m, significantly increasing the positioning error.The first condition for using the map matching algorithm to eliminate the cumulative error (this is discussed in the next section) is to obtain an accurate position of the current landmark. Therefore, it is crucial in this study to detect the transition between different movement states of the pedestrian. The DS evidence theory is an uncertainty reasoning method. It uses multiple inaccurate judgments and descriptions of problems, focuses on consistent information, and eliminates and integrates contradictory information to determine inaccurate conclusions. Therefore, the combination of D-S evidence theory and SVM is well suited to identify the transition zone between different movement states. The algorithm framework of this approach has been described in our previous papers. Here, we only discuss the specific application of the algorithm. The pseudocode of the algorithm is shown in Algorithm1.Algorithm 1: Algorithm for detecting the movement transition zone based on D-S evidence theory and SVM.
Input: The movement state of the pedestrian’s current gait;Output: Update the movement state of the first 5 steps of the pedestrian’s current gait.1: Determine the current movement stateif movement state = upstairs or downstairs1.1: for i =1 to 5 do:1.2: Fusion of all categories:1.2.1: Set A=Walk, B=Upstairs, C=Downstairs;1.2.2: for n =1 to 3 do:1.2.2.1:if n =1, X = A;else if n =2, X = B;else if n =3, X = C;end if1.2.2.2: ObtainPjxi∣x∈Xj=SVM1orSVM2;1.2.2.3: ObtainPjxi∣x∉X,j=SVM1orSVM2;1.2.3.4: ObtainPjxi∣x∉Unkownj=SVM1orSVM2;1.2.3: end1.3: Fusion between categories:1.3.1: Obtain the probabilityPix∣x∈A,Pix∣x∈B,Pix∣x∈C1.4: Decision output.1.5: endend if2: Update the first 5 steps of the movement stateIn Algorithm1, SVM1 in 1.2.2.2 represents a classifier constructed using acceleration data, and SVM2 represents a classifier constructed using angular velocity; Pjxi∣x∈X represents the probability of the current event x input event X (X = Walk\Upstairs\Downstairs), j represents the classifiers difference, and n represents the events difference. Pix∣x∈A represents the probability that the i-th step of the current output belongs to walk\upstairs\downstairs.


### 5.4. Stride Length Estimation Based on Pedestrian Movement Behavior Recognition

In Section3, we listed the primary sources of position estimation errors. Equation (3) indicates that the stride length estimation error has a more significant impact on the overall error when the heading angle estimation error is small.If the pedestrian’s movement state from stepj to l in k steps is the upstairs movement state when the movement state of the pedestrian is not recognized, we will mistakenly classify it as the walking state. The stride length of normal adults is 0.6 m-0.8 m during walking, whereas the stride length on the stairs is only about 0.2 m; the resulting error is usually tens of meters. Therefore, the proposed pedestrian movement/behavior recognition method has high accuracy.The stride length estimation algorithm is continuously updated with the development of PDR technology. The most commonly used algorithm is the stride length optimal parameter estimation algorithm proposed by Shin et al. in 2011. The stride length is defined as:(6)StrideLength=α·f+β·σ2+γ,where f is the step frequency, i.e., f=1/△T; σ2 is the acceleration mode variance; α and β are the parameter weights, and γ is a compensation constant. Although this algorithm is more flexible than linear and nonlinear stride length estimation algorithms, the α and β parameters are often fixed, which is not suitable for pedestrians performing complex activities.In the pedestrian movement behavior recognition, we consider four movements (walk, run, upstairs, and downstairs) and four smartphone poses (holding, calling, swinging, and pocket). The 16 pedestrian behaviors had different parameters. The pseudocode of the stride length estimation algorithm is shown in Algorithm2.Algorithm 2: Adaptive stride length estimation.
Input: The movement state of the pedestrian’s current gait.Output: The stride length of the pedestrian’s current gait.1: Determine theα and β parameters in different movement behavior statesswitch smartphone pose:case holding:switch movement state:case walk:α=αhw;β=βhw;caserun:α=αhr;β=βhr;caseupstairs:α=αhu;β=βhu;casedownstairs:α=αhd;β=βhd;(Process 1case downstairs:α = αhd; β = βhd;case calling:switch movement state:Same process 1;case swinging:switch movement state:Same process 1;case pocket:switch movement state:Same process 1;end2: Substituteα and β into Equation (6)


### 5.5. Cumulative Error Elimination in PDR

#### 5.5.1. Cumulative Errors Based on Map Matching

In indoor positioning, a geometric algorithm is commonly used for map matching. It uses the map’s geometric information to extract points on the path corresponding to the position information. The geometric relationship between the current position information and the path network is analyzed [33]. There are three methods to implement geometric algorithms: point-to-point matching, point-to-arc matching, and arc-to-arc matching. Since we use line segments, point-to-arc matching is used for map matching. In this method, we find the line segment closest to the estimated point on the map, obtain the vertical line from the estimated point to the line segment, and use the vertical foot as a new estimated point. The matching process can be expressed as:(7)Distance=XcurrentX2−X1+YcurrentY2−Y1+Y2−Y1X1Y2−X2Y1X2−X12+Y2−Y12,(8)Xrevise=XcurrentX2−X1+YcurrentY2−Y1+Y2−Y1X1Y2−X2Y1X2−X12+Y2−Y12X2−X1−1,(9)Yrevise=XcurrentX2−X1+YcurrentY2−Y1+Y2−Y1X1Y2−X2Y1X2−X12+Y2−Y12Y2−Y1−1,whereXcurrent,Ycurrent represents the estimate of the current PDR position, and X1,Y1 and X2,Y2 represent the starting coordinates of a given line segment in the map database. The distance in Equation (7) is used to calculate the distance between Xcurrent,Ycurrent and each line segment. The line segment with the shortest distance is obtained by projecting Xcurrent,Ycurrent into the line segment using the foot position Xrevise,Yrevise in Equations (8) and (9). Subsequently, the position coordinates are updated.We assume the scene illustrated in Figure4. Building I and Building II make up the height difference between them by means of stairs A and B. In this scenario, a pedestrian takes N steps to walk a circle and encounters stairs A and B (in m) at the k‐th and p‐th steps.Figure 4
Schematic diagram of the scene. Start from the starting point and walk along the running track, passing through two stairs, to the end.First, the cumulative error generated inN steps can be obtained by Equation (3):(10)ErrorN=∑i=1NΔLi·sinθicosθi.For the convenience of presentation, we normalize the cumulative error generated inN steps to obtain:(11)Error¯=∑i=1NΔLi·sinθicosθiN.After using map matching, the cumulative error withinn0≤n≤N steps can be expressed as:(12)Error=Error¯·k,0≤n≤k;Error¯·p−k+Errormap1,k≤n≤p;Error¯·N−p+Errormap2,p≤n≤N,where Errormap1 and Errormap2 represent the positioning error generated when the map is matched in the k‐th and p‐th steps. After map matching, the global cumulative error becomes the error of the endpoint:(13)ErrorN=Error¯·N−p+Errormap2.Therefore, the objective of map matching is to eliminate the cumulative error at the matching point; thus, the error depends on the number and layout of the matching points. However, the amount of landmark information in the positioning environment is limited, and the layout of landmark information is fixed. Therefore, a more flexible cumulative error elimination method is needed. In this study, we use acoustic source localization eliminate.


#### 5.5.2. PDR with Acoustic Source Localization Correction

This correction method uses a dual-microphone smartphone as a microphone array to receive acoustic signals. Multiple signals are received by the pedestrians’ smartphones, and an acoustic source localization algorithm based on the Hamming distance is used. If the sound source positioning’s accuracy meets the requirements and the acoustic source’s position is known, the PDR positioning can be corrected to eliminate the accumulated error.


#### 5.5.3. Acoustic Source Data Association

There are multiple different acoustic sources in the localization environment, and when a mobile phone collects audio data, it collects data from multiple acoustic sources. Moreover, each acoustic source used to correct the PDR data has a fixed position; thus, the mobile phone has to distinguish different acoustic sources and associate them with the position information. Our solution has the following approach:(1)
We used pseudoultrasound as the acoustic signal to increase the system’s anti-interference ability. Pseudoultrasound refers to an acoustic frequency range of 18 kHz-20 kHz. Humans cannot hear this sound, but ordinary speakers and microphones can acquire the acoustic signal. The pseudoultrasonic signal has the advantages of strong anti-interference, strong privacy, and no noise interference audible to humans. Unlike ultrasonic signals, pseudoultrasonic signals can be received using standard audio equipment, no unique ultrasonic signal is needed, and the propagation distance is longer than for ultrasonic signals(2)
We used self-developed hardware to broadcast pseudoultrasonic signals with location information. The self-developed hardware was connected in series to the speaker and consisted of the central control unit, a DDS module, and a bandpass filter. The main control module determines if the speaker is occupied. If it is not occupied, the DDS module generates a pseudoultrasonic signal with position coordinates and sends it out through the bandpass filter that is linked with the speaker. In Figure5(a), we show the connection diagram of each module. Further, we formed the preliminary product, as shown in Figure 5(b). Figure 5(c) shows the PCB (printed circuit board, PCB) diagram of our productFigure 5
The physical connection. (a) The photo shows the connection. (b) Physical picture of the product. (c) PCB diagram.
(a)(b)(c)


#### 5.5.4. Acoustic Source Localization Algorithm Based on Hamming Distance

At present, most smartphones are equipped with dual microphones for noise reduction and other functions. For example, in the Android system, the dual microphones are strictly clock-synchronized when collecting audio signals. The pseudoultrasonic frequency range is 18 kHz-20 kHz with a wavelength of about 17 mm. Therefore, even if the distance between the two microphones of the mobile phone is short, the TDOA can be calculated using the time difference of the acoustic signal. The acoustic source localization algorithm based on the Hamming distance consists of five steps: spatial gridding, generating a regional Hamming code, generating the acoustic source location Hamming code, matching the Hamming code, and calculating the acoustic source location.(1) Spatial Gridding. When a pedestrian’s mobile phone receives a valid acoustic signal, it records the coordinates of the source in a grid and obtains several discrete grid points.(2) Generating the Area Hamming Code. When pedestrians are walking, the positioning area can be divided into two in a clockwise direction to determine the position and pose of the mobile phone. The left side is marked as 0, and the right side is marked as 1. Therefore, if a pedestrian walks M steps, we divide the positioning area into several small areas, each of which has a binary code of length M. The grid points of each small area also have the binary code of the small area.(3) Generating the Acoustic Source Location Hamming Code. In this study, we binarize the TDOA value to increase the system’s robustness, i.e., we use the vertical line of the mobile phone as the boundary. When moving in a clockwise direction, the acoustic source is denoted as 0 if it is on the left part of the vertical line (the TDOA has a negative value) and as 1 if it is on the right side of the vertical line (the TDOA has a positive value). Thus, if a pedestrian walks M steps, a binary code of length M is generated, indicating the area of the acoustic source.(4) Matching the Hamming Code. We match the acoustic source location Hamming code with the regional Hamming code to determine the small area with the closest Hamming distance.(5) Calculating the Acoustic Source Position. By matching the Hamming code, the acoustic source position can be reduced to a small area. However, since all grid points in the small area have the same binary code, the Hamming distance is the same for all the points in the small area. The average of the grid point positions is used as the estimated position of the acoustic source. However, the robustness of this method is too strong; thus, we use the methods in Refs. [30, 31] and use the proportional relationship between the Hamming distance and the actual distance for all grid points in the area. The source location Hamming code has different weights (the weight is inversely proportional to the Hamming distance). Therefore, the acoustic source position is determined by all grid points rather than the point with the smallest Hamming distance. We use a Gaussian function to obtain the weights of all grid points:(14)ωi=e−HDT,Di/Mσi,where HDT,Di is the Hamming distance between the acoustic source location Hamming code and the spatial grid point ii=0,1,2⋯p, and σ is the weighting parameter. We normalize Equation (14) to obtain:(15)ωi¯=ωi∑i=1pωi.The final acoustic source positionSxA,yA based on all grid point coordinates pixi,yi as:(16)S=∑i=1pωi¯·pi.


#### 5.5.5. Elimination of the Cumulative Error in PDR Positioning

As shown in Figure6, the mobile phone of the pedestrian receives the audio information and records the pedestrian’s position as xj^,yj^. The acoustic source position xA^,yA^ is recorded for M steps, and xA^,yA^ is calculated at each step’s position. PDR expresses the position xk^,yk^ of any step k in the M steps as an expression of xj^,yj^, as shown in Equation (17).(17)xk^yk^=xj^yj^+∑i=jMLj^·sinθicosθi.Figure 6
Schematic diagram of the acoustic source localization scene. The pedestrians are walking near the acoustic source with their smartphones.In the same way, the observed acoustic source positionxA^,yA^ is represented by xj^,yj^. If the accuracy of the observed acoustic source position meets the expectations, xA^,yA^ is approximately equal to xA,yA. The position xj^,yj^ is updated with the known acoustic source position information to obtain the coordinate xj′,yj′ after the cumulative error has been eliminated. This method takes advantage of the high short-term accuracy of PDR positioning. There is already a cumulative error in the xj^,yj^ position. However, due to the short running time of the PDR in M steps, the cumulative error is not large enough to affect the overall system; thus, it can be ignored.Further, we analyze the PDR localization accuracy based on the correction of the acoustic source localization. We use Equations (10)–(12), and the latter is transformed as follows after performing the acoustic source localization correction:(18)Error=Error¯·k,0≤n≤k;Error¯·t−k+Errormap1,k≤n≤t;Error¯·p−t++Erroracoustic1,t≤n≤p;Error¯·r−p+Errormap2,p≤n≤r;Error¯·N−r+Erroracoustic2,r≤n≤N,where Erroracoustic1 and Erroracoustic2 represent the positioning errors caused by the acoustic source positioning correction in the first and second step. After using the acoustic source localization method, the global localization error is changed to a piecewise error. By segmenting the accumulated error, the large error can be decomposed into several smaller errors, minimizing the global cumulative error. The results show that the proposed PDR positioning method based on acoustic source positioning correction provides relatively good positioning accuracy. The final positioning error is(19)ErrorN=Error¯·N−r+Erroracoustic2.


## 5.1. Smartphone Pose Recognition

Compared with PCs, smartphones have limited computing capabilities. Therefore, complex machine learning algorithms used in smartphone pose recognition will significantly increase the system’s calculations, which is not conducive to the fast and stable operation of the system. The internal resources of smartphones are often not considered for implementing functions. For example, Android smartphones have many built-in sensors, referred to as hardware sensors. Therefore, the Android kernel functions are accessible; those are referred to as software sensors. A software sensor performs calculations using data obtained from hardware sensors. An example is the angle sensor.On the Android platform, the angle sensor is called “TYPE_ORIENTATION.” The official document shows that it provides the device’s pitch and rotation (roll). Therefore, we can use clustering to obtain the smartphone pose, as expressed in Equation (5):(5)PhonePose=Holding,x11<pitch<x12,y11<pitch<y12;Calling,x21<pitch<x22,y21<pitch<y22;Swinging,x31<pitch<x32,y31<pitch<y32;Pocket,x41<pitch<x42,y41<pitch<y42,where xi1 and xi2i=1,2,3,4 represent the upper and lower limits of the pitch angle, and yi1 and yi2i=1,2,3,4 represent the upper and lower limits of the roll angle, respectively.


## 5.2. Feature Extraction

We use the feature extraction method described in our previous paper [32]. It is based on the periodicity of pedestrian movement, and the acceleration and angular velocity data are segmented and transformed into feature vectors. This section discusses the use of this method in this study. The proposed method’s advantages over commonly used sliding window methods for feature extraction are as follows: (a) the sliding window method commonly uses a redundant design to avoid data leakage. The proposed method does not use this approach, improving the system’s operating efficiency. (b) The eigenvectors obtained after segmentation include the acceleration and angular velocity information of each gait, providing information on the movement behavior at each gait. The vector length maps the gait frequency, resulting in a high recognition rate of the movement behavior with few dimensional features. (c) The pedestrian movement behavior in each gait can be determined accurately.


## 5.3. State Recognition Algorithm of the Movement Transition Zone Based on SVM and D-S Evidence Theory

In complex positioning scenarios such as connected buildings, stairs are located at the buildings’ junctions and between floors. Therefore, pedestrians need to change their movement states continually. The previous discussion shows that we can accurately recognize the pedestrian’s current movement state. However, when the pedestrian transitions between different movements, a transition zone occurs, leading to recognition errors. We use an SVM and D-S evidence theory to reduce these errors.Few scholars investigated the errors occurring in the transition between different states, but this error exists and reduces the positioning accuracy. Figure3(a) shows typical stairs in connected buildings, Figure 3(b) is a schematic diagram of the longitudinal section of the stairs, and Figure 3(c) shows the acceleration curve as a pedestrian is walking on the stairs. When the pedestrians are walking on level ground and the stairs, the acceleration curve shows periodicity, and when a transition occurs between walking on level ground and the stairs, the acceleration value curve shows fewer fluctuations. Therefore, it is difficult to identify the current state of motion accurately, and we confirmed this in experiments.Figure 3
Schematic diagram of the scene. (a) Typical stairs found in connected buildings. (b) Longitudinal section view of stairs. (c) Curve of acceleration values as a pedestrian is walking on the stairs.
(a)(b)(c)Although this process is concise, and there are only two or three steps that cause errors, we believe that the stride lengths are different when the pedestrian walks downstairs or upstairs. If we mistakenly use the wrong stride length for walking downstairs, the error of each step is close to 0.5 m, significantly increasing the positioning error.The first condition for using the map matching algorithm to eliminate the cumulative error (this is discussed in the next section) is to obtain an accurate position of the current landmark. Therefore, it is crucial in this study to detect the transition between different movement states of the pedestrian. The DS evidence theory is an uncertainty reasoning method. It uses multiple inaccurate judgments and descriptions of problems, focuses on consistent information, and eliminates and integrates contradictory information to determine inaccurate conclusions. Therefore, the combination of D-S evidence theory and SVM is well suited to identify the transition zone between different movement states. The algorithm framework of this approach has been described in our previous papers. Here, we only discuss the specific application of the algorithm. The pseudocode of the algorithm is shown in Algorithm1.Algorithm 1: Algorithm for detecting the movement transition zone based on D-S evidence theory and SVM.
Input: The movement state of the pedestrian’s current gait;Output: Update the movement state of the first 5 steps of the pedestrian’s current gait.1: Determine the current movement stateif movement state = upstairs or downstairs1.1: for i =1 to 5 do:1.2: Fusion of all categories:1.2.1: Set A=Walk, B=Upstairs, C=Downstairs;1.2.2: for n =1 to 3 do:1.2.2.1:if n =1, X = A;else if n =2, X = B;else if n =3, X = C;end if1.2.2.2: ObtainPjxi∣x∈Xj=SVM1orSVM2;1.2.2.3: ObtainPjxi∣x∉X,j=SVM1orSVM2;1.2.3.4: ObtainPjxi∣x∉Unkownj=SVM1orSVM2;1.2.3: end1.3: Fusion between categories:1.3.1: Obtain the probabilityPix∣x∈A,Pix∣x∈B,Pix∣x∈C1.4: Decision output.1.5: endend if2: Update the first 5 steps of the movement stateIn Algorithm1, SVM1 in 1.2.2.2 represents a classifier constructed using acceleration data, and SVM2 represents a classifier constructed using angular velocity; Pjxi∣x∈X represents the probability of the current event x input event X (X = Walk\Upstairs\Downstairs), j represents the classifiers difference, and n represents the events difference. Pix∣x∈A represents the probability that the i-th step of the current output belongs to walk\upstairs\downstairs.


## 5.4. Stride Length Estimation Based on Pedestrian Movement Behavior Recognition

In Section3, we listed the primary sources of position estimation errors. Equation (3) indicates that the stride length estimation error has a more significant impact on the overall error when the heading angle estimation error is small.If the pedestrian’s movement state from stepj to l in k steps is the upstairs movement state when the movement state of the pedestrian is not recognized, we will mistakenly classify it as the walking state. The stride length of normal adults is 0.6 m-0.8 m during walking, whereas the stride length on the stairs is only about 0.2 m; the resulting error is usually tens of meters. Therefore, the proposed pedestrian movement/behavior recognition method has high accuracy.The stride length estimation algorithm is continuously updated with the development of PDR technology. The most commonly used algorithm is the stride length optimal parameter estimation algorithm proposed by Shin et al. in 2011. The stride length is defined as:(6)StrideLength=α·f+β·σ2+γ,where f is the step frequency, i.e., f=1/△T; σ2 is the acceleration mode variance; α and β are the parameter weights, and γ is a compensation constant. Although this algorithm is more flexible than linear and nonlinear stride length estimation algorithms, the α and β parameters are often fixed, which is not suitable for pedestrians performing complex activities.In the pedestrian movement behavior recognition, we consider four movements (walk, run, upstairs, and downstairs) and four smartphone poses (holding, calling, swinging, and pocket). The 16 pedestrian behaviors had different parameters. The pseudocode of the stride length estimation algorithm is shown in Algorithm2.Algorithm 2: Adaptive stride length estimation.
Input: The movement state of the pedestrian’s current gait.Output: The stride length of the pedestrian’s current gait.1: Determine theα and β parameters in different movement behavior statesswitch smartphone pose:case holding:switch movement state:case walk:α=αhw;β=βhw;caserun:α=αhr;β=βhr;caseupstairs:α=αhu;β=βhu;casedownstairs:α=αhd;β=βhd;(Process 1case downstairs:α = αhd; β = βhd;case calling:switch movement state:Same process 1;case swinging:switch movement state:Same process 1;case pocket:switch movement state:Same process 1;end2: Substituteα and β into Equation (6)


## 5.5. Cumulative Error Elimination in PDR

### 5.5.1. Cumulative Errors Based on Map Matching

In indoor positioning, a geometric algorithm is commonly used for map matching. It uses the map’s geometric information to extract points on the path corresponding to the position information. The geometric relationship between the current position information and the path network is analyzed [33]. There are three methods to implement geometric algorithms: point-to-point matching, point-to-arc matching, and arc-to-arc matching. Since we use line segments, point-to-arc matching is used for map matching. In this method, we find the line segment closest to the estimated point on the map, obtain the vertical line from the estimated point to the line segment, and use the vertical foot as a new estimated point. The matching process can be expressed as:(7)Distance=XcurrentX2−X1+YcurrentY2−Y1+Y2−Y1X1Y2−X2Y1X2−X12+Y2−Y12,(8)Xrevise=XcurrentX2−X1+YcurrentY2−Y1+Y2−Y1X1Y2−X2Y1X2−X12+Y2−Y12X2−X1−1,(9)Yrevise=XcurrentX2−X1+YcurrentY2−Y1+Y2−Y1X1Y2−X2Y1X2−X12+Y2−Y12Y2−Y1−1,whereXcurrent,Ycurrent represents the estimate of the current PDR position, and X1,Y1 and X2,Y2 represent the starting coordinates of a given line segment in the map database. The distance in Equation (7) is used to calculate the distance between Xcurrent,Ycurrent and each line segment. The line segment with the shortest distance is obtained by projecting Xcurrent,Ycurrent into the line segment using the foot position Xrevise,Yrevise in Equations (8) and (9). Subsequently, the position coordinates are updated.We assume the scene illustrated in Figure4. Building I and Building II make up the height difference between them by means of stairs A and B. In this scenario, a pedestrian takes N steps to walk a circle and encounters stairs A and B (in m) at the k‐th and p‐th steps.Figure 4
Schematic diagram of the scene. Start from the starting point and walk along the running track, passing through two stairs, to the end.First, the cumulative error generated inN steps can be obtained by Equation (3):(10)ErrorN=∑i=1NΔLi·sinθicosθi.For the convenience of presentation, we normalize the cumulative error generated inN steps to obtain:(11)Error¯=∑i=1NΔLi·sinθicosθiN.After using map matching, the cumulative error withinn0≤n≤N steps can be expressed as:(12)Error=Error¯·k,0≤n≤k;Error¯·p−k+Errormap1,k≤n≤p;Error¯·N−p+Errormap2,p≤n≤N,where Errormap1 and Errormap2 represent the positioning error generated when the map is matched in the k‐th and p‐th steps. After map matching, the global cumulative error becomes the error of the endpoint:(13)ErrorN=Error¯·N−p+Errormap2.Therefore, the objective of map matching is to eliminate the cumulative error at the matching point; thus, the error depends on the number and layout of the matching points. However, the amount of landmark information in the positioning environment is limited, and the layout of landmark information is fixed. Therefore, a more flexible cumulative error elimination method is needed. In this study, we use acoustic source localization eliminate.


### 5.5.2. PDR with Acoustic Source Localization Correction

This correction method uses a dual-microphone smartphone as a microphone array to receive acoustic signals. Multiple signals are received by the pedestrians’ smartphones, and an acoustic source localization algorithm based on the Hamming distance is used. If the sound source positioning’s accuracy meets the requirements and the acoustic source’s position is known, the PDR positioning can be corrected to eliminate the accumulated error.


### 5.5.3. Acoustic Source Data Association

There are multiple different acoustic sources in the localization environment, and when a mobile phone collects audio data, it collects data from multiple acoustic sources. Moreover, each acoustic source used to correct the PDR data has a fixed position; thus, the mobile phone has to distinguish different acoustic sources and associate them with the position information. Our solution has the following approach:(1)
We used pseudoultrasound as the acoustic signal to increase the system’s anti-interference ability. Pseudoultrasound refers to an acoustic frequency range of 18 kHz-20 kHz. Humans cannot hear this sound, but ordinary speakers and microphones can acquire the acoustic signal. The pseudoultrasonic signal has the advantages of strong anti-interference, strong privacy, and no noise interference audible to humans. Unlike ultrasonic signals, pseudoultrasonic signals can be received using standard audio equipment, no unique ultrasonic signal is needed, and the propagation distance is longer than for ultrasonic signals(2)
We used self-developed hardware to broadcast pseudoultrasonic signals with location information. The self-developed hardware was connected in series to the speaker and consisted of the central control unit, a DDS module, and a bandpass filter. The main control module determines if the speaker is occupied. If it is not occupied, the DDS module generates a pseudoultrasonic signal with position coordinates and sends it out through the bandpass filter that is linked with the speaker. In Figure5(a), we show the connection diagram of each module. Further, we formed the preliminary product, as shown in Figure 5(b). Figure 5(c) shows the PCB (printed circuit board, PCB) diagram of our productFigure 5
The physical connection. (a) The photo shows the connection. (b) Physical picture of the product. (c) PCB diagram.
(a)(b)(c)


### 5.5.4. Acoustic Source Localization Algorithm Based on Hamming Distance

At present, most smartphones are equipped with dual microphones for noise reduction and other functions. For example, in the Android system, the dual microphones are strictly clock-synchronized when collecting audio signals. The pseudoultrasonic frequency range is 18 kHz-20 kHz with a wavelength of about 17 mm. Therefore, even if the distance between the two microphones of the mobile phone is short, the TDOA can be calculated using the time difference of the acoustic signal. The acoustic source localization algorithm based on the Hamming distance consists of five steps: spatial gridding, generating a regional Hamming code, generating the acoustic source location Hamming code, matching the Hamming code, and calculating the acoustic source location.(1) Spatial Gridding. When a pedestrian’s mobile phone receives a valid acoustic signal, it records the coordinates of the source in a grid and obtains several discrete grid points.(2) Generating the Area Hamming Code. When pedestrians are walking, the positioning area can be divided into two in a clockwise direction to determine the position and pose of the mobile phone. The left side is marked as 0, and the right side is marked as 1. Therefore, if a pedestrian walks M steps, we divide the positioning area into several small areas, each of which has a binary code of length M. The grid points of each small area also have the binary code of the small area.(3) Generating the Acoustic Source Location Hamming Code. In this study, we binarize the TDOA value to increase the system’s robustness, i.e., we use the vertical line of the mobile phone as the boundary. When moving in a clockwise direction, the acoustic source is denoted as 0 if it is on the left part of the vertical line (the TDOA has a negative value) and as 1 if it is on the right side of the vertical line (the TDOA has a positive value). Thus, if a pedestrian walks M steps, a binary code of length M is generated, indicating the area of the acoustic source.(4) Matching the Hamming Code. We match the acoustic source location Hamming code with the regional Hamming code to determine the small area with the closest Hamming distance.(5) Calculating the Acoustic Source Position. By matching the Hamming code, the acoustic source position can be reduced to a small area. However, since all grid points in the small area have the same binary code, the Hamming distance is the same for all the points in the small area. The average of the grid point positions is used as the estimated position of the acoustic source. However, the robustness of this method is too strong; thus, we use the methods in Refs. [30, 31] and use the proportional relationship between the Hamming distance and the actual distance for all grid points in the area. The source location Hamming code has different weights (the weight is inversely proportional to the Hamming distance). Therefore, the acoustic source position is determined by all grid points rather than the point with the smallest Hamming distance. We use a Gaussian function to obtain the weights of all grid points:(14)ωi=e−HDT,Di/Mσi,where HDT,Di is the Hamming distance between the acoustic source location Hamming code and the spatial grid point ii=0,1,2⋯p, and σ is the weighting parameter. We normalize Equation (14) to obtain:(15)ωi¯=ωi∑i=1pωi.The final acoustic source positionSxA,yA based on all grid point coordinates pixi,yi as:(16)S=∑i=1pωi¯·pi.


### 5.5.5. Elimination of the Cumulative Error in PDR Positioning

As shown in Figure6, the mobile phone of the pedestrian receives the audio information and records the pedestrian’s position as xj^,yj^. The acoustic source position xA^,yA^ is recorded for M steps, and xA^,yA^ is calculated at each step’s position. PDR expresses the position xk^,yk^ of any step k in the M steps as an expression of xj^,yj^, as shown in Equation (17).(17)xk^yk^=xj^yj^+∑i=jMLj^·sinθicosθi.Figure 6
Schematic diagram of the acoustic source localization scene. The pedestrians are walking near the acoustic source with their smartphones.In the same way, the observed acoustic source positionxA^,yA^ is represented by xj^,yj^. If the accuracy of the observed acoustic source position meets the expectations, xA^,yA^ is approximately equal to xA,yA. The position xj^,yj^ is updated with the known acoustic source position information to obtain the coordinate xj′,yj′ after the cumulative error has been eliminated. This method takes advantage of the high short-term accuracy of PDR positioning. There is already a cumulative error in the xj^,yj^ position. However, due to the short running time of the PDR in M steps, the cumulative error is not large enough to affect the overall system; thus, it can be ignored.Further, we analyze the PDR localization accuracy based on the correction of the acoustic source localization. We use Equations (10)–(12), and the latter is transformed as follows after performing the acoustic source localization correction:(18)Error=Error¯·k,0≤n≤k;Error¯·t−k+Errormap1,k≤n≤t;Error¯·p−t++Erroracoustic1,t≤n≤p;Error¯·r−p+Errormap2,p≤n≤r;Error¯·N−r+Erroracoustic2,r≤n≤N,where Erroracoustic1 and Erroracoustic2 represent the positioning errors caused by the acoustic source positioning correction in the first and second step. After using the acoustic source localization method, the global localization error is changed to a piecewise error. By segmenting the accumulated error, the large error can be decomposed into several smaller errors, minimizing the global cumulative error. The results show that the proposed PDR positioning method based on acoustic source positioning correction provides relatively good positioning accuracy. The final positioning error is(19)ErrorN=Error¯·N−r+Erroracoustic2.


## 5.5.1. Cumulative Errors Based on Map Matching

In indoor positioning, a geometric algorithm is commonly used for map matching. It uses the map’s geometric information to extract points on the path corresponding to the position information. The geometric relationship between the current position information and the path network is analyzed [33]. There are three methods to implement geometric algorithms: point-to-point matching, point-to-arc matching, and arc-to-arc matching. Since we use line segments, point-to-arc matching is used for map matching. In this method, we find the line segment closest to the estimated point on the map, obtain the vertical line from the estimated point to the line segment, and use the vertical foot as a new estimated point. The matching process can be expressed as:(7)Distance=XcurrentX2−X1+YcurrentY2−Y1+Y2−Y1X1Y2−X2Y1X2−X12+Y2−Y12,(8)Xrevise=XcurrentX2−X1+YcurrentY2−Y1+Y2−Y1X1Y2−X2Y1X2−X12+Y2−Y12X2−X1−1,(9)Yrevise=XcurrentX2−X1+YcurrentY2−Y1+Y2−Y1X1Y2−X2Y1X2−X12+Y2−Y12Y2−Y1−1,whereXcurrent,Ycurrent represents the estimate of the current PDR position, and X1,Y1 and X2,Y2 represent the starting coordinates of a given line segment in the map database. The distance in Equation (7) is used to calculate the distance between Xcurrent,Ycurrent and each line segment. The line segment with the shortest distance is obtained by projecting Xcurrent,Ycurrent into the line segment using the foot position Xrevise,Yrevise in Equations (8) and (9). Subsequently, the position coordinates are updated.We assume the scene illustrated in Figure4. Building I and Building II make up the height difference between them by means of stairs A and B. In this scenario, a pedestrian takes N steps to walk a circle and encounters stairs A and B (in m) at the k‐th and p‐th steps.Figure 4
Schematic diagram of the scene. Start from the starting point and walk along the running track, passing through two stairs, to the end.First, the cumulative error generated inN steps can be obtained by Equation (3):(10)ErrorN=∑i=1NΔLi·sinθicosθi.For the convenience of presentation, we normalize the cumulative error generated inN steps to obtain:(11)Error¯=∑i=1NΔLi·sinθicosθiN.After using map matching, the cumulative error withinn0≤n≤N steps can be expressed as:(12)Error=Error¯·k,0≤n≤k;Error¯·p−k+Errormap1,k≤n≤p;Error¯·N−p+Errormap2,p≤n≤N,where Errormap1 and Errormap2 represent the positioning error generated when the map is matched in the k‐th and p‐th steps. After map matching, the global cumulative error becomes the error of the endpoint:(13)ErrorN=Error¯·N−p+Errormap2.Therefore, the objective of map matching is to eliminate the cumulative error at the matching point; thus, the error depends on the number and layout of the matching points. However, the amount of landmark information in the positioning environment is limited, and the layout of landmark information is fixed. Therefore, a more flexible cumulative error elimination method is needed. In this study, we use acoustic source localization eliminate.


## 5.5.2. PDR with Acoustic Source Localization Correction

This correction method uses a dual-microphone smartphone as a microphone array to receive acoustic signals. Multiple signals are received by the pedestrians’ smartphones, and an acoustic source localization algorithm based on the Hamming distance is used. If the sound source positioning’s accuracy meets the requirements and the acoustic source’s position is known, the PDR positioning can be corrected to eliminate the accumulated error.


## 5.5.3. Acoustic Source Data Association

There are multiple different acoustic sources in the localization environment, and when a mobile phone collects audio data, it collects data from multiple acoustic sources. Moreover, each acoustic source used to correct the PDR data has a fixed position; thus, the mobile phone has to distinguish different acoustic sources and associate them with the position information. Our solution has the following approach:(1)
We used pseudoultrasound as the acoustic signal to increase the system’s anti-interference ability. Pseudoultrasound refers to an acoustic frequency range of 18 kHz-20 kHz. Humans cannot hear this sound, but ordinary speakers and microphones can acquire the acoustic signal. The pseudoultrasonic signal has the advantages of strong anti-interference, strong privacy, and no noise interference audible to humans. Unlike ultrasonic signals, pseudoultrasonic signals can be received using standard audio equipment, no unique ultrasonic signal is needed, and the propagation distance is longer than for ultrasonic signals(2)
We used self-developed hardware to broadcast pseudoultrasonic signals with location information. The self-developed hardware was connected in series to the speaker and consisted of the central control unit, a DDS module, and a bandpass filter. The main control module determines if the speaker is occupied. If it is not occupied, the DDS module generates a pseudoultrasonic signal with position coordinates and sends it out through the bandpass filter that is linked with the speaker. In Figure5(a), we show the connection diagram of each module. Further, we formed the preliminary product, as shown in Figure 5(b). Figure 5(c) shows the PCB (printed circuit board, PCB) diagram of our productFigure 5
The physical connection. (a) The photo shows the connection. (b) Physical picture of the product. (c) PCB diagram.
(a)(b)(c)


## 5.5.4. Acoustic Source Localization Algorithm Based on Hamming Distance

At present, most smartphones are equipped with dual microphones for noise reduction and other functions. For example, in the Android system, the dual microphones are strictly clock-synchronized when collecting audio signals. The pseudoultrasonic frequency range is 18 kHz-20 kHz with a wavelength of about 17 mm. Therefore, even if the distance between the two microphones of the mobile phone is short, the TDOA can be calculated using the time difference of the acoustic signal. The acoustic source localization algorithm based on the Hamming distance consists of five steps: spatial gridding, generating a regional Hamming code, generating the acoustic source location Hamming code, matching the Hamming code, and calculating the acoustic source location.(1) Spatial Gridding. When a pedestrian’s mobile phone receives a valid acoustic signal, it records the coordinates of the source in a grid and obtains several discrete grid points.(2) Generating the Area Hamming Code. When pedestrians are walking, the positioning area can be divided into two in a clockwise direction to determine the position and pose of the mobile phone. The left side is marked as 0, and the right side is marked as 1. Therefore, if a pedestrian walks M steps, we divide the positioning area into several small areas, each of which has a binary code of length M. The grid points of each small area also have the binary code of the small area.(3) Generating the Acoustic Source Location Hamming Code. In this study, we binarize the TDOA value to increase the system’s robustness, i.e., we use the vertical line of the mobile phone as the boundary. When moving in a clockwise direction, the acoustic source is denoted as 0 if it is on the left part of the vertical line (the TDOA has a negative value) and as 1 if it is on the right side of the vertical line (the TDOA has a positive value). Thus, if a pedestrian walks M steps, a binary code of length M is generated, indicating the area of the acoustic source.(4) Matching the Hamming Code. We match the acoustic source location Hamming code with the regional Hamming code to determine the small area with the closest Hamming distance.(5) Calculating the Acoustic Source Position. By matching the Hamming code, the acoustic source position can be reduced to a small area. However, since all grid points in the small area have the same binary code, the Hamming distance is the same for all the points in the small area. The average of the grid point positions is used as the estimated position of the acoustic source. However, the robustness of this method is too strong; thus, we use the methods in Refs. [30, 31] and use the proportional relationship between the Hamming distance and the actual distance for all grid points in the area. The source location Hamming code has different weights (the weight is inversely proportional to the Hamming distance). Therefore, the acoustic source position is determined by all grid points rather than the point with the smallest Hamming distance. We use a Gaussian function to obtain the weights of all grid points:(14)ωi=e−HDT,Di/Mσi,where HDT,Di is the Hamming distance between the acoustic source location Hamming code and the spatial grid point ii=0,1,2⋯p, and σ is the weighting parameter. We normalize Equation (14) to obtain:(15)ωi¯=ωi∑i=1pωi.The final acoustic source positionSxA,yA based on all grid point coordinates pixi,yi as:(16)S=∑i=1pωi¯·pi.


## 5.5.5. Elimination of the Cumulative Error in PDR Positioning

As shown in Figure6, the mobile phone of the pedestrian receives the audio information and records the pedestrian’s position as xj^,yj^. The acoustic source position xA^,yA^ is recorded for M steps, and xA^,yA^ is calculated at each step’s position. PDR expresses the position xk^,yk^ of any step k in the M steps as an expression of xj^,yj^, as shown in Equation (17).(17)xk^yk^=xj^yj^+∑i=jMLj^·sinθicosθi.Figure 6
Schematic diagram of the acoustic source localization scene. The pedestrians are walking near the acoustic source with their smartphones.In the same way, the observed acoustic source positionxA^,yA^ is represented by xj^,yj^. If the accuracy of the observed acoustic source position meets the expectations, xA^,yA^ is approximately equal to xA,yA. The position xj^,yj^ is updated with the known acoustic source position information to obtain the coordinate xj′,yj′ after the cumulative error has been eliminated. This method takes advantage of the high short-term accuracy of PDR positioning. There is already a cumulative error in the xj^,yj^ position. However, due to the short running time of the PDR in M steps, the cumulative error is not large enough to affect the overall system; thus, it can be ignored.Further, we analyze the PDR localization accuracy based on the correction of the acoustic source localization. We use Equations (10)–(12), and the latter is transformed as follows after performing the acoustic source localization correction:(18)Error=Error¯·k,0≤n≤k;Error¯·t−k+Errormap1,k≤n≤t;Error¯·p−t++Erroracoustic1,t≤n≤p;Error¯·r−p+Errormap2,p≤n≤r;Error¯·N−r+Erroracoustic2,r≤n≤N,where Erroracoustic1 and Erroracoustic2 represent the positioning errors caused by the acoustic source positioning correction in the first and second step. After using the acoustic source localization method, the global localization error is changed to a piecewise error. By segmenting the accumulated error, the large error can be decomposed into several smaller errors, minimizing the global cumulative error. The results show that the proposed PDR positioning method based on acoustic source positioning correction provides relatively good positioning accuracy. The final positioning error is(19)ErrorN=Error¯·N−r+Erroracoustic2.


## 6. Experiment

### 6.1. Pedestrian Movement Behavior Recognition Experiment

Experiments were conducted to validate the proposed method. A Xiaomi 10 mobile phone with a sensor sampling frequency of 20 Hz is used. We recruited six male and female volunteers with different heights and weights to perform the actions listed in Table2.Table 2
Actions performed by volunteers.
Holding (step)Calling (step)Swinging (step)Pocket (step)Walk150150150150Run150150150150Upstairs150150150150Downstairs150150150150We used 70% of the feature data as the training set and 30% as the test set. The recognition accuracy is listed in following Table3.Table 3
Pedestrian movement behavior recognition results.
WalkRunUpstairsDownstairsWalk96.3%0.7%0.8%2.2%Run0.0%99.7%0.3%0.0%Upstairs3.4%0.8%92.1%3.7%Downstairs0.7%0.6%2%96.7%Further, we conducted experiments on the recognition of the movement transition zone, and we used two standard short stairs. We asked six volunteers to walk ten steps, walk up/down the stairs, and walk ten steps. We obtained 150 samples of walking upstairs and 150 samples of walking downstairs. The objective was to detect the transition zone of walking up/down the stairs (three steps). The result of using the SVM and the SVM + DS evidence theory is listed in Table4.Table 4
Results of the recognition of the movement transition zone.
Step 1 (walk)Step 2 (upstairs)Step 3 (upstairs)Step 1 (walk)Step 2 (downstairs)Step 3 (downstairs)SVM96.4%82.6%89.4%96.1%90.7%88.3%SVM + D-S theory97.1%91.3%92.5%97.8%95.2%96.6%Tables3 and 4 show that the SVM provides reasonable accuracy for detecting single movements. However, the SVM method has lower accuracy than the SVM + D-S theory method for the recognition of the movement transition zone.


### 6.2. Acoustic Source Localization Experiment Based on Hamming Distance

We conducted an acoustic source localization experiment in a conference room with a size of9.5m∗8 m, as shown in Figure 7. A Huawei smart speaker was placed on the table in the middle of the conference room to simulate standard speaker equipment. We divided the four volunteers into two groups. The first group of students walked from point A to point B, and the second group of students walked from point B to point A. Four sets of data were collected. We used the electronic total station to obtain the coordinates of the speaker (as the black star in Figure 7), used PDR positioning to obtain the position of each step (as the blue dot in Figure 7), and use the acoustic source positioning method proposed in this paper to calculate the sound source position (as the red star in Figure 7). The results are shown in Figures 7(a)–7(d).Figure 7
(d) Pedestrian trajectory in experiment. (a) In experiment 1; (b) in experiment 2; (c) in experiment 3; (d) in experiment 4.
(a)(b)(c)(d)The actual and measured acoustic source locations and the root mean square errors are listed in Table5.Table 5
Results of the acoustic source localization experiment.
Experiment 1Experiment 2Experiment 3Experiment 4Actual acoustic source location (m)(3.529, 4.353)(3.529, 4.353)(4.048, 6.904)(4.048, 6.904)Measured acoustic source location (m)(3.75, 4.125)(3.15, 4.3)(3.9, 7.05)(4.15, 7.15)Root mean square error (m)0.31750.38270.20790.2663The average error of the proposed acoustic source localization method is 0.2936 m, which met the expectations.


### 6.3. PDR Positioning Experiment

In this paper, an experiment is designed to verify the accuracy of the step estimation method based on pedestrian movement behavior recognition. The scene of this experiment is selected in the display hall of Guilin Smart Industrial Park, China. The scene diagram is shown in Figure8. In the experiment, we stipulate volunteers to march along a prescribed route, in which volunteers first run forward to the west, and then walk north, east, and south in turn until they return to the starting point, with a total length of 108 m.Figure 8
Schematic diagram of the stride estimation method experiment.The experimental results are shown in Figure9. Method 1 used a fixed stride length for PDR positioning (each stride length was 0.7 m), method 2 used the method of Equation (6) to calculate the stride length (using fixed α and β), and method 3 was the method proposed in this paper. Let the coordinates of the starting point be (0, 0), and the coordinates of the three methods and errors are shown in Table 6 after the volunteer walks one turn. The proposed method in this paper has the best positioning accuracy, and the trajectory of the volunteer walking best matches the prescribed trajectory.Figure 9
The trajectory in the stride estimation method experiment.Table 6
Results of the stride estimation method experiment.
Method 1Method 2Method 3Coordinates(1.06, -0.30)(1.97,-1.2)(-0.57, 0.30)X-direction error (m)1.061.970.57Y-direction error (m)0.301.20.30Root mean square error (m)1.102.300.67A PDR positioning experiment was conducted in the seventh teaching building of Guilin University of Electronic Technology, Jinji Road. We asked the volunteers to travel along the route shown in Figure10 from the starting point on the 3rd floor to the end of staircase B. The track was 70 m long, with two staircases (including a short staircase), and two acoustic sources were used.Figure 10
Schematic diagram of the positioning experiment.The trajectory in the positioning experiment is shown in Figure11.Figure 11
The trajectory in the positioning experiment.The experiments verified that the proposed PDR and pedestrian movement behavior recognition eliminated the cumulative error of PDR positioning. As shown in Figure11, when only PDR positioning was used and the running time was extended, the accumulated error of PDR positioning mistakenly located the pedestrians outside the building. Meanwhile, the root mean square error of positioning at the end point using only PDR is 2.15 m. Moreover, there were no prominent map landmarks such as stairs; therefore, the map matching algorithm could not be used to correct the PDR data. The acoustic source positioning eliminated the cumulative error, e.g., I and II. The correction performance is excellent for II, where the wrong route outside the building is corrected. In addition, without the pedestrian movement behavior recognition method, the movement behavior states, such as going up and down the stairs, cannot be identified, resulting in a wrong trajectory. However, using the map matching methods (III, IV) results in correct stride length estimation and the elimination of the accumulated error of PDR positioning.


## 6.1. Pedestrian Movement Behavior Recognition Experiment

Experiments were conducted to validate the proposed method. A Xiaomi 10 mobile phone with a sensor sampling frequency of 20 Hz is used. We recruited six male and female volunteers with different heights and weights to perform the actions listed in Table2.Table 2
Actions performed by volunteers.
Holding (step)Calling (step)Swinging (step)Pocket (step)Walk150150150150Run150150150150Upstairs150150150150Downstairs150150150150We used 70% of the feature data as the training set and 30% as the test set. The recognition accuracy is listed in following Table3.Table 3
Pedestrian movement behavior recognition results.
WalkRunUpstairsDownstairsWalk96.3%0.7%0.8%2.2%Run0.0%99.7%0.3%0.0%Upstairs3.4%0.8%92.1%3.7%Downstairs0.7%0.6%2%96.7%Further, we conducted experiments on the recognition of the movement transition zone, and we used two standard short stairs. We asked six volunteers to walk ten steps, walk up/down the stairs, and walk ten steps. We obtained 150 samples of walking upstairs and 150 samples of walking downstairs. The objective was to detect the transition zone of walking up/down the stairs (three steps). The result of using the SVM and the SVM + DS evidence theory is listed in Table4.Table 4
Results of the recognition of the movement transition zone.
Step 1 (walk)Step 2 (upstairs)Step 3 (upstairs)Step 1 (walk)Step 2 (downstairs)Step 3 (downstairs)SVM96.4%82.6%89.4%96.1%90.7%88.3%SVM + D-S theory97.1%91.3%92.5%97.8%95.2%96.6%Tables3 and 4 show that the SVM provides reasonable accuracy for detecting single movements. However, the SVM method has lower accuracy than the SVM + D-S theory method for the recognition of the movement transition zone.


## 6.2. Acoustic Source Localization Experiment Based on Hamming Distance

We conducted an acoustic source localization experiment in a conference room with a size of9.5m∗8 m, as shown in Figure 7. A Huawei smart speaker was placed on the table in the middle of the conference room to simulate standard speaker equipment. We divided the four volunteers into two groups. The first group of students walked from point A to point B, and the second group of students walked from point B to point A. Four sets of data were collected. We used the electronic total station to obtain the coordinates of the speaker (as the black star in Figure 7), used PDR positioning to obtain the position of each step (as the blue dot in Figure 7), and use the acoustic source positioning method proposed in this paper to calculate the sound source position (as the red star in Figure 7). The results are shown in Figures 7(a)–7(d).Figure 7
(d) Pedestrian trajectory in experiment. (a) In experiment 1; (b) in experiment 2; (c) in experiment 3; (d) in experiment 4.
(a)(b)(c)(d)The actual and measured acoustic source locations and the root mean square errors are listed in Table5.Table 5
Results of the acoustic source localization experiment.
Experiment 1Experiment 2Experiment 3Experiment 4Actual acoustic source location (m)(3.529, 4.353)(3.529, 4.353)(4.048, 6.904)(4.048, 6.904)Measured acoustic source location (m)(3.75, 4.125)(3.15, 4.3)(3.9, 7.05)(4.15, 7.15)Root mean square error (m)0.31750.38270.20790.2663The average error of the proposed acoustic source localization method is 0.2936 m, which met the expectations.


## 6.3. PDR Positioning Experiment

In this paper, an experiment is designed to verify the accuracy of the step estimation method based on pedestrian movement behavior recognition. The scene of this experiment is selected in the display hall of Guilin Smart Industrial Park, China. The scene diagram is shown in Figure8. In the experiment, we stipulate volunteers to march along a prescribed route, in which volunteers first run forward to the west, and then walk north, east, and south in turn until they return to the starting point, with a total length of 108 m.Figure 8
Schematic diagram of the stride estimation method experiment.The experimental results are shown in Figure9. Method 1 used a fixed stride length for PDR positioning (each stride length was 0.7 m), method 2 used the method of Equation (6) to calculate the stride length (using fixed α and β), and method 3 was the method proposed in this paper. Let the coordinates of the starting point be (0, 0), and the coordinates of the three methods and errors are shown in Table 6 after the volunteer walks one turn. The proposed method in this paper has the best positioning accuracy, and the trajectory of the volunteer walking best matches the prescribed trajectory.Figure 9
The trajectory in the stride estimation method experiment.Table 6
Results of the stride estimation method experiment.
Method 1Method 2Method 3Coordinates(1.06, -0.30)(1.97,-1.2)(-0.57, 0.30)X-direction error (m)1.061.970.57Y-direction error (m)0.301.20.30Root mean square error (m)1.102.300.67A PDR positioning experiment was conducted in the seventh teaching building of Guilin University of Electronic Technology, Jinji Road. We asked the volunteers to travel along the route shown in Figure10 from the starting point on the 3rd floor to the end of staircase B. The track was 70 m long, with two staircases (including a short staircase), and two acoustic sources were used.Figure 10
Schematic diagram of the positioning experiment.The trajectory in the positioning experiment is shown in Figure11.Figure 11
The trajectory in the positioning experiment.The experiments verified that the proposed PDR and pedestrian movement behavior recognition eliminated the cumulative error of PDR positioning. As shown in Figure11, when only PDR positioning was used and the running time was extended, the accumulated error of PDR positioning mistakenly located the pedestrians outside the building. Meanwhile, the root mean square error of positioning at the end point using only PDR is 2.15 m. Moreover, there were no prominent map landmarks such as stairs; therefore, the map matching algorithm could not be used to correct the PDR data. The acoustic source positioning eliminated the cumulative error, e.g., I and II. The correction performance is excellent for II, where the wrong route outside the building is corrected. In addition, without the pedestrian movement behavior recognition method, the movement behavior states, such as going up and down the stairs, cannot be identified, resulting in a wrong trajectory. However, using the map matching methods (III, IV) results in correct stride length estimation and the elimination of the accumulated error of PDR positioning.


## 7. Conclusions and Future Work

This paper proposed a new PDR positioning method that optimizes the PDR positioning algorithm by identifying the pedestrian movement behavior recognition. The experiments showed that the recognition accuracy exceeded 96%, which met the expectations. The acoustic source positioning method eliminated the cumulative error of PDR positioning, resulting in a positioning error of 0.3 m, which met the requirements. The proposed method shows excellent potential for positioning applications. In the future, we will investigate the use of this method in more complex scenarios.



---

*Source: 9981802-2021-07-09.xml*