Enum ClockChoice
Defined in File ClockBiasesStateBlock.hpp
Enum Documentation
enum that toggles between different Q models.
Values:
‘QD’ as given in Brown and Hwang with flicker terms \( h_{-1} \) included.
For two states, the matrix is as follows: \( \begin{bmatrix} \frac{h_0}{2}dt + 2h_{-1}dt^2 + \frac{2}{3}\pi^2h_{-2} dt^3 & \pi^2h_{-2}dt^2 \\ \pi^2h_{-2}dt^2 & 4h_{-1} + 2\pi^2h_{-2}dt \end{bmatrix} \)
Estimates clock error and drift using three Allan variance coefficients. enum that toggles between different Q models. Please note that for three states, the matrix below is added to its corresponding expanded two-state matrix with an extra row and column of zeroes:
\( \begin{bmatrix} \frac{Q_3dt^5}{20} & \frac{Q_3dt^4}{8} & \frac{Q_3dt^3}{6} \\ \frac{Q_3dt^4}{8} & \frac{Q_3dt^3}{6} & \frac{Q_3dt^2}{2} \\ \frac{Q_3dt^3}{6} & \frac{Q_3dt^2}{2} & Q_3dt \end{bmatrix} \)
References: (1) Brown, R. G., & Hwang, P. Y. (1997). Introduction to Random Signals and Applied Kalman Filtering, by Brown, Robert Grover.; Hwang, Patrick YC New York: Wiley, c1997. Chapter 11 page 430, third edition.
(2) Relationship between Allan Variances and Kalman Filter Parameters. A.J. Van Dierendonck, J.B. McGraw and R. G. Brown.
(3) Time and Frequency: Theory and Fundamentals, Byron E. Blair, Editor, NBS Monograph 140, May 1974.
States:
0 - The clock’s bias (seconds).
1 - The clock’s average drift over propagation period (seconds/seconds).
This clock bias model assumes that clock errors are the result of 3 separate noise processes acting upon the frequency of the clock- a white noise source, a ‘flicker’ noise, and a random walk. The propagation of these states is simple, but the calculation of the noise covariance matrix is difficult with the flicker noise term included. Reference (2) gives the matrix as (see ClockModel for coefficient definitions):
\( \begin{bmatrix} \frac{h_0}{2}\Delta t + 2 h_{-1}\Delta t^2 + \frac{2}{3}\pi^2 h_{-2}\Delta t^3 & 2h_{-1}\Delta t + \pi^2 h_{-2}\Delta t^2 \\ 2h_{-1}\Delta t + \pi^2 h_{-2}\Delta t^2 & \frac{h_0}{2\Delta t} + 2h_{-1} + \frac{8}{3} \pi^2h{-2}\Delta t \end{bmatrix}\)
Ref (1) cites Ref (2) but states that the result is incorrect, giving instead:
\( \begin{bmatrix} \frac{h_0}{2}\Delta t + 2h_{-1}\Delta t^2 + \frac{2}{3}\pi^2h_{-2}\Delta t^3 & h_{-1}\Delta t + \pi^2h_{-2}\Delta t^2 \\ h_{-1}\Delta t + \pi^2h_{-2}\Delta t^2 & \frac{h_0}{2\Delta t} + 4h_{-1} + \frac{8}{3}\pi^2h_{-2}\Delta t \end{bmatrix} \)
However, attempting to validate yields a different result. Following along with Ref (2), the correlation function is given as:
\( R_{xy}(t, \tau) = \int^t_0 h_x(u)h_y(u + \tau)\delta u; \tau \geq 0 \)
With the covariance at 0 correlation time:
\( R_{xy}(t) = \int^t_0 h_x(u)h_y(u)\delta u \)
where \( h_n(t) \) is the impulse response functions for the various noise sources.
The impulse responses for the clock bias process (first state) are given:
\( h_{x_0}(t) = \sqrt{\frac{h_0}{2}}\mu(t) \)
\( h_{x_{-1}}(t) = 2\sqrt{h_{-1}t} \)
\( h_{x_{-2}}(t) = \pi\sqrt{2h_{-2}}t \)
where \( \mu(t) \) is the unit step function.
The second state models drift in the first state. Modeling the instantaneous value of this process is problematic, so it is instead redefined as the average fractional frequency:
\( \overline{y}(t) = \frac{x(t + \Delta t) - x(t)}{\Delta t} \)
In other words, it is the average value of the frequency drift (in sec/sec) over some sample time \( \Delta t\), which for our purposes is the filter propagation interval.
The covariance we are looking for is \( cov[x(t), \overline{y}(t)]\). Plugging each \( h_{x_n} \) into the above equation to to solve for \( h_{\overline{y}_n} \):
\( h_{\overline{y}_0}(t) = \frac{\sqrt{\frac{h_0}{2}}\mu(t + \Delta t) - \sqrt{\frac{h_0}{2}}\mu(t)}{\Delta t} = 0\)
\( h_{\overline{y}_{-1}}(t) = \frac{ 2\sqrt{h_{-1}(t + \Delta t)} - 2\sqrt{h_{-1}t} }{\Delta t} = \frac{2 \sqrt{h_{-1}}}{\Delta t} (\sqrt{t + \Delta t}\sqrt{t}) \)
\( h_{\overline{y}_{-2}}(t) = \frac{ \pi\sqrt{2h_{-2}}(t + \Delta t) - \pi\sqrt{2h_{-2}}t }{\Delta t} = \pi \sqrt{2h_{-2}}\)
The covariance matrix is (all \( h_{k_n} \) are uncorrelated with \( h_{k_m} \) when \( n \neq m \) ):
\( \begin{bmatrix} \sum_{n=0}^2 \int^t_0 [h_{x_n}(\rho)]^2 \delta \rho & \sum_{n=0}^2 \int^t_0 h_{x_n}(\rho)h_{\overline{y}_n}(\rho) \delta \rho\\ \sum_{n=0}^2 \int^t_0 h_{x_n}(\rho)h_{\overline{y}_n}(\rho)\delta\rho & \sum_{n=0}^2 \int^t_0 [h_{\overline{y}_n}(\rho)]^2 \delta \rho \end{bmatrix} \)
We start with the variances:
\( \sigma^2_{x_0} = \int^t_0 [\sqrt{\frac{h_0}{2}} \mu(\rho)]^2 \delta \rho = \frac{h_0}{2} \int^t_0 1 \delta\rho = \frac{h_0 t}{2} \)
\( \sigma^2_{x_{-1}} = \int^t_0 [2\sqrt{h_{-1}\rho}]^2\delta \rho = 4h_{-1}\int^t_0\rho \delta\rho = 2h_{-1}t^2 \)
\( \sigma^2_{x_{-2}} = \int^t_0 [\pi\sqrt{2h_{-2}}\rho]^2\delta \rho = 2\pi^2h_{-2}\int^t_0 \rho^2\delta\rho = \frac{2\pi^2h_{-2}t^3}{3} \)
\( \sigma^2_{\overline{y}_0} = \int^t_0 [0]^2 \delta \rho = C \)
\( \sigma^2_{\overline{y}_{-1}} = \int^t_0 [\frac{2\sqrt{h_{-1}} }{\Delta t} (\sqrt{\rho + \Delta t} - \sqrt{\rho})]^2 \delta \rho = \frac{4h_{-1}}{\Delta t^2}\int^t_0[2\rho + \Delta t - 2\sqrt{\rho + \Delta t} \sqrt{\rho}] \delta \rho \\ = \frac{4h_{-1}}{\Delta t^2}[t^2 + t\Delta t] - \frac{8h_{-1}}{\Delta t^2}\int^t_0\sqrt{\rho + \Delta t}\sqrt{\rho} \delta \rho \)
The remaining integral term is thorny; possible solutions include approximating the integral as a truncated series, numerical methods like Simpson’s rule, or considering the steady state where \( t \gg \Delta t \) such that \( \sqrt{\rho + \Delta t} \approx \sqrt{\rho} \), which results in:
\( \frac{4h_{-1}}{\Delta t^2}[t^2 + t\Delta t] - \frac{4h_{-1}}{\Delta t^2} t^2 = \frac{4h_{-1}}{\Delta t}t \)
\( \sigma^2_{\overline{y}_{-2}} = \int^t_0 [\pi\sqrt{2h_{-2}}]^2 \delta \rho = 2\pi^2h_{-2}t \)
And finally the cross terms:
\( \sigma_{xy_0}\sigma(t) = \int^t_0 \sqrt{\frac{h_0}{2}}\mu(\rho) * 0 \delta\rho = C \)
\( \sigma_{xy_{-1}}(t) = \int^t_0 2\sqrt{h_{-1}\rho} \frac{2 \sqrt{h_{-1}} (\sqrt{\rho + \Delta t} - \sqrt{\rho}) }{\Delta t}\delta \rho \\ = \frac{4h_{-1}}{\Delta t}\int^t_0\sqrt{\rho}(\sqrt{\rho+ \Delta t} - \sqrt{\rho}) \delta \rho \\ = \frac{4h_{-1}}{\Delta t}\int^t_0\sqrt{\rho}\sqrt{\rho + \Delta t} - \rho \delta \rho \\ = -\frac{2h_{-1}t^2}{\Delta t} + \frac{4h_{-1}}{\Delta t}\int^t_0\sqrt{\rho}\sqrt{\rho + \Delta t}\delta \rho \)
Clearly, this integral has the same issue as the previous one. Again using the steady-state approximation results in:
\( -\frac{2h_{-1}t^2}{\Delta t} + \frac{4h_{-1}}{\Delta t}\int^t_0 \rho \delta \rho = -\frac{2h_{-1}t^2}{\Delta t} + \frac{2h_{-1}t^2}{\Delta t} = 0 \)
\( \sigma_{xy_{-2}}(t) = \int^t_0 \pi\sqrt{2h_{-2}}\rho * \pi\sqrt{2h_{-2}} \delta\rho = 2\pi^2h_{-2}\int^t_0\rho\delta\rho = \pi^2h_{-2}t^2 \)
Finally, we put the results together giving:
\( \begin{bmatrix} \frac{h_0 t}{2} + 2h_{-1}t^2 + \frac{2}{3}\pi^2h_{-2}t^3 & \pi^2h_{-2}t^2 \\ \pi^2h_{-2}t^2 & \frac{4h_{-1}}{\Delta t}t + 2\pi^2h_{-2}t \end{bmatrix} \)
‘QD’ as given in Brown and Hwang but with flicker \( h_{-1} \) terms removed.
For two states, the matrix is as follows: \( \begin{bmatrix} \frac{h_0}{2}dt + \frac{2}{3}\pi^2h_{-2}dt^3 & \pi^2h_{-2} dt^2 \\ \pi^2h_{-2}dt^2 & \frac{h_0}{2dt} + \frac{8}{3}\pi^2h_{-2}dt \end{bmatrix} \)
Same as ‘QD3’ but with a flicker term added to the cross terms.
For two states, the matrix is as follows: \( \begin{bmatrix} \frac{h_0}{2}dt +\frac{2}{3}\pi^2h_{-2}dt^3 & h_{-1}dt + \pi^2 h_{-2}dt^2 \\ h_{-1}dt + \pi^2h_{-2}dt^2 & 2\pi^2h_{-2}dt \end{bmatrix} \)
Standard Qd model with Q defined as: \( \begin{bmatrix} S_f & 0 \\ 0 & S_g\end{bmatrix} \).
where \( S_f \) and \( S_g \) are given in Brown and Hwang as \( S_f = \frac{h_0}{2} \) and \( S_g = 2\pi^2h_{-2} \)
For two states, the matrix is as follows: \( \begin{bmatrix} \frac{h_0}{2}dt + \frac{2}{3}\pi^2h_{-2}dt^3 & \pi^2h_{-2} dt^2 \\ \pi^2h_{-2}dt^2 & 2\pi^2h_{-2}dt \end{bmatrix} \)