## 3 Spoofing Detection Method
### Hypothesis Test  
First, the CNR and carrier phase of satellite \(i\) and satellite \(j\) are obtained by a single rotating antenna. Then, \(d\hat{\varphi}_{ij}\), \(d\hat{\gamma}_{ij}\), \(\hat{M}_{i}\), and \(\hat{M}_{j}\) are calculated. Finally, the sum of squares due to error (SSE) is established to evaluate the differences between the estimated and predicted values of the above variables:\[SSE=\underbrace{\frac{\left(d\hat{\phi}_{ij}-d\varphi_{ij}\right)^{2}}{\sigma_{ \phi,i}^{2}+\sigma_{\phi,j}^{2}}}_{SSE_{1}}+\underbrace{\frac{\left(d\hat{\gamma }_{ij}-d\varphi_{ij}\right)^{2}}{\sigma_{\gamma,i}^{2}+\sigma_{\gamma,j}^{2}}}_ {SSE_{2}}+\underbrace{\frac{\left(\hat{M}_{i}+2r\sin(\omega T_{0})\cos\theta_ {i}\right)^{2}}{\sigma_{M,i}^{2}}+\frac{\left(\hat{M}_{j}+2r\sin(\omega T_{0}) \cos\theta_{j}\right)^{2}}{\sigma_{M,j}^{2}}}_{SSE_{3}} \tag{25}\]  
where \(SSE_{1}\) is determined by the azimuth angle estimated from the CNR, \(SSE_{2}\) is determined by the azimuth angle estimated from the CPSD, and \(SSE_{3}\) is determined by the elevation angle estimated from the CPSD. If there is no spoofing signal, the estimated value of the above variables should be consistent with the predicted value, and the difference between the two should be a normal distribution of a zero mean value. In this case, the SSE statistical value should meet the Chi-squared distribution with four degrees of freedom, which is recorded as \(\chi^{2}(4)\). When there is a spoofing signal, there will be a deviation between the estimated and predicted values of the above variables. The SSE should meet the non-central chi-squared distribution, with a degree of freedom of 4 and an eccentricity of \(\Delta\). Based on the above analysis, the following assumptions are established:  
\[ \begin{split} H_{0}&:SSE\sim\chi^{2}(4)\ no\ spoofing\\ H_{1}&:SSE\sim\chi^{2}(4,\Delta)\ spoofing\\ \Delta&=\frac{\left(d\hat{\varphi}_{ij}-d\varphi_{ ij}\right)^{2}}{\sigma_{\phi,i}^{2}+\sigma_{\phi,j}^{2}}+\frac{\left(d \gamma_{ij}-d\varphi_{ij}\right)^{2}}{\sigma_{\gamma,i}^{2}+\sigma_{\gamma,j}^ {2}}+\frac{\left(M_{i}+2r\sin(\omega T_{0})\cos\theta_{i}\right)^{2}}{\sigma_ {M,i}^{2}}+\frac{\left(M_{i}+2r\sin(\omega T_{0})\cos\theta_{i}\right)^{2}}{ \sigma_{M,i}^{2}}\end{split}  \tag{26}\]  
The probability density function of the SSE under the zero hypothesis and alternative hypothesis is:  
\[ \begin{split} p(SSE|H_{0})&=\frac{SSE^{-SSE}/2}{4 \Gamma(4)}SSE\geq 0\\ p(SSE|H_{1})&=\frac{e^{-(SSE+\epsilon)/2}\sqrt{SSE /\Delta}}{2}I_{1}(\sqrt{SSE}\Delta)SSE\geq 0\end{split}  \tag{27}\]  
where \(\Gamma(\cdot)\) is the gamma function and \(I_{1}(\centerdot)\) is the Bessel function of the first-order transformation of the first kind. Establishing the GLRT:  
\[\lambda(SSE)=\frac{p(SSE|H_{1})}{p(SSE|H_{0})}\gtrapprox{H_{1}}{H_{0}}\eta \tag{28}\]  
where \(\eta\) is the detection threshold. According to the Neyman-Pearson criterion, the threshold value \(SSE_{th}\) is set to determine the detection probability \(P_{fa}\) under a specific false alarm probability \(P_{D}\):  
\[\left\{\frac{P_{fa}=P\{SSE>SSE_{th}\mid H_{0}\}=1-\int_{0}^{SSEh}p_{\chi^{2}(4 )}(SSE)dSSE}{P_{D}=P\{SSE>SSE_{th}\mid H_{1}\}=\int_{SSE_{th}}^{\infty}p_{\chi^ {2}(4)}(SSE)dSSE}\right. \tag{29}\]  
Based on the above analysis, the spoofing-detection method shown in Figure 4 is designed, and the detailed process is as follows:  
Phase 1: Data Collection  
1. Collect the CNR data of satellite \(i\), defined as \(CNR_{i}(k)\), where \(i=1,2,\cdots,I\) represents the satellite number, and \(k=0,1,2,\cdots,N-1\) represents the time of the data. 2. Collect the carrier phase measurement value of satellite \(i\), defined as \(\Phi_{i}(k)\). Calculate the carrier phase change value caused by the satellite's motion relative to the origin O. Then, perform forward and backward differentiation on the carrier phase measurement value to obtain the CPSD, denoted as \(d\Phi_{i}(k)\). Phase 2: MLE of Parameters  
1.