## 2 Materials and Methods
### Carrier Single Difference Solution
\begin{array}{ll}c\Delta dt_{ij}&=c\Delta dt^{\prime}_{ij}+\widetilde{\varphi }_{i}^{s}-\widetilde{\varphi}_{j}^{s}\\ &=\lambda f_{d,i}(\tau)\Big{(}C_{i}^{s}(\tau)-C_{j}^{s}(\tau)\Big{)}/c+ \widetilde{\varphi}_{i}^{s}-\widetilde{\varphi}_{j}^{s}\end{array}  \tag{21}\]  
It must be noted that \(c\Delta dt_{ij}\) is only concerned with its fractional part. In the experiment part, the compensation result of the power-on clock error is given. Finally, consider the solution of \(\eta\). It can be seen from Formula (14) that \(\eta\) includes cable delay error, multipath error, and antenna phase center error. So \(\eta\) can be collectively referred to as a hardware delay error. At the hardware level, using cables of the same type and length, adding absorbing materials, and using the same type of antenna can reduce the influence of the three errors. The correction method at the algorithm level is considered below. According to Formulas (13) and (14), \(Fr(\eta)\) can be expressed as:  
\[Fr(\eta)=Fr\Big{(}\Delta\varphi_{ij}^{s}-\Delta\widetilde{\varphi}_{ij}^{s}- c\Delta dt_{ij}\Big{)} \tag{22}\]  
\(\Delta\varphi_{ij}^{s}\) is the complete carrier single difference, which can be obtained according to Equation (3) by using the true value information of the satellite elevation angle and azimuth angle. According to Formula (22), the single epoch solution of \(Fr(\eta)\) can be obtained. Due to the complexity of the observation environment, the multipath error is difficult to quantify, but the multipath effect can be weakened by long-term observation. In addition, the phase center of the low-cost antenna will fluctuate due to the change in the incident direction of the signal, which has poor stability and introduces additional measurement errors. According to the law of the above errors, we consider using the sky grid map to describe the hardware delay error. Fill the single epoch \(Fr(\eta)\) of different directions into the grid of the sky map. Moreover, through a long period of observation, the average value in each grid can be obtained. The corrections in the sky grid map will be stored as priors. \(Fr(c\Delta dt_{ij})\) and \(Fr(\eta)\) can be used as prior values in Formula (17) to correct \(Fr(\Delta\varphi_{ij}^{s})\) in real time. So far, \(Fr(\Delta\varphi_{ij}^{s})\) can be solved. In Formula (15), \(Fr(\Delta\varphi_{ij}^{s})\) is the only value, and by combining it with the seven values of \(int\big{(}\Delta\varphi_{ij}^{s}\big{)}\), a complete carrier single-difference data set can be obtained. In the same way, the data sets solved by using other baselines can be obtained, and the corresponding elevation angle and azimuth angle information can be solved according to Formulas (5)-(10). It can be seen from Figure 2 that the four antennas form a total of four triangles, namely \(\bigtriangleup ABC\), \(\bigtriangleup ACD\), \(\bigtriangleup ABD\) and \(\bigtriangleup BDC\). In each triangle, an equation similar to Equation (4) can be constructed, and a set of corresponding \(\alpha\) and \(\beta\) can be solved through steps (5)-(10). If the integer part of the carrier single difference is reasonable, the solutions for the real numbers of \(\alpha\) and \(\beta\) can be found in the four triangles. Decompose all real numbers into a data set \(\Theta_{s}\), and \(s\) is the satellite number. The elevation angle and azimuth angle of the satellite can be calculated by using the observation value and the ephemeris file received from reference \(A\), denoted as \(\widetilde{\alpha}_{s}\) and \(\widetilde{\beta}_{s}\), which are regarded as the expected value of the elevation angle and azimuth angle of the \(s\). We can find the angle values with the smallest difference from \(\widetilde{\alpha}_{s}\) and \(\widetilde{\beta}_{s}\) in \(\Theta_{s}\), which are recorded as \(\hat{\alpha}_{s}\) and \(\hat{\beta}_{s}\). They are the final calculated values of the elevation and azimuth angles. However, if in a spoofing scenario \(\alpha\) and \(\beta\) are already close to the angles of the transmitting antenna of the spoofer.