## 4 UWB Indoor Positioning System
### UWB Ranging Algorithms
The optimal position of the tag \((\hat{x}_{i},\hat{y}_{i},\hat{z}_{i})\) can be obtained by applying the least-squares solution and the minimum mean square error estimation algorithm \[(\hat{x}_{i},\hat{y}_{i},\hat{z}_{i})=\min_{(x_{i},y_{i},z_{i})}\sum_{j=1}^{4 }\Bigl{[}d_{j}-\sqrt{(\hat{x}_{i}-x_{j})^{2}+(\hat{y}_{i}-y_{j})^{2}+(\hat{z}_ {i}-z_{j})^{2}}\Bigr{]}^{2}.\] (4)
* **Two-Way Time of Arrival (TW-ToA):** The ToA method described above can offer high positioning accuracy but requires precise synchronization of the anchors and tags, which can be challenging to implement. Alternatively, the TW-ToA method shown in Figure 8 can be used to measure the signal propagation time \(\tau\) and eliminate the synchronization requirement. The total propagation time for \(\tau_{ij}\) between the \(j\)-th anchor and \(i\)-th tag can be calculated using the TW-ToA method and is expressed as \[\tau_{ij} = \frac{1}{4}\bigl{(}TWR1_{round_{i}}+TWR1_{j}+TWR2_{round_{i}}+TWR 2_{j}\bigr{)},\] (5) where \(TWR1_{round_{i}}\) and \(TWR2_{round_{i}}\) are the two-way return time and \(TWR1_{j}\) and \(TWR2_{j}\) are the responding time of the anchor and the tag, respectively, as shown in Figure 8.  
Figure 7: ToA positioning algorithm. (**a**) Signal propagation time calculations. (**b**) Estimated range scheme. * **Time Difference of Arrival (TDoA):** TDoA is another time-based measurement algorithm related to ToA and TWR-ToA. The principle of this algorithm is to measure the difference in arrival time between two signals as shown in Figure 9. While the anchor still requires precisely synchronized clocks, the tags do not need to be as precisely synchronized compared to the ToA method. This leads to high-power efficiency, as only one transmission message is required from the tag to the anchor. The location of the mobile tag can be obtained from the intersection of multiple hyperbolas. Consider that the anchors are located at \((x_{i},y_{i}),i=1,2,3\), and the coordinates of the tag are \((\hat{x},\hat{y})\). The distance between the target and the reference base station can be expressed as a difference in arrival time, given as \[\tau_{ij}=\frac{T_{round_{i}}-T_{reply_{j}}}{2}.\]0 (6)
* **Angle of Arrival (AoA):** The AoA algorithm, as shown in Figure 10, estimates the position of a mobile object based on angle measurements obtained by antenna arrays at the receiver side. The phase difference between two anchors is used to calculate each angle measurement, and the location of the mobile object can be determined from the intersection of the angle lines. In a two-dimensional Cartesian coordinate system, two anchors are located at \((x_{i},y_{i}),i=1,2\), and the coordinates of the mobile object  
\[\tau_{ij}=\frac{T_{round_{i}}-T_{reply_{j}}}{2}.\]1 TW-ToA positioning algorithm. \[\tau_{ij}=\frac{T_{round_{i}}-T_{reply_{j}}}{2}.\]2 TDoA positioning algorithm. are \((\hat{x},\hat{y})\). The angles related to anchor-i from the standpoint of the mobile object are \(\theta_{i},i=1,2\). The angles measured by the anchors are denoted as \(\alpha_{i},i=1,2\). The location of the tag can be formulated as \[\tau_{ij}=\frac{T_{round_{i}}-T_{reply_{j}}}{2}.\]3 (7) where \(\theta_{i}\) and \(\alpha_{i}\) have the following relation: \[\tau_{ij}=\frac{T_{round_{i}}-T_{reply_{j}}}{2}.\]4 (8) The target's location \((\hat{x},\hat{y})\) can be figured out by solving the equation. * **Received Signal Strength Identification (RSSI):** To further expand on the RSSI algorithm, location fingerprinting involves collecting a database of RSSI values at known locations in the environment, known as \"fingerprints\". When a mobile tag enters the environment, its RSSI values are compared to the fingerprints in the database to determine its location. This approach can improve the accuracy of the RSSI-based positioning system, but it requires significant effort to build and maintain the fingerprint database. Additionally, changes in the environment, such as moving objects or changes in building materials, can impact the accuracy of the system.