# Feasibility of LoRa for Smart Home Indoor Localization
## 3 Experiment and Evaluation
### Ranging Performance  
We first evaluate the performance of LoRa for ranging. For each anchor node we calculate the ranging error with each tag by comparing the ground truth distance (by calculating the Euclidean distance between the actual position of tag and anchor) with the measured distance (mapped from measured RSSI using the calibration model from the previous section).  
Next, we look at the distribution of ranging error for each anchor and tag. Figures 4-6 present the distribution of ranging error for each anchor and all 5 tags. Table 2 indicates the summary of ranging error for all three anchors and five tags. In most cases the ranging error is below 2 m, except for a few NLOS cases where it leads to a large ranging error. We discuss the results in detail as follows. One thing to note is that even though the ranging errors go up to a few meters (lower accuracy), the ranging precision is still very high. In fact, the standard deviation remains below 1 m for the worst case and we have below 20 cm for the best case.  
Figure 4 presents the cumulative distribution function (CDF) of ranging error for Anchor 1 and all five tags. The large error for Tag 5 is due to the NLOS condition caused by the kitchen area, exactly between Anchor 1 and Tag 5. All other tags have accuracies better than 2 m since they are either in complete LOS or they are only partially in NLOS caused by the walls.  
\begin{table}
\begin{tabular}{c c c c c c c c c c c c} \hline \hline  & \multicolumn{4}{c}{**Anchor 1 Ranging Error (m)**} & \multicolumn{4}{c}{**Anchor 2 Ranging Error (m)**} & \multicolumn{4}{c}{**Anchor 3 Ranging Error (m)**} \\ \cline{2-13}  & **Avg** & **Std** & **50 th** & **99 th** & **Avg** & **Std** & **50 th** & **99 th** & **Avg** & **Std** & **50 th** & **99 th** \\ \hline Tag 1 & 0.31 & 0.17 & 0.29 & 0.65 & 2.27 & 0.61 & 2.28 & 3.54 & 1.39 & 0.38 & 1.36 & 2.25 \\ Tag 2 & 0.90 & 0.32 & 0.89 & 1.63 & 2.56 & 0.28 & 2.54 & 3.86 & 3.79 & 0.88 & 4.05 & 5.03 \\ Tag 3 & 0 Figure 5 presents the CDF of ranging error for Anchor 2 and all five tags. The larger errors for Tags 1 and 2 are due to NLOS caused by walls and possibly closer area and restroom. The accuracy for Tag 3 is most likely affected by reflections from objects and walls.  
Figure 6 shows the CDF of ranging error for Anchor 3 and all five tags. The large error for Tag 2 is because of the NLOS condition caused by the kitchen area, exactly between Anchor 3 and Tag 2.  
From the ranging accuracy results in Table 2 and Figures 4-6, we can conclude that the NLOS conditions and reflected signals caused by home appliances, walls, etc. can impact the accuracy of ranging. However, the standard deviation of error remains below 1 m.  
Figure 5: CDF of ranging error for Anchor 2 and all five tags. Tags 4 and 5 show errors below 1 m. Tag 2 has errors below 2.5 m. Other tags have larger errors due to NLOS caused by walls and possibly other things in the closet and restroom area.  
Figure 6: CDF of ranging error for Anchor 3 and all five tags. All tags show ranging errors below 2.5 m, except for Tag 2. The kitchen area is between Anchor 3 and Tag 2, causing NLOS conditions and affecting the ranging performance. Other tags are either in LOS or partial NLOS and have better accuracies.