## 3 Multi-Source Fusion Structure of Wi-Fi/Acoustic/MEMS Sensors
### Enhanced Wi-Fi Matching and Accuracy Indicator  
The proposed H-IPS improves the accuracy of the Wi-Fi fingerprinting approach from two aspects: double-weighted K-nearest neighbor (DW-KNN) is proposed for the database matching algorithm and added the specific scene indexes. The matched location results are further evaluated by a Wi-Fi accuracy indicator (WAI). Firstly, the weighted Euclidean distance \(E_{t,other}\) is calculated based on the intensity of the collected RSSI values and further uses the nearest weighted distances \(Dis_{t,r_{1}}\) for the fingerprinting location update procedure:  
\[E_{t,other}=\sum_{i=1}^{\alpha}\eta\cdot\left|RSS^{i}_{scannd}-RSS^{i}_{database}\right| \tag{9}\]  
where \(\eta\) is determined according to the relationship between the specific RSS value \(RSS_{t,other}\) and max value \(RSS_{t,MAX}\) in the collected RSS vector:  
\[\eta=1-RSS_{t,other}/RSS_{t,MAX} \tag{10}\]After acquiring the weighted Euclidean distance of each reference location in the database, the final matched location is calculated by:  
\[\text{POS}^{\prime}(x_{r},y_{r})=\frac{\sum\limits_{i=1}^{K}\omega_{i}^{\gamma} \text{POS}(x_{i},y_{i})}{\sum\limits_{i=1}^{K}\omega_{i}^{\gamma}} \tag{11}\]  
where \(\text{POS}^{\prime}(x_{r},y_{r})\) indicates the weighted location result, \(\text{POS}(x_{i},y_{i})\) indicates each matched location in database, and \(\omega_{i}^{\gamma}\) indicates the related weight value. Secondly, the performance of matched Wi-Fi locations is further evaluated among the GRU-based Wi-Fi accuracy indicator (WAI) to obtain the positioning error prediction results for the final fusion phase, and the input features are extracted as:  
(1) Relative location change during two adjacent Wi-Fi sampling timestamps provided by the accumulation of the calculated step-length \(L_{i}\) and heading information \(\theta_{i}\):  
\[\left\{ \begin{array}{l}\Delta D_{MEMS}^{x}(t)=\sum\limits_{i=1}^{\gamma}L_{ i}\cdot\sin(\theta_{i})\\ \Delta D_{MEMS}^{y}(t)=\sum\limits_{i=1}^{\gamma}L_{i}\cdot\cos(\theta_{i}) \end{array} \right. \tag{12}\]  
where \(\Delta D_{MEMS}^{x}(t)\) and \(\Delta D_{MEMS}^{y}(t)\) indicate the increment in the \(x\)-axis and \(y\)-axis location provided by MEMS sensors. (2) Euclidean distances during two adjacent Wi-Fi sampling timestamps provided by Wi-Fi and MEMS sensors:  
\[\left\{ \begin{array}{l}Euc_{i}^{MEMS}=\sqrt{\left(\sum\limits_{i=1}^{\gamma} L_{i}\cdot\cos(\theta_{i})\right)^{2}+\left(\sum\limits_{i=1}^{\gamma}L_{i}\cdot sin( \theta_{i})\right)^{2}}\\ Euc_{i}^{Wi-Fi}=\sqrt{\left(x_{G}^{W}(i)-x_{G}^{W}(i-1)\right)^{2}+\left(y_{G} ^{W}(i)-y_{G}^{W}(i-1)\right)^{2}}\end{array} \right. \tag{13}\]  
where \(\left\{x_{G}^{W}(t),y_{G}^{W}(t)\right\}\) represents the Wi-Fi matching result. (3) Instant speeds estimated with Wi-Fi and built-in sensors among two Wi-Fi sampling timestamps:  
\[\left\{ \begin{array}{l}V_{i}^{MEMS}=Euc_{i}^{MEMS}/\mu_{k}^{Wi-Fi}\\ V_{i}^{Wi-Fi}=Euc_{i}^{Wi-Fi}/\mu_{k}^{Wi-Fi}\end{array} \right. \tag{14}\]  
where \(V_{i}^{MEMS}\) and \(V_{i}^{Wi-Fi}\) are the instant speeds provided by the MEMS sensors and Wi-Fi, respectively. \(\mu_{k}^{Wi-Fi}\) is sampling rate of Wi-Fi. (4) Virtual headings among two Wi-Fi sampling timestamps provided by MEMS sensors and Wi-Fi [5]:  
\[\left\{ \begin{array}{l}\theta_{virtual}^{MEMS}(t)=\arctan(\frac{\sum\limits _{i=1}^{\gamma}L_{i}\cdot\sin(\theta_{i})}{\sum\limits_{i=1}^{\gamma}L_{i} \cdot\cos(\theta_{i})})\\ \theta_{virtual}^{Wi-Fi}(t)=\arctan(\frac{\sum\limits_{i=1}^{\gamma}(L_{i})-x_{ G}^{W}(t-1)}{y_{G}^{W}(t)-y_{G}^{W}(t-1)})\end{array} \right. \tag{15}\]  
where \(\theta_{virtual}^{MEMS}(t)\) and \(\theta_{virtual}^{Wi-Fi}(t)\) represent the low-cost sensors and Wi-Fi originated virtual headings, respectively.