## 3 Methodology
### Measurement Methods  
IPS measurement algorithms can be generally categorized into four main types based on their fundamental principles, namely proximity detection signal, time, and angulation, as shown in Table 1. TW-ToA (two-way time of arrival), ToA (time of arrival), AoA (angle of arrival), TDoA (time difference of arrival), and RSSI (received signal strength indicator) are commonly used with UWB in the literature (see Section 2). The method of determining the distance between two nodes is known as ranging. The measured distance is then analyzed to estimate the location, a process referred to as positioning [73; 74].  
\begin{table}
\begin{tabular}{c c c c} \hline \hline Time-based: & ToA & TDoA & TW-ToA & PoA \\ \hline Signal-based: & RSSI & CSI & \\ \hline Angulation: & AoA & AoD & \\ \hline Proximity & RFID & Cell-ID & \\ Detection: & & & \\ \hline \hline \end{tabular}
\end{table}
Table 1: Distance measurement methods.  
Implementation should always use the IEEE 802.15.4z double-sided two-way ranging (DS-TWR) algorithm, which is designed to eliminate the need to synchronize clocks between both devices. By using DS-TWR measurement, potential clock drifts are eliminated, and both sides calculate the distance measurement without having to transmit the measured distance from one device to the other [75; 76].  
The proposed solution uses ToF (time-of-flight) measurements to calculate distance derived from the duration the signal takes to travel from the mobile phone to a single tag and back. The initiator starts by sending a survey message to this tag. The respond answers and dispatches the delay of the response (\(T_{reply1}\)) to the initiator. The initiator sends a second poll message and reports the response latency (\(T_{reply2}\)) to the responder and the total round-trip time for the first message exchange (\(T_{round1}\)). The respondent now calculates the final distance using the specified distance Equation (1). In the last (optional) message, the respondent sends the measured distance (\(d\)) or the time of the second round trip (\(T_{round2}\)) [77].  
The total propagation time estimation can be accomplished through the TW-ToA technique, which is expressed as follows:  
\[d=\frac{T_{round1}\ *\ T_{round2}-T_{reply1}\ *\ T_{reply2}}{T_{round1}+T_{round2} +T_{reply1}+T_{reply2}}*\ c \tag{1}\]  
where \(T_{round1}\) and \(T_{round2}\) are the bidirectional return time; \(T_{reply1}\) and \(T_{reply2}\) are the response time of the initiator and responder, respectively; and c is the speed of light.  
For accessing heading information even when the beacon is beyond the phone's field of view, it is advisable to utilize the Camera Assist functionality integrated with Apple's ARKit [78]. This function combines ARKit's spatial awareness with nearby interaction to increase the accuracy of a nearby object. This feature uses the IMU's (inertial measurement unit) camera and sensors to expand the device's perceptual field, thus allowing it to indirectly \"see\" the transmitter [79]. Camera Assist becomes imperative on iPhone 14 and subsequent models due to Apple's decision to decrease the count of UWB antennas on these devices. Consequently, orientation computation solely relies on sensor fusion, amalgamating data from the inertial measurement unit (IMU) and camera sensors [78].