# Localization of a BLE Device Based on Single-Device RSSI and DOA Measurements
## 5 Single Scanner-Based DoA Estimation
### Measurement of RSS Profile over Heading Direction  
The basic idea of the proposed method for BLE beacon signal DOA estimation with a single scanner device (i.e., smartphone or any other mobile devices such as tablet, laptop, etc.) is illustrated in Figure 2. A user holds the scanner device in hand and takes a set of measurements of the RSS of the BLE beacon signals and the heading direction of the scanner while rotating 360\({}^{\circ}\) in the same standing location. The principle underlying assumption of the proposed method is that the measured RSS value is the highest when the heading direction of the scanner points towards the BLE beacon. However, it is well known that RSS measurements fluctuate significantly due to various fast and slow fading effects in the multipath radio propagation channels [26]. Thus, it is impractical to estimate the DOA of beacon signals accurately from the raw RSS and heading measurement data. As explained in detail in this paper, we designed a number of sensor data processing and fusion methods to achieve robust DOA estimation using the measurement configuration in Figure 2.  
The types of antennae that are typically integrated into BLE devices include chip antenna, micro-strip antenna, and metal plate antennae, among others [30]. As design engineers often need to trade off antenna performance to satisfy other design constraints, the antenna radiation pattern of wireless devices is commonly not omnidirectional [30; 31]. The antenna radiation pattern of a wireless device is primarily determined by the antenna's design, construction, and positioning within the device enclosure package. Thus, wireless devices often exhibit directionality in signal reception characteristics. In addition, when a user holds the device in hand, as shown in Figure 2, the user's body will also affect the signal reception directionality. For example, the RSS of the received beacon signal is higher when pointing the scanner directly towards the beacon as compared to the scenario where the beacon is located right behind the user. If a human body blocks the line-of-sight signal path between the scanner and the beacon, it may substantially attenuate the beacon signals. In the measurement scenario shown in Figure 2, we have considered different rotation speeds of the user, ranging from 2 rpm to 12 rpm. With a rotation speed of 2 rpm, the user rotates 12\({}^{\circ}\) per second and takes 30 s for one complete rotation of 360\({}^{\circ}\), while with a rotation speed of 12 rpm, the user rotates 72\({}^{\circ}\) per second and takes 5 s for one complete rotation. The advertising interval of the BLE beacon device can be set to any value between 20 ms and 10.24 s with a step size of 0.625 ms [25]. In practice, in order to collect a sufficient amount of data for processing within a reasonable time period, the advertising interval should be set to a smaller value. For example, when the advertising interval is set to 20 ms, it is possible to collect up to 50 measurements per second. Thus, depending on the user's rotation speed, the number of measurements collected for one rotation can range from 250 for 12 rpm to 1500 for 2 rpm. During the measurement process, the scanner device continuously scans the advertising channels to capture the advertisement packets (i.e., beacon signals) coming from the target BLE beacon device. Once an advertisement packet is received, the scanner decodes the RSS value and immediately takes a measurement of the heading direction with the magnetometer. Then, the data, including both RSS and heading measurements, are timestamped and passed to the upper application layer process for further processing. Thus, with such a measurement process, each measurement data sample consists of three parameters, including a timestamp, RSS, and heading, which are captured concurrently.