# Research on a Wi-Fi RSSI Calibration Algorithm Based on WOA-BPNN for Indoor Positioning
## 3 Experiments and Results
### Wi-Fi AP Number Setting  
To explore the influence of the number of Wi-Fi APs used to build the model on the calibration effect of the WOA-BPNN calibration algorithm, we select 12 modelling points and 12 test points randomly for the experiments at the experiment area described above. The distribution of the modelling points (red dots), test points (blue dots) and APs (green icons) is shown in Figures 4 and 5.  
Figure 3: The algorithm steps for the region-adaptive WKNN algorithm based on hierarchical clustering.  
Under different numbers of Wi-Fi APs (1-8), we use the standard mobile terminal and test mobile terminals to collect the Wi-Fi RSSI modelling data at the modelling points at a frequency of 30 s/time for 6 min. We use the standard mobile terminal and two test mobile terminals to collect the test data at the test points using the same method. We average all the RSSI data received from each AP in the data sample collected at each acquisition point (for each AP, we obtain only one average RSSI value at each point after mean filter processing; we process the subsequent obtained RSSI data in the same way) and take the average RSSI value of each AP as the RSSI value of the acquisition point. In establishing the calibration model, we take the modelling data of the test mobile terminals (test mobile terminal 1 or test mobile terminal 2) as the input value of the calibration model and the modelling data of the standard mobile terminal as the real output value of the calibration model. The model generates the predicted output data after the modelling data of the test mobile terminals pass through the calibration model, then compares and calculates the error between the predicted output data and real output value, which are then propagated back to the calibration model. Finally, we obtain a stable calibration model after continuous adjustment. Therefore, we get the calibration model of the standard mobile terminal-test mobile terminal 1 and standard mobile terminal-test mobile terminal 2. After establishing the calibration model, we use the test data of the two test mobile terminals as the input value of the calibration model to apply the corresponding model for the RSSI calibration. Finally, we calculate the error between the test data of the standard mobile terminal and test data of the test mobile terminals as well as the error between the data of the test mobile terminals.  
Figure 4: Distribution of modelling points.  
Figure 5: Distribution of test points.  
terminals after calibration and those of the standard mobile terminal. We analyse the error reduction ratio \(p\) value of the RSSI calibration model for different numbers of APs.  
\[P=\frac{n_{S_{1}<S_{0}}}{Z}\times 100\% \tag{17}\]  
where \(S_{0}=\left|RSSI_{x}-RSSI_{y}\right|\) is the error between RSSI value of the test mobile terminal and that of the standard mobile terminal before calibration; \(S_{1}=\left|RSSI_{x}^{\prime}-RSSI_{y}^{\prime}\right|\) is the error between the RSSI value of the test mobile terminal after calibration and that of the standard mobile terminal; \(n_{s_{1}<s_{0}}\) is the number of error reduction after calibration in the test data; \(Z\) is the total number of test data sets, which is proportional to the number of APs.  
Figure 6 shows that when the number of Wi-Fi APs continues to increase, the error reduction ratio \(p\) value also increases. When the number of Wi-Fi APs equals one, the error reduction ratio \(p\) of the RSSI calibration is the worst value, which shows that the calibration model established with a single AP is unstable. Meanwhile, when the number of APs increases from one to five, the value of \(p\) increases rapidly; when the number of APs reaches six or more, the increase of the error reduction ratio \(p\) value is small for each additional number of modelling APs. Therefore, considering the calibration efficiency and actual calculation amount, this experiment shows that selecting five or six modelling APs for modelling and calibration is appropriate.