## 3 The Proposed DoA Estimation Algorithm and Beamforming Scheme
### DoA Estimation and Prediction  
The DoA of the incoming signal is defined as the angle between the signal's propagation direction and the receiver's antenna array. To calculate DoA, the position vector from FSI needs to be first transformed to a common reference which incorporates the BS's position vector. The universal local north-east-down (NED) frame is used to this end, where the z-axis is perpendicular to the earth surface,  
Figure 3: SINR output of DL beamforming versus the DL-factor for different DoA errors. The maximum achievable gain decreases as DoA errors increases, creating gaps between the curves of different DoA errors. and x and y axes are both tangent to the earth surface. A GPS position is typically expressed in Geodetic frame as \(\rho=(\omega,\varphi,h)^{\text{T}}\), where \(h\) is the height above the earth surface; \(\omega\) and \(\varphi\) are longitude and latitude, respectively. Set the original UAV and BS's GPS positions as \(\rho_{ug}\) and \(\rho_{bg}\), respectively. Therefore, \(\rho_{ug}=(\omega_{u},\varphi_{u},h_{u})^{\text{T}}\), and \(\rho_{bg}=(\omega_{b},\varphi_{b},h_{b})^{\text{T}}\). To perform the transformation, their equivalent positions in Earth-Centered-Earth-Fixed (ECEF) frame, \(\mathbf{p}_{uu}\) and \(\mathbf{p}_{be}\), are calculated first [34],  
\[\mathbf{p}_{ue}=\left( \begin{array}{c}(\frac{r_{e}}{\sqrt{1-e^{2}\text{sin}^ {2}\varphi_{u}}}+h_{u})\text{cos}\varphi_{u}\text{cos}\omega_{u}\\ (\frac{r_{e}}{\sqrt{1-e^{2}\text{sin}^{2}\varphi_{u}}}+h_{u})\text{cos}\varphi _{u}\text{sin}\omega_{u}\\ (\frac{r_{e}}{\sqrt{1-e^{2}\text{sin}^{2}\varphi_{u}}}(1-e^{2})+h_{u})\text{ sin}\varphi_{u}\end{array} \right), \tag{3}\]  
\[\mathbf{p}_{be}=\left( \begin{array}{c}(\frac{r_{e}}{\sqrt{1-e^{2}\text{sin}^ {2}\varphi_{b}}}+h_{b})\text{cos}\varphi_{b}\text{cos}\omega_{b}\\ (\frac{r_{e}}{\sqrt{1-e^{2}\text{sin}^{2}\varphi_{b}}}+h_{b})\text{cos}\varphi _{b}\text{sin}\omega_{b}\\ (\frac{r_{e}}{\sqrt{1-e^{2}\text{sin}^{2}\varphi_{b}}}(1-e^{2})+h_{b})\text{ sin}\varphi_{b}\end{array} \right), \tag{4}\]  
where \(\mathbf{p}_{ue}\) and \(\mathbf{p}_{be}\) are the UAV and the BS's position vectors, respectively. \(r_{e}\) is the earth radius, and \(e\) is a constant. Then, the UAV's position in our defined local NED frame, \(\mathbf{p}_{ul}\), is calculated as:  
\[\mathbf{p}_{ul}=(x_{ul},y_{ul},z_{ul})^{\text{T}}=\mathbf{T}_{en}(\mathbf{p}_ {ue}-\mathbf{p}_{be}). \tag{5}\]  
where \(\mathbf{T}_{en}\) denotes the transformation matrix from the ECEF coordinates to the local NED coordinates,  
\[\mathbf{T}_{en}=\left[ \begin{array}{ccc}-\text{sin}\varphi_{b}\text{cos} \omega_{b}&-\text{sin}\varphi_{b}\text{sin}\omega_{b}&\text{cos}\varphi_{b}\\ -\text{sin}\omega_{b}&\text{cos}\omega_{b}&0\\ -\text{cos}\varphi_{b}\text{cos}\omega_{b}&-\text{cos}\varphi_{b}\text{sin} \omega_{b}&-\text{sin}\varphi_{b}\end{array} \right]. \tag{6}\]  
After incorporating the UAV's position, the DoA estimation is obtained as follows:  
\[DoA=\arccos\frac{x_{ul}-x_{bl}}{\sqrt{(x_{ul}-x_{bl})^{2}+(y_{ul}-y_{bl})^{2}+ (z_{ul}-z_{bl})^{2}}}, \tag{7}\]  
where \((x_{bl},y_{bl},z_{bl})\) is the BS's position. As the BS is on the origin, Equation (7) can be simplified as follows:  
\[DoA=\arccos\frac{x_{ul}}{\sqrt{x_{ul}^{2}+y_{ul}^{2}+z_{ul}^{2}}}. \tag{8}\]  
In the prediction algorithm, position variations based on estimated UAV's movements are first calculated, and then transformed into the new estimated DoA angles. Assume a total number of \(K_{0}\) predictions of the DoA values are performed between two consecutive DoA estimations via FSI, and the \(n\)-th calculated UAV's position is denoted as \(\mathbf{p}_{n}=(\alpha_{n},\beta_{n},\lambda_{n})^{\text{T}}\), \(0\leq n\leq K_{0}\). Then, denote the \(n\)-th calculated UAV's velocity and the acceleration as \(\mathbf{v}_{n}=(u_{n},v_{n},w_{n})^{\text{T}}\), \(0\leq n\leq K_{0}\), and \(\mu=(u_{x},\mu_{y},\mu_{z})^{\text{T}}\), respectively. The status transition matrix is then given as follows:  
\[\left[