# Pseudorange Measurement Method Based on AIS Signals
## 5 Optimal Estimation of Timestamps
### Optimization Algorithm Based on a Difference Filter (OA-aDF)  
According to the above discussion, we can see that for the optimal estimation algorithm, when the number of samples is larger, the precision of the pseudorange estimation is higher. However, due to the limitations of the existing AIS protocol, it is impossible to increase the message frame length indefinitely, which also limits the pseudorange estimation accuracy. By considering that the zero-crossing detection method and the differential peak detection method independently detect the same target signal, the optimal estimation results of the two detection methods can be fused by the \(\alpha\) difference filtering algorithm. The essence of this algorithm is to improve the accuracy of pseudorange estimation by increasing the number of samples. The algorithm model is  
\[a_{df}=(1-\alpha)a_{cz}-\alpha a_{dp} \tag{21}\]  
where \(a_{cz}\) is the MMSE-EA result obtained by the zero-crossing detection method; \(a_{dp}\) is the MMSE-EA result obtained by the differential peak detection method; \(a_{df}\) is the new pseudorange estimation result after the difference filtering. \(\alpha\) is the filter coefficient to be determined.  
In order to determine the value of parameter \(\alpha\), the Monte Carlo numerical simulation was used for regular analysis. The simulation conditions were still as previously defined. We defined the new difference variable (\(a_{df}-a_{cz}\)) to measure the effect of difference filtering on the accuracy of pseudorange estimation. When the variable was negative, it showed that the estimation result of the difference filtering was better than the minimum mean square error estimation based on zero-crossing detection.  
Figure 10 shows the improvement of pseudorange estimation accuracy under different SNR and \(\alpha\) values when the AIS message frame length is 1000 bits. When \(\alpha=0\), \(a_{df}\) is equivalent to the differential peak detection method corresponding to the optimal estimation result \(a_{dp}\); when \(\alpha=1\), \(a_{df}\) is equivalent to the zero-crossing detection method corresponding to the optimal estimation result \(a_{cz}\). It can be seen from the figure that the accuracy of the pseudorange estimation results based on the differential peak detection method are inferior to the estimation method based on the zero-crossing detection method under different SNR. At the same time, it can also be seen that when the SNR is small, the difference filtering algorithm improves the pseudorange estimation results more obviously. In Figure 10, the corresponding \(\alpha\) value of the lowest point in each curve is the value of the parameter \(\alpha\) in the difference filtering algorithm under the SNR condition.  
Figure 10: The relation between \(\alpha\) and pseudorange accuracy under different SNR.  
Figure 11 shows that the curves obtained under different frame lengths are substantially coincident. This indicates that the value of parameter \(\alpha\) of the difference filtering algorithm is only related to the SNR, and has nothing to do with the length of the frame.  
Through the curve fitting method, we can get the equation of the parameter \(\alpha\), which is  
\[\alpha=0.1195\times\arctan(0.1386\times SNR-2.7634)+0.85 \tag{22}\]  
According to the difference filtering algorithm defined by Equations (21) and (22), the improvement of the pseudorange estimation accuracy under different frame length and SNR is shown in Figure 12.  
As seen in Figure 12, when the SNR is less than 20 dB, the accuracy of the MMSE-EA algorithm itself is relatively poor, so when superimposed on the differential filtering, the improvement of the pseudorange accuracy is obvious. When the SNR of the baseband signal is large, the improvement effect of the OA-\(\alpha\)DF algorithm to the pseudorange estimation value is not so obvious.  
Figure 11: The relation between \(\alpha\) and SNR under different frame length.  
Figure 12: Pseudorange improvement effect of OA-\(\alpha\)DF algorithm.