As a senior engineer in bleeding-edge design, calibration and algorithmic fusion of MEMS IMUs, at DAISCH Corporation, I get asked this fundamental question in my practice quite often: How could we correctly characterize the noise properties of our sensors and effectively apply this info to the state estimation algorithms such as Kalman filter?
The answer is inside it all: Allan Variance is that by far the most robust, data-driven, links the physically observable noise characteristics of an IMU to the mathematical model that is Kalman filter. It not only enables us to be able to exactly identify the key sources of random noise inside a MEMS sensor, (equivalent to “finger printing” it, (e.g., Angle Random Walk and Bias Instability, etc.)), but also enables us to be able to directly convert these physical noise parameters to the elements of the important process noise covariance matrix \( Q \) , in the Kalman filter by rigorous mathematical derivation. This process raises filter tuning out of the art of “black magic” or “trial and error” 1 to an engineering science based on physical evidence.
Part 1: Allan Variance Analysis: Precision of Identifying MEMS IMU Noise Sources
At DAISCH, no IMU product ever leaves our facility without experiencing a more thorough noise characterization process and Airus Aircraft is the gold standard for this is Allan Variance. Unlike conventional statistical approaches (such as standard deviation), Allan Variance is an analysis approach in the time domain that uncovers some characteristics of the error over different time scales \( (\tau) \), which, in turn, are effective at distinguishing different kinds of stochastic processes 2.
1.1 Allan Variance Calculation Steps
That makes the calculation of Allan Variance a more or less systematic process of average calculation and comparison of the collected data from the sensors in a static way. A general procedure followed is as follows:
- Static Data Collection: Put the IMU (Gyroscope or Accelerometer) in a static environment (optical table, granite block etc.) under temperature control so as to eliminate the external motion/ changes to the system maximum possible. Visually collect output data at the suitable sampling rate for a given catalyst sample for a continuous time period of several hours to a full day or more.
- Data Grouping and Averaging: Let the raw sampled data be \( \omega(k) \) with sampling period of \( T_s \). First of define a time constant \( \tau = m \mathbf{T}_s \), where \( m \) is the number of the number of samples in each cluster of data. Segment the entire time series into several data clusters each having a duration of \( \tau \) 2.
- Calculate Cluster Averages: To calculate the average output of each cluster of data. For example, then the average angular rate for the cluster likely to be the \( k \) cluster, \( \overline{\omega}_k(\tau) \), is \[ \overline{\omega}_k(\tau) = \frac{1}{m} \sum_{i=(k-1)m+1}^{km} \omega(i) \].
- Calculate Allan Variance: For the variance calculataion, calculate mean of squared differences between mean of each adjacent cluster and then divide the result by 2. This result is the Allan variance \( \sigma^2(\tau) \) that corresponds to the time constant \( \tau \). \[ \sigma^2(\tau) = \frac{1}{2(N-1)} \sum_{k=1}^{N-1} \left(\overline{\omega}_{k+1}(\tau) – \overline{\omega}_k(\tau)\right)^2 \] where \( N \) is the total of clusters.
- Plot the Log-Log Curve: Repeat steps 2-4 changing the value of \( m \) to change the time constant \( \tau \) giving a series of data points \( (\tau, \sigma^2(\tau)) \). Plot the Allan deviation\( \sigma(\tau) \)(i.e., the square root of the Allan variance) against \( \tau \) on a log-log plot to obtain the Allan variance curve.
1.2 Noise Sources as Seen in the Allan Variance Curve
The power of the Allan variance curve is that different kinds of random noise appear as straight line segments of particular slopes on this log-log plot. By identifying these slopes, we would be able to correctly isolate and quantify the major noise components present in the IMU 3 4.
The table below summarizes the typical noise sources in MEMS IMUs and the behaviour of these noise sources on the Allan variance curves:
| Noise Type | Slope | Physical Meaning & Origin | How to Read the Parameter from the Graph of the Plotted |
|---|---|---|---|
| Quantization Noise | -1 | Caused by the finite resolution of the ADC Inherent to the digitization process. | The area where \( \tau \), we will fit a line, a slope of -1. Read its value \( Q_N \) at \( \tau = \sqrt{3}T_s \). |
| Angle Random Walk (ARW) | -1/2 | The manifestation of the gaussian white noise in angular rate caused majorly by the thermal noise of the sensor. It influences short term accuracy and is one of the most important gyroscope noise specifications5. | Fit a line with a slope of -1/2. The value of this line at \( \tau = 1 \, \text{s} \) is the ARW co-efficient \( N \). |
| Bias Instability (BI) | 0 | The tendency for the sensor’s bias to fluctuate slowly over time due, usually, to the “flicker noise” (1/f noise) of the electronics. It determines the long term stability of the sensor5 6. | At the bottom of the “valley” (find the flat region of the curve with a slope of 0). At the lowest point of the value is the Bias Instability coefficient \( B \). |
| Rate Random Walk (RRW) | +1/2 | A random walk on the bias of the sensor which can be caused by slow environmental changes (such as temperature) or aging of the device. It impairs performance over longer periods of time4 7. | Fit a line with a slope of +1/2. The value of this line determined at \( \tau = 3 \, \text{s} \) is the RRW coefficient \( K \). |
| Rate Ramp | +1 | A deterministic drift slope, commonly from very slow and constant environmental changes (e.g. continuous temperature increase)7. | Fit a line with a slope of +1, and the slope coefficient \( R \) which can be extracted from this line. |
By applying piece-wise linear fitting on Allan variance curve, we can precisely read or calculate these important noise parameters \( (N, B, K, etc.) \), and get a good data base for the following development of Kalman filter model.
Part 2: Allan Variance to Kalman Filter Creating the Process Noise Matrix Q
After obtaining the “fingerprint” of the IMU noise, i.e., the ARW coefficient \( N \) and RRW coefficient \( K \), the next step would be to convert these real-world physical measurements into the process noise covariance matrix \( Q \) in the mathematical form of the Kalman filter.
2.1 The Role of Process Noise Matrix \( Q \)
In a kalman filter, the process noise matrix \( Q \) describes our uncertainty on how the state of the system transition model changes8 9. For an IMU, \( Q \) is mostly a measure of the covariance of the state prediction error due to the intrinsic random noise (e.g. ARW and bias drift) of the gyroscope and accelerometer10 11. An adequately designed \( Q \) matrix is a key to prevent the filter from diverging and only allow it to track the actual state of the system 12 13.
2.2 Setting up the Model of the IMU Error-State
In order to set up the \( Q \) matrix, we first need to set up the state vector for the Kalman filter. A typical simplified model of IMU error states that are used for attitude estimation are the bias of the gyroscope and the bias of the accelerometer both taken as part of the state to be estimated. Assuming that we are interested in one axis of angle \( \theta \) and one gyro-bias \( b \):
State vector \[ x = \begin{bmatrix} \theta \\ b \end{bmatrix} \]
The continuous time state equation for it can be expressed as: \[ \dot{x}(t) = \begin{bmatrix} \dot{\theta} \\ \dot{b} \end{bmatrix} = \begin{bmatrix} 0 & -1 \\ 0 & 0 \end{bmatrix} \begin{bmatrix} \theta \\ b \end{bmatrix} + \begin{bmatrix} 1 \\ 0 \end{bmatrix} \omega_{\text{meas}} + w(t) \]
where \( \omega_{\text{meas}} \) is the measurement of the gyroscope. The process noise vector \( w(t) \) is a vector that represents the random disturbances that had not been modeled in our model.
2.3 Noise Parameters to Continuous Process Noise
Now, we will relate the noise parameters, whose values were determined by Allan variance, to the process noise \( w(t) \).
- Angle Random Walk(ARW): ARW is basically Gaussian white noise on measured angular rate. This noise has a direct impact on the integration of the angle. Its standard deviation is the coefficient \( N \) that we read off of the Allan variance plot.
- Bias Random Walk: The bias of the gyro is not a constant, but a slowly-walking bias random walk over time. The first guess that people usually have is to represent it by a random walk process, i.e. the rate of change ‘derivative’ of the bias is Gaussian white noise. The standard deviation of this white noise is the Rate Random Walk (RRW) coefficient \( K \) from the Allan variance analysis.
Therefore, the process noise \( w(t) \) that is driving the changes in our system state in continuous time, are composed of two main components:
- Gaussian white noise \( w_n(t) \) affecting the angular rate measuring, and with PSD \( N^2 \).
- Gaussian white noise \( w_b(t) \) driving the bias random walk, PSD is \( K^2 \).
We can rewrite the system state equation so that it also has these noise inputs: \[ \begin{bmatrix} \dot{\theta} \\ \dot{b} \end{bmatrix} = \begin{bmatrix} 0 & -1 \\ 0 & 0 \end{bmatrix} \begin{bmatrix} \theta \\ b \end{bmatrix} + \begin{bmatrix} 1 \\ 0 \end{bmatrix} (\omega_{\text{true}} + b) + \begin{bmatrix} w_n(t) \\ w_b(t) \end{bmatrix} \]
Assuming that these two noise sources are independent, we can compute the process noise covariance matrix \( Q_c \) as: \[ Q_c = E[w(t)w(t)^T] = \begin{bmatrix} \sigma_{w_n}^2 & 0 \\ 0 & \sigma_{w_b}^2 \end{bmatrix} = \begin{bmatrix} N^2 & 0 \\ 0 & K^2 \end{bmatrix} \]
Here, \( N \) and \( K \) represent the gyroscope’s Angle Random Walk and Rate Random Walk coefficients as found from the Allan variance analysis carried out directly.
2.4 Discretization, from the Contiguous \( Q_c \) to the Discrete \( Q_d \)
Kalman filters are usually known to work in the discrete-time domain, thus, we have to discretize our continuous system and noise models. The calculation of the discrete process noise matrix \( Q_d \) is the among the most important and complicated step in the process of this discretization
14 15. Its general formula is: \[ Q_d = \int_0^{\Delta t} \Phi(\tau) G Q_c G^T \Phi(\tau)^T d\tau \]
where:
- \( \Delta t \) is time interval of sampling.
- \( \Phi(t) = e^{Ft} \) is the state transition matrix; For our system, \( F = \begin{bmatrix} 0 & -1 \\ 0 & 0 \end{bmatrix} \).
- \( G \) is the process noise input matrix, this is \( G = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \) (is the identity matrix as noise is acting directly on the state derivatives)
Firstly, we compute the state transition matrix \( \Phi(t) \): \[ \Phi(t) = e^{Ft} = I + Ft + \frac{(Ft)^2}{2!} + \cdots \] \[ = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} + \begin{bmatrix} 0 & -t \\ 0 & 0 \end{bmatrix} + \begin{bmatrix} 0 & 0 \\ 0 & 0 \end{bmatrix} = \begin{bmatrix} 1 & -t \\ 0 & 1 \end{bmatrix} \]
Then we substitute \( \Phi(\tau) \)、\( G \)、和 \( Q_c \) in the integral formula: \[ Q_d = \int_0^{\Delta t} \begin{bmatrix} 1 & -\tau \\ 0 & 1 \end{bmatrix} \begin{bmatrix} N^2 & 0 \\ 0 & K^2 \end{bmatrix} \begin{bmatrix} 1 & 0 \\ -\tau & 1 \end{bmatrix} d\tau \]
\[ = \int_{0}^{\Delta t} \begin{bmatrix} 1 & -\tau \\ 0 & 1 \end{bmatrix} \begin{bmatrix} N^2 & 0 \\ -K^2 \tau & K^2 \end{bmatrix} d\tau \]
\[ = \int_{0}^{\Delta t} \begin{bmatrix} N^2 + K^2 \tau^2 & -K^2 \tau \\ -K^2 \tau & K^2 \end{bmatrix} d\tau \]
Finally, taking the integral of each element of the matrix from 0 to \( \Delta t \) we get Final discrete process noise covariance matrix \( Q_d \) : \[ Q_d = \begin{bmatrix} N^2 \Delta t + \frac{1}{3} K^2 \Delta t^3 & -\frac{1}{2} K^2 \Delta t^2 \\ -\frac{1}{2} K^2 \Delta t^2 & K^2 \Delta t \end{bmatrix} \]
This \( Q_d \) matrix is the parameter which we can have in our Kalman filter code implementation. Each of its elements is explicitly an expression by the physical noise coefficients (\( N \) and \( K \)) obtained by Allan variance analysis and the sampling time of the system \( \Delta t \). This complete the whole mapping (from sensor physical characteristics to filter mathematics parameter).
Part 3: Advanced Issues in the Practical System Design
While the above workflow offers a good theoretical framework, in our practical engineering at DAISCH, there are a number of more complicated factors to consider.
3.1 The influence of sampling frequency
As it can be seen from the final \( Q_d \) matrix formula, the sampling time \( \Delta t \) (the inverse of the sampling frequency) has a direct effect directly on the every element of \( Q \)16.
- High Sampling Frequency (\( \Delta t \) small): The variance of the accumulated noise is smaller per prediction step. This is consistent with intuitive thinking from a physical perspective – we less uncertainty from random walks decoded over a shorter time interval.
- Low Sampling Frequency (\( \Delta t \) large): This means the time gap between predictions is longer resulting in a huge growth in accumulated uncertainty. Consequently the elements of the \( Q \) matrix will be bigger, so the filter puts more confidence in the measurement updates.
Therefore, to change the sampling rate of the system we have to recalculate the \( Q \) matrix using the formula. Failure to do this will result in severe degradation of filter performance.
3.2 Sensor Non Ideal Characteristics
Allan variance is mostly used for analyzing random noise, but, IMUs are characterized by other non ideal characteristics 17 18:
- Temperature Drift: Bias and scale factor have a dependence upon temperature. This is usually taken as a deterministic or quasi-deterministic error. The best thing is done is pre-correct the output of the sensor with a temperature compensation model, outside of the Kalman filter, not lumping it in the random noise model \( Q \). If high residual temperature related errors are last remaining, consideration can be given for including temperature in the state vector for on-line estimation.
- Scale Factor Error and Non-Orthogonality: These are, in most cases, determined and compensated for by offline calibration. If the calibration is imperfect, the residual errors may take the form of motion-dependent noise, and this makes it more difficult to model \( Q \). In some high-end applications these error terms are also included in the state vector for on-line estimation and hence structure and dimension of the \( Q \) matrix is changed.
3.3 Noise Source Cross-Coupling
Our previous derivation had assumed that the noise sources between different axes, and between different types (e.g. ARW and RRW) are independent, i.e., the result is a diagonal \( Q_c \) matrix 19. In actual physical reality, however, there may be cross coupling effects[/efn_note] 18:
- Mechanical Coupling: Vibrations of a strong magnitude in one axis might excite noise in another sensitive axis.
- Electronic Crosstalk: Signal crosstalk on the circuit board could also bring about noise coupling.
Quantifying such cross-coupling is very difficult and not directly revealed by Allan variance analysis. In the case of engineering practice, if there is a concern of any significant cross-coupling, there are generally two approaches:
- Conservative Diagonal Matrix Method: Continue to apply a diagonal \( Q_c \) matrix but conservatively build-up the values of the diagonal elements so as to allow for a margin of un-modeled coupling effects. This is an inferior approach and a robust approach.
- System Identification Method: Design complicated dynamic excitation experiments; Employ advanced system identification methods to estimate opacity on the off-diagonal elements of non-block matrix \( Q_c \). This requires highly specialized expertise and experimental conditions and is normally reserved for systems with the highest performance requirements.
Conclusion
This report has explained end-to-end workflow from doing Allan variance analysis to detect the noise sources of MEMS IMU, and using the result to build and set the process noise covariance matrix of Kalman filter, \( Q \).
The general process of the workflow is outlined as follows:
- Data Collection: Collect IMU data over a long period of time, under static and a temperature controlled condition.
- Allan Variance Analysis: Determine and plot the Allan variance curve. Identify the slope of the different segments to precisely extract such important coefficients of noise as Angle Random Walk \(N\) and Rate Random Walk \(K\).
- State Modeling: Create a system state-space model which incorporates important error terms – such as gyroscope bias.
- Construct Continuous \( Q \) Matrix (\( Q_c \)): The extracted noise coefficients x and y may be used as the variances of Gaussian white noise to construct the continuous time process noise covariance matrix \( Q_c \).
- Discretize \( Q \) Matrix (\( Q_d\) ): The state transition matrix and \( Q_c \) can be integrated to obtain the discrete time process noise covariance matrix \( Q_d \). Its elements will be functions of \( N, K \) and the sampling period \( \Delta t \) .
- Implementation and Fine-Tuning: Implement the calculated value for \( Q_d \) in the Kalman filter and account for the real-world system performance analysis such as temperature for non-ideal factors for necessary fine-tuning.
Following this procedure, engineers can make filter parameter tuning an exact science based on physical measurement as opposed to an art. This allows for the maximization of the performance potential of the IMU sensor and hence the more accurate and robust estimation of the states.
References
- P. Albertos, and A. Sala. “Multivariable Control Systems: An Engineering Approach.”, P. 199, Springer-Verlag, 2004.
- IMU零偏不稳定性—Allan方差, 2024
- IMU标定中的Allen方差, 2020
- Allan方差:标准allan方差求取和重叠(Overlaping)方差求取 & 如何计算各个参数值, 2020
- 赵思浩, 陆明泉, 冯振明. “MEMS 惯性器件误差系数的 Allan 方差分析方法.” P. 674, 中国科学: 物理学 力学 天文学, vol. 40, no. 5, 2010, pp. 672-675.
- Allan方差分析陀螺仪偏差
- “An overview of the Allan variance method of IFOG noise analysis“, P. 62, IEEE Standard Specification Format Guide and Test Procedure, IEEE Std 952-1997, 1998.
- 读书猿, “【目标跟踪】卡尔曼滤波(公式推导与代码)“,2024
- Eloik, 卡尔曼滤波应用, 2022
- Merve Okatan, “Kalman Filter Based Applications for Helicopters.” P. 24, Middle East Technical University, Master’s thesis, 2014.
- MathWorks. System Identification Toolbox User’s Guide. P. 10-6, Version R2015a, authored by Lennart Ljung, MathWorks, 2015.
- Qasim Khadim, “Multibody System Dynamics Driven Product Processes.”, P. 55, Acta Universitatis Lappeenrantaensis 991, Lappeenranta-Lahti University of Technology LUT, 2021.
- Adam Bry, Abraham Bachrach, and Nicholas Roy. “State Estimation for Aggressive Flight in GPS-Denied Environments Using Onboard Sensing.” P. 5, Proceedings of the IEEE International Conference on Robotics and Automation (ICRA 2012), IEEE, 2012.
- lancit, “KF卡尔曼滤波从连续系统到离散系统以及关键参数F、G、Q、R的计算“,2025
- 卡尔曼滤波器(12) — 多维卡尔曼滤波器(协方差外推方程)
- 汽车电子, 卡尔曼滤波在汽车传感器中的应用:姿态解算与轨迹预测的参数调优, 2025
- Yang Song, and Li-Ta Hsu. “Tightly Coupled Integrated Navigation System via Factor Graph for UAV Indoor Localization.” P. 9, Aerospace Science and Technology, vol. 108, 2021, article 106370, https://doi.org/10.1016/j.ast.2020.106370.
- Qing Li, Kalman Filter Based Integration of Multiple Sensor Data for the Estimation of Vehicle Trajectories. P. 63, Dissertation, Technische Universität Wien, 2023.
- Mustafa Emre Akçay, Land Vehicle Navigation with GPS/INS Sensor Fusion Using Kalman Filter. P. 45, Master’s thesis, Middle East Technical University, Department of Mechanical Engineering, December 2008.
