## 6 Modified Unitary R-D Root MUSIC  
The implemented solution optimizes the Unitary R-D Root MUSIC by exploiting Bluetooth's radio communication system design where only a single BLE tag transmits a signal at a time, as discussed in Section 5. It means that the signal subspaces, \(\mathbf{U}_{S,x}\) and \(\mathbf{U}_{S,y}\), is a column vector. As a result, the implemented solution can void applying the time-consuming EVD and instead apply the Power Method, which is a much simpler algorithm. Experimentally, we found the Power Method converge mostly in four iterations  
Figure 5: Example of the Round Robin switch pattern of a L-shaped array with three antennas. Only the sample slots are shown. only in our solution. Moreover, the computation of the RF switch compensation matrix is performed in a linear time complexity instead of executing the inverse of a matrix with a cubic time complexity. The implemented solution utilizes a finding-root method based on EVD that does not require computing complex arithmetic despite the polynomial having complex coefficients and roots. However, the implemented solution employs the ideal array response. The real array response must be empirically found and plugged into the implemented solution. Refer to [18; 31; 32] to know how to compute the real array response. The objective of the optimization is to reduce the memory consumption and execution time of Unitary R-D Root MUSIC to attain satisfactory portability to run in constrained embedded systems. Thus, the algorithms were implemented from scratch in the C99 programming language, except the inverse of sine, the inverse of a tangent, and squared root, which are functions from _math.h_. The tailor-made numerical methods include the Power Method, an EVD, which is an adaptation of [33] that consists of the Shifted QR Algorithm, the Balancing technique, Hessenberg decomposition, and auxiliary linear algebra algorithms such as the norm of a vector and multiplication of a matrix with a vector. Since one of the objectives of the implemented solution is to attain a minimal memory footprint as much as possible, it does not use the _complex.h_ library from C programming language. Instead, it has a data structure for complex numbers with two variables representing the real and imaginary parts and functions for complex multiplication, addition, division, and conjugation. Notably, the implemented solution only employs _math.h_ and _stdint.h_ libraries, reassuring its minimal computational resources consumption goal and portability. Due to the switching protocol of Bluetooth 5.1, more operations are required in step 1 of Section 4. That is, the method collects samples from the reference period and \(N\) array observations (\(\mathbf{H}_{ss}\)) by performing the Round Robin switch pattern. Subsequently, the implemented solution calculates \(\widehat{\Delta f}\) from Equation (30) using the samples from the reference period. Afterward, it applies the RF switch phase compensation (Equation (36)) to estimate the matrix \(\mathbf{H}\). Then, it separates the IQ samples of the x-axis ULA from the y-axis one. More specifically, \(\mathbf{X}\) is composed of the first \(M\) rows of the estimated \(\mathbf{H}\), while \(\mathbf{Y}\) is the last \(M\) rows. Finally, it calculates the two covariance matrices, \(\mathbf{R}_{xx}\) and \(\mathbf{R}_{yy}\) from Equations (19) and (20). The first and simpler optimization concerns Equation (19). As discussed in [34], the matrix \(\mathbf{X}\) is big for constrained embedded devices since it contains many IQ samples that are complex numbers. In fact, if the implemented solution uses all the IQ samples, \(\mathbf{X}\) will occupy 600 bytes considering the single-precision floating point. By performing the sample covariance matrix, the code may have to store a temporary matrix \(\mathbf{X}^{H}\) as well, which would double the memory consumption. The implemented solution does not store \(\mathbf{X}^{H}\). To analyze how it is possible, let us define \(\mathbf{V}\) as a matrix that stores \(\mathbf{X}^{H}\).