Skip to content

C202 Lesson 2: Measuring IMU Noise with the Allan Deviation

A visual-inertial estimator weighs every IMU sample by how noisy it believes the sensor to be. Those beliefs are four numbers in Kalibr’s imu.yaml. This lesson shows where they come from: a long recording of the IMU sitting still, and its Allan deviation. The full treatment is on IMU Noise Models and Allan Variance; every field of the file is on the Kalibr File Reference.

See also the glossary’s calibration section.

Term Meaning
Averaging time τ The length of the window a still IMU’s output is averaged over
Allan deviation σ(τ) How much the average over a window of length τ differs from the next window’s, plotted against τ on log-log axes
Angle random walk (ARW), velocity random walk (VRW) Datasheet names for gyroscope and accelerometer white noise, because integrated white noise becomes a random walk in angle or velocity
Bias instability The flat bottom of the Allan deviation curve, the low-frequency wander of the bias
Rate random walk A bias that wanders as a random walk; Kalibr’s *_random_walk fields
Continuous-time noise density Noise strength per root hertz, independent of the sample rate; what Kalibr’s file holds

How the Allan deviation separates the noise

Section titled “How the Allan deviation separates the noise”

Take a long recording of the IMU sitting still. For each averaging time τ, cut the record into windows of that length, average each one, and measure how much neighbouring averages differ. Because the method uses differences, any constant cancels: the fixed bias, and gravity on an accelerometer axis. That is why a still IMU in any orientation can be used (How the Allan variance is computed).

Each noise process dominates a different stretch of τ and has its own slope on the log-log plot. Kalibr’s noise model page calls this “probably the most common and standardized procedure”, and models two of the processes:

Process Slope Read it Kalibr field
White noise (ARW, VRW) −½ on the curve at τ = 1 s gyroscope_noise_density, accelerometer_noise_density
Bias instability 0 the flat minimum none
Rate random walk +½ on the fitted +½ line at τ = 3 s gyroscope_random_walk, accelerometer_random_walk
Reading IMU noise from an Allan deviation plot A log-log plot of Allan deviation against averaging time for a stationary IMU. The curve falls with slope minus one half where white noise dominates, flattens at a minimum called the bias instability, then rises with slope plus one half where bias random walk dominates. The white-noise density is read from the falling line at an averaging time of 1 second, and the random walk from the rising line at 3 seconds. white noise: read at τ = 1 s bias instability (the minimum) random walk: at τ = 3 s slope −½ slope +½ 0.010.1110100100010000 Averaging time τ (seconds, log scale) Allan deviation (log)
An Allan deviation plot from hours of a stationary IMU. White noise is read on the falling line at τ = 1 s (Kalibr's noise density) and rate random walk on the rising line at τ = 3 s (Kalibr's random walk). The flat minimum is what Woodman and allan_variance_ros report as bias instability; by the IEEE 952 derivation the coefficient B is that minimum divided by 0.664.

The reading points are not arbitrary. White noise gives σ(τ) = N / √τ, which equals N at τ = 1 s; a rate random walk gives σ(τ) = K · √(τ / 3), which equals K at τ = 3 s. Each point is where the curve’s value is the coefficient itself. The field guide’s table of the five noise terms adds quantization noise (slope −1) and a drift rate ramp (slope +1). Two cautions from that page: a slope does not name a process for certain, and the ramp is not noise but a trend, such as a bias still settling.

Bias instability has two conventions. Woodman, and allan_variance_ros’s analysis.py, report the curve’s minimum. By the IEEE 952 derivation, the coefficient B is that minimum divided by 0.664, about 1.5 times larger. Find out which one a datasheet means before comparing (Bias instability: two conventions).

The right end of the plot rests on few windows, so it is uncertain. From the field guide’s confidence table, computed with Hou’s formula:

Record length Error at τ = 1 s Error at τ = 1,000 s Error at τ = 6,000 s
3 h 0.7% 22.6% 79.1%
15 h 0.3% 9.7% 25.0%
24 h 0.2% 7.7% 19.3%

The white noise at 1 s is well determined by any of them; the random walk, read from the long-τ end, is not. That is why the two tools ask for different lengths. The allan_variance_ros README says “You must record at least 3 hours of data. The longer the sequence, the more accurate the results.” The Kalibr wiki recommends running it on a “~15-24 hour dataset recording of the IMU being stationary”.

How to record, from the same sources:

  • Still and damped. “Place your IMU on some damped surface and record your IMU data to a rosbag.” The Allan deviation is computed from whatever the sensor outputs, so vibration in the log is counted as sensor noise.
  • Timestamps in order. The README recommends reorganising the bag’s messages by timestamp first, with its cookbag.py. The method averages runs of consecutive samples, so samples stored out of order land in the wrong windows (Temperature and the limits of a static plot).
  • At a steady temperature. An Allan plot describes one temperature. To the best of our knowledge, it is best to start the log once the rig has reached its working temperature, or cut the warm-up, because a settling bias shows up as a trend (Temperature and the limits of a static plot).
  • At the rate you will use. Kalibr’s noise model page notes that its rate scaling assumes the sensor’s own low-pass filter did the decimation, and that data simply subsampled to a lower rate may not be scaled that way (continuous and discrete time).

Kalibr’s input file has four noise values, the IMU’s rate and its topic (YAML formats):

Key Units Meaning
accelerometer_noise_density m/s² · 1/√Hz accelerometer white noise, continuous time
accelerometer_random_walk m/s³ · 1/√Hz how fast the accelerometer bias wanders
gyroscope_noise_density rad/s · 1/√Hz gyroscope white noise, continuous time
gyroscope_random_walk rad/s² · 1/√Hz how fast the gyroscope bias wanders
update_rate Hz the IMU’s sample rate in the bag
rostopic – the IMU topic in the bag

Three things go wrong here more than anywhere else (Kalibr File Reference):

  • Degrees for radians. Gyroscope values are in rad/s, not °/s. allan_variance_ros prints its gyroscope results in degrees and converts them to radians when it writes imu.yaml.
  • A wrong update_rate. Kalibr turns the continuous-time noise into a per-sample noise with it, σd = σ · √(update_rate); a wrong rate gives the IMU the wrong weight.
  • One value for three axes. Kalibr uses the same value for all three axes of a sensor. The D435i example in the allan_variance_ros README has a Y-axis velocity random walk three times its X axis’s (0.01079 against 0.00333 m/s/√s), which one number hides. Which axis the tool writes is covered in the lab.

Without a long static log, the white-noise values can come from the datasheet, after unit conversion; the bias random walk is “rarely directly specified in the datasheet” (Getting the values from a datasheet).

A still IMU on a bench is a best case. The Kalibr wiki says the model “is derived from a sensor which does not undergo motion, and at constant temperature”, so used as they are, the static values mean that “Kalibr will tend to trust your IMU measurements too much”. Its advice: “From our experience, for lowest-cost sensors, increasing the noise model parameters by a factor of 10x or more may be necessary.”

The TUM VI benchmark ran its VIO evaluations with “Noise parameters are set to inflated values from the Allan plots”, “to account for unmodeled noise and vibrations”, without giving the factor (From the plot to the estimator). No source gives a universal factor. Lesson 3 shows how the residual plots in Kalibr’s report tell you whether the values you chose fit the data. Keep the raw Allan values and the inflated values side by side, and write down the factor.

  1. Where on the Allan deviation plot do you read Kalibr’s gyroscope_noise_density, and where its gyroscope_random_walk?
  2. Your log is 3 hours long. Which of the four noise values do you trust least, and why?
  3. A datasheet gives bias stability as 3 °/h, and your measured curve minimum is 2 °/h. Can you say the part beats its datasheet?
  4. Your imu.yaml says update_rate: 100.0, but the IMU runs at 400 Hz in the bag. What goes wrong?
  5. Why does the Kalibr wiki say to raise the static noise values for low-cost sensors?
  1. The noise density on the −½ slope at τ = 1 s; the random walk on the fitted +½ line at τ = 3 s.
  2. The random walks. They come from the long-τ end of the curve, where a 3-hour record has few windows; at τ = 6,000 s the error is about 79%.
  3. Not yet. Check which convention the datasheet uses: the curve minimum, or the coefficient B, which is the minimum divided by 0.664.
  4. Kalibr converts the continuous-time noise to a per-sample noise with the rate, so it assumes the wrong noise per sample and gives the IMU the wrong weight.
  5. The values come from a still sensor at constant temperature, so they are optimistic; used directly, Kalibr trusts the IMU too much.