## 5 Fast Dynamic Allan Variance  
Figure 4 shows that the DAVAR is obtained by computing the Allan variance at each analysis time epoch \(t\). With the length of \(\omega(t)\) increasing, it can result in a large computational burden. Therefore it is necessary to develop a fast algorithm for DAVAR. On the basis of the recursive characteristic of Allan variance, the recursive property of the DAVAR was found [29]. With this special characteristic, we can develop a recursive algorithm for the normal DAVAR, i.e., the fast DAVAR.  
Figure 4: Flow chart of dynamic Allan variance.  
First define another time-series \(\theta(t)\) connected to \(\omega(t)\). The relationship between them is  
\[\omega(t)=\frac{d\theta(t)}{dt} \tag{14}\]  
\(\theta(\texttt{n})\) denotes the angle, for which the dimension is given in degrees. Both \(\omega(t)\) and \(\theta(\texttt{n})\) are random quantities. Then, substituting Equations (2) and (14) into Equation (10), Equation (10), which is the normal DAVAR, can be rewritten as  
\[\sigma_{\omega}^{2}(t,\tau)=\frac{1}{2\tau^{2}(N_{w}-2\tau)}\int_{t-\frac{N_{w }}{2}+\tau}^{t+\frac{N_{w}}{2}-\tau}{(\theta(u+2\tau)-2\theta(u+\tau)+\theta( u))^{2}du}. \tag{15}\]  
Using Equation (11), we can obtain the DAVAR for the discrete time gyro signal \(\theta(n)\) as in Equation (16):  
\[\sigma_{\omega}^{2}[n,k]=\frac{1}{2k^{2}\tau_{0}^{2}}\frac{1}{N_{w}-2k}\sum_{ m=n-N_{w}/2}^{n+N_{w}/2-2k-1}{(\theta[m+2k]-2\theta[m+k]+\theta[m])^{2}}. \tag{16}\]  
In order to describe the derivation simply, we name \(\Delta_{k}[m]~{}=~{}\theta[m+2k]-2\theta[m+k]+\theta[m]\) as the discrete second order difference. Therefore Equation (16) can be rewritten as Equation (17):  
\[\sigma_{\omega}^{2}[n,k]=\frac{1}{2k^{2}\tau_{0}^{2}}\frac{1}{N_{w}-2k}\sum_{ m=n-N_{w}/2}^{n+N_{w}/2-2k-1}{\Delta_{k}^{2}[m]}. \tag{17}\]  
Using Equation (17), we can obtain the DAVAR at time point \(n+1\) as follows:  
\[\sigma_{\omega}^{2}[n+1,k]=\frac{1}{2k^{2}\tau_{0}^{2}}\frac{1}{N_{w}-2k}\sum _{m=n+1-N_{w}/2}^{n+N_{w}/2-2k}{\Delta_{k}^{2}[m]}. \tag{18}\]  
\(\sigma_{\omega}^{2}[n+1,k]\) can also be written with \(\sigma_{\omega}^{2}[n,k]\), as Equation (19) shows.  
\[\begin{split}\sigma_{\omega}^{2}[n+1,k]=\frac{1}{2k^{2}\tau_{0}^ {2}}\frac{1}{N_{w}-2k}\sum_{m=n-N_{w}/2}^{n+N_{w}/2-2k-1}{\Delta_{k}^{2}[m]}+ \frac{1}{2k^{2}\tau_{0}^{2}}\frac{1}{N_{w}-2k}({\Delta_{k}^{2}[n+\frac{N_{w}} {2}-2k]-{\Delta_{k}^{2}[n-\frac{N_{w}}{2}]}})\\ =\sigma_{\omega}^{2}[n,k]+\frac{1}{2k^{2}\tau_{0}^{2}}\frac{1}{N_ {w}-2k}({\Delta_{k}^{2}[n+\frac{N_{w}}{2}-2k]-{\Delta_{k}^{2}[n-\frac{N_{w}}{2 }]}})\end{split} \tag{19}\]  
At time \(n\), the limit of \(m\) in discrete second-order difference \(\Delta_{k}[m]\) lies in \([n-\frac{N_{w}}{2},n+\frac{N_{w}}{2}-2k-1]\). At time \(n+1\), the limit of \(m\) lies in \([n+1-\frac{N_{w}}{2},n+\frac{N_{w}}{2}-2k]\). Therefore, when we compute the \(\sigma_{\omega}^{2}[n+1,k]\) based on the \(\sigma_{\omega}^{2}[n,k]\), we just need to add the discrete second-order difference \(\Delta_{k}^{2}[n+N_{w}/2-2k]\) and subtract the discrete second-order difference \(\Delta_{k}^{2}[n-N_{w}/2]\). Equation (19) shows that the DAVAR at time \(n+1\) can be written as a function of the DAVAR at time \(n\).  
Since Equation (19) is a recursive algorithm for DAVAR, the initial value is required before the computation. On the assumption that the analysis starts at time \(n_{1}\), the starting value is as in Equation (20):  
\[\sigma_{\omega}^{2}[n_{1},k]=\frac{1}{2k^{2}\tau_{0}^{2}}\frac{1}{N_{w}-2k} \sum_{m=n_{1}-N_{w}/2}^{n_{1}+N_{w}/2-2k-1}{\Delta_{k}^{2}[m]}. \tag{20}\]  
In conclusion, with the recursive formula, it is not necessary to compute the Allan variance at every time epoch. The new DAVAR can be obtained based on the previous DAVAR. This can reduce the computation time dramatically. We named the recursive algorithm fast DAVAR and the ordinary one classical DAVAR. Figure 5 gives a flowchart of fast DAVAR.