## 4 Experiment and Result Analysis  
The performance of the proposed sensor fusion framework is evaluated by two experiment scenarios based on the user motion. We used two user motions; rectangular and linear motion with predefined paths. For collecting data, a user of age 27 and height 172 cm walked on the reference path in the experiment areas with a smartphone in his hand. Figure 6 shows the experiment scenarios and the red line indicates the reference paths used for the experiment. \begin{table}
\begin{tabular}{c c} \hline \(\hat{x}_{k}\) & State variable \\ \(P_{k}\) & Error covariance matrix \\ \(A\) & State transition matrix \\ \(k\) & Variable used for the recursive execution of Kalman filter \\ \(\hat{x}_{k-1},P_{k-1}\) & For internal computation \\ \(Q\) & Noise covariance of the process \\ \(K_{k}\) & Kalman gain \\ \(z_{k}\) & Measurement \\ \(H\) & Matrix for calculating the predicted value in the form of a measured value \\ \(R\) & Covariance of the measurement noise \\ \hline \end{tabular}
\end{table} 
Table 1: Variables used in the LKF implementation. For collecting the smartphone sensor and RSSI data, we used a Samsung Galaxy Note 8 smartphone with a Snapdragon 835 processor and 6 GB RAM. The experiment area uses a LG U plus Wi-Fi APs for providing RSSI signals. In the first experiment, the user took a rectangular motion with a test area of 45 m \(\times\) 37 m. The test area was divided into 4 \(\times\) 20 grid points and the Wi-Fi RSSI for each of the points was recorded. To collect the Wi-Fi RSSI, we used a fingerprint Android application which can store the RSSI measurements in form of comma-separated values (CSV). This application provides an option for selecting the required APs for the experiment. Four APs were chosen for localization based on their signal strength in the experiment area. For the second experiment, a linear motion of the user was considered in a 75 m \(\times\) 3 m corridor as shown in Figure 6. The corridor was divided into 2 \(\times\) 60 grid points and the user walked in the reference paths. For PDR data collection, the sensor stream inertial measurement unit and global positioning system Android application were used. The Android application can access the accelerometer, gyroscope, and magnetometer sensors in the smartphone. The user can select any of the sensors and analyze the current values of the sensors. The application has an option for adjusting sensor frequency based on the experiment requirements. The performance of the proposed sensor fusion framework was analyzed using the data from paths 1 and 2. Figures 7 and 8 show the results from the proposed sensor fusion framework and conventional sensor fusion frameworks for paths 1 and 2. From Figures 7 and 8, it can be seen that the proposed sensor fusion framework can minimize localization errors when compared to conventional sensor fusion approaches. In these experiments, the starting position was the origin and the experiments were carried out strictly along the predefined paths. The red line in Figure 7 shows the reference path for rectangular pedestrian motion and the dashed red line in Figure 8 shows the reference path for linear user motion. The accuracy of the proposed sensor fusion framework was evaluated by computing the average localization error and probability distribution of the localization errors. The average localization errors for the proposed sensor fusion framework and conventional sensor fusion frameworks for paths 1 and 2 are shown in Figures 9 and 10. Figure 6: Experiment scenarios. Figure 8: Trajectories of ground truth, proposed sensor fusion framework, conventional sensor fusion frameworks from linear motion. Figure 7: Trajectories of ground truth, proposed sensor fusion framework, conventional sensor fusion frameworks from rectangular motion. From Figures 9 and 10, the proposed sensor fusion framework has less position errors and gives better performance when compared to conventional sensor fusion approaches.