# Research on Distributed Autonomous Timekeeping Algorithm for Low-Earth-Orbit Constellation
## 4 Experiment and Results Analysis
### Clock Error Estimation and Noise Analysis  
Using the parameter estimation method outlined in Section 3.1, the clock error is filtered under varying noise intensities. To more clearly illustrate the estimation effect, the data with link noise, real data without link noise, and estimation results are converted into frequency deviation data. The frequency deviation is shown in Figure 4, while the Allan deviation is presented in Figure 5.  
The experimental results demonstrate that the Kalman filter effectively reduces noise fluctuations in the frequency deviation and verifies the accuracy of the filter's parameter estimation. The observation clock error primarily consists of frequency white noise, random walk noise, and link noise. After applying the Kalman filter, most of the link noise and frequency white noise are filtered out, leaving the random walk noise as the dominant component.  
The Allan variance can reflect the magnitude of various types of noise. For short sampling periods, the Allan variance is dominated by white noise, while for long sampling times, it is dominated by random walk noise. Therefore, the weighted average algorithm often uses Allan variance as a weighting factor to reduce the intensity of specific noise types. In practice, to meet real-time requirements, a sliding window is employed to update the observation data and calculate the Allan variance in real time. Similar to the calculation principle of the short-time Fourier transform, the time-varying Allan variance can be obtained, as shown in Figure 6.  
\begin{table}
\begin{tabular}{l c} \hline \hline \multicolumn{1}{c}{**The STD of the Link Noise**} & \multicolumn{1}{c}{**Satellite PRN**} \\ \hline
0.1 ns & G01 G03 G04 G05 \\
0.2 ns & G06 G07 G08 G09 G10 G11 G12 G13 \\
0.3 ns & G14 G15 G16 G17 G18 G21 G23 G24 G25 G26 G27 G28 \\
0.4 ns & G29 G30 G32 C08 C11 C12 C14 C16 C19 C21 C22 C23 \\
0.6 ns & C24 C25 C26 C30 C32 C33 C34 C35 \\
0.8 ns & C36 C37 C38 C40 \\ \hline \hline \end{tabular}
\end{table}
Table 1: The settings for the satellite data and the STD of the link noise.  
Figure 4: Filtered frequency deviation. (**a**) Overlay of 0.2 ns link noise; (**b**) overlay of 0.4 ns link noise; (**c**) overlay of 0.6 ns link noise; (**d**) overlay of 0.8 ns link noise.  
Figure 5: _Cont._  
To reduce weight fluctuations caused by data windowing, an exponential filter is applied to smooth the Allan deviation. The formula is as follows:  
\[\hat{\sigma}(t+\tau)=\frac{L}{L+1}\hat{\sigma}(t)+\frac{1}{L+1}\sigma(t+\tau) \tag{23}\]  
where \(\hat{\sigma}(t)\) is the Allan deviation after smoothing filtering at time \(t\), \(\hat{\sigma}(t+\tau)\) is the Allan deviation calculated by \(t+\tau\) time data, and \(L\) is the smoothing factor. Figure 7 presents the time variation in the Allan deviation calculated by a satellite for sampling times of 1000 s and 100,000 s at different \(L\) values. \(L=0\) represents the situation without exponential filtering.  
With a larger \(L\) value, the filtering results are less sensitive to current observations, causing the data to change slowly. Conversely, a smaller \(L\) value makes the filtering results overly sensitive to current observations, leading to faster data changes. To ensure that the Allan deviation does not fluctuate excessively while still reflecting the data trend, a balanced choice is necessary. Thus, this paper sets \(L\) to 5.  
The experimental results show that the Allan variance changes little with time and is a relatively stable statistic. After exponential filtering, there are only small fluctuations, so the weight calculated by the Allan variance will not change significantly over time.  
Figure 5: Allan deviation before and after Kalman filtering. (**a**) Overlay of 0.2 ns link noise; (**b**) overlay of 0.4 ns link noise; (**c**) overlay of 0.6 ns link noise; (**d**) overlay of 0.8 ns link noise.  
Figure 6: Allan deviation varies with time.