# A Novel Ranging Technique Based on Optical Camera Communications and Time Difference of Arrival
## 6 Simulation Results  
This section presents several results regarding the system performance concerning error. To manifest the benefits of basing the estimation on the statistical mode instead of the mean value, both techniques were compared. The histograms associated with the averaging strategy versus the mode-based proposal is depicted, highlighting and justifying the performance improvement.  
As a baseline, the parameters in Table 2 were used to obtain the simulation results. Variations on some parameters were analyzed to evaluate their impact on the system's performance.  
Figure 9 depicts the simulated measurement error histogram at 1 m versus the theoretical curve extracted from Equation (10). In the same figure, it can be observed that there are no errors since several pulses are allocated within the ROI. As mentioned above, the pulse width depends linearly on distance (Equation (2)). In addition, due to the proximity of the measurement, the lamp's projection would be large enough to allocate several pulses.  
Locating emitter and receiver at a distance above the critical distance defined by Equation (6), other components appear in the histogram, as Figure 10 depicts. In this case, the lamp's projection has been reduced and the pulse duration has been increased due to distance. Since the scenario is not compliant with the restriction of Equation (4), the probability of allocating an entire pulse is reduced. Thus, erroneous measurements may occur.  
As discussed in the previous sections, since the pdf is asymmetric and the zero-error component corresponds to the most frequent value of the distribution, the mode is proposed as an error-mitigation strategy. Figure 11 depicts the histograms of mean and mode for a different number of measures at the distance shown in Figure 10.  
Figure 12 shows the evolution of the expected value of the error as a function of distance and number of runs for both error-mitigation strategies. Figure 13 depicts in detail the part of Figure 12 ranging from 2 to 3 m.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline \(FOV_{y}\) & 60\({}^{\circ}\) \\ \(N_{y}\) & 1080 rows \\ \(f_{frame}\) & 60 fps \\ \(H\) & 50 cm \\ \(v_{2}(T)\) & 333 m s\({}^{-1}\) \\ \(T_{guard}\) & 100 us \\ \hline \hline \end{tabular}
\end{table}
Table 2: Baseline parameters of the simulation.  
Figure 9: Empirical histogram in black versus theoretical result in red (**a**); and simulated signal within the corresponding ROI at 1 m (**b**). In total, 1024 independent simulations were performed.  
Figure 11: Cont.  
Figure 10: Empirical histogram in black versus theoretical result in red (**a**); and simulated signal within the corresponding ROI at 3 m (**b**). In total, 1024 independent simulations were performed.  
Figure 11: Histograms associated to the averaging strategy (**left column**); and to the proposed mode-based error mitigation (**right column**). (**a**) one-shot measurement samples filtering, (**b**) two-shot measurements samples filtering, (**c**) five-shot measurements samples filtering and (**d**) ten-shot measurements samples filtering.  
Figure 12: Expected error versus distance for different number of runs: (**a**) the typical averaging strategy; and (**b**) the proposed mode-based filtering.  
Finally, Figure 14 illustrates how the variation of the object's effective size, capture rate, guard time and FOV-to-resolution ratio influence the error performance.  
Figure 14: Effect of different parameters on error performance: object’s effective size (**a**); capture rate (**b**); FOV-to-resolution ratio (**c**); and guard time (**d**). All curves were obtained using the proposed mode-based filtering with 20 samples.  
Figure 13: Zoom of the error performance in Figure 12. (**a**) the typical averaging strategy; and (**b**) the proposed mode-based filtering.