# Localization of a BLE Device Based on Single-Device RSSI and DOA Measurements
## 7 Experimental Results
### DOA Estimation  
The denoising algorithm presented in Section 5.4 uses the raw data from two individual scans at a measurement location and undergoes multiple steps to achieve an RSS profile over heading. For this part of the research, we placed the beacon at a height of 1 m above the ground and recorded one measurement (two individual scans separated by distance \(d_{\text{ss}}\)) from the scanner device at a distance of 5 m from the beacon and plotted at different stages of the algorithm. With the distance between the scanning locations being \(d_{\text{ss}}=2 feet\), the scatter plot of the raw data for both the scans is shown in Figures 9 and 10. The subplots show RSS over heading, RSS over time, and heading over time to better represent the scan over time and space. From these figures, it can be seen that the raw measurement data are extremely noisy, which is caused by the multipath and shadow fading effects in indoor environments, as well as various noise and interferences in the 2.4 GHz band. So, the goal of the measurement and data processing techniques proposed in this paper is to derive a reliable estimation of a target BLE device's location gradually from a series of noisy measurement data that are taken by following a well-defined procedure. The raw data must be filtered and smoothened for accurate estimation of the DOA. We first employed the time-binding step of our denoising algorithm by segmenting the raw data into consecutive bins of equal time duration \(\delta_{t}=250\) ms and calculating the median of data in that window. For example, at scan location 1 of this measurement, a scan time of 60 s (scan rotation speed of 1 rpm) resulted in 240 consecutive bins (\(N_{t}=240\)). The median of 12-13 data samples of each bin was calculated with an overlap of 50% to smooth out any noise. The scatterplots of the result of this time-based binding process are smoother with outliers removed, as shown in Figures 11 and 12. It can be seen from these plots that the RSS values are higher between 225\({}^{\circ}\) and 275\({}^{\circ}\) for location 1 and between 75\({}^{\circ}\) and 100\({}^{\circ}\) and 200\({}^{\circ}\) and 300\({}^{\circ}\) for location 2. The time-bound data over equal time bins was denoised over time using the EWMA filter for both scan locations. In this research, we set different EWMA weights for the RSS and time data: \(w_{p}=0.6\) and \(w_{\theta}=0.9\). The scatter plots of the result show clear further smoothening of the data curves and removal of noise in Figures 13 and 14. Figure 10: Scatter plots of raw data at scan location 2. Figure 9: Scatter plots of raw data at scan location 1. Figure 11: Scatter plot of time-bound raw data at scan location 1. Figure 12: Scatter plot of time-bound raw data at scan location 2. Figure 13: Scatter plot of denoised data at scan location 1. In the next step of our denoising algorithm, we combined the denoised data from both scan locations into a single dataset. The timestamp information was removed, and the resultant data, which consisted of RSS and heading information, was bound over space by segmenting the heading angles into consecutive bins of equal angular width \(\delta_{\theta}=5^{\circ}\). The RSS data falling within each bin was combined by computing the median, and finally, the data was further smoothened by applying a moving average filter with a window size of \((2L+1)=5\). The scatter plot of the spatial bound data after applying moving average (Figure 15) shows the RSS values are high between \(230^{\circ}\) and \(250^{\circ}\). The DOA of the BLE beacon signal can be estimated by finding the global maximum of the RSS values over the heading direction (\(\hat{\theta}=252.35^{\circ}\)). For this experiment, the actual heading direction of the BLE beacon with respect to the scanner device was known to be \(\theta_{1}=247^{\circ}\) at scan location 1 and \(\theta_{2}=250^{\circ}\) at scan location 2. The expected DOA of the BLE signal can hence be defined as the average of these heading angles \(\theta=248.5^{\circ}\).