Noise and Approximate-Bias Estimators

This documentation was generated with the assistance of AI. Please report any inaccuracies.

Classes: com.irurueta.navigation.inertial.calibration.noise (37 classes), com.irurueta.navigation.inertial.calibration.bias (5 classes), plus the root-level interfaces AccelerometerNoiseRootPsdSource, GyroscopeNoiseRootPsdSource, AccelerometerBiasUncertaintySource, GyroscopeBiasUncertaintySource, AccelerometerCalibrationSource, GyroscopeCalibrationSource (see the Class Reference table at the end of this page for Javadoc and source links).

These classes don’t perform full calibration — they estimate simpler statistics (noise level, or an approximate bias) that either feed into static-interval detection, seed a non-linear calibrator’s initial guess, or configure a Kalman filter’s initial uncertainty.

Noise estimators: PSD and root-PSD

All noise estimators reduce to two orthogonal choices — what statistic, and how much history:

Family Behavior

Accumulated*NoiseEstimator

A single running (recursive) mean/variance over all samples seen so far, using a biased (divide-by-N) variance estimator that converges to the unbiased one for large . Intended for use when the device is static for the entire capture.

Windowed*NoiseEstimator

Recomputes mean/variance over only the most recent windowSize samples (default 101) each time a new sample arrives, using the unbiased (divide-by- ) estimator. Intended for tracking noise that changes over time — e.g. inside TriadStaticIntervalDetector, which needs to notice when motion starts.

Each of those two comes in a single-axis form (*MeasurementNoiseEstimator, for a plain Acceleration/AngularSpeed/MagneticFluxDensity value) and a 3-axis form (*TriadNoiseEstimator), and both single-axis and triad forms are further specialized per sensor (Acceleration, AngularSpeed, MagneticFluxDensity) — that specialization only binds generic types and adds no new algorithm, which is why 4 conceptual families expand into most of the package’s 37 classes. AccumulatedBodyKinematicsNoiseEstimator / WindowedBodyKinematicsNoiseEstimator run the accelerometer and gyroscope triad versions together for a combined BodyKinematics stream.

PSD and root-PSD: definitions

A discrete sensor reading with white noise of standard deviation sampled every seconds carries a noise power spectral density (PSD) and root-PSD of

and, inverting, the standard deviation that a given root-PSD produces at a given sampling interval is . Every estimator in this package applies exactly these two relations to its variance estimate (the getPsd() / getPsdX()…​ getters return ; getRootPsd() and friends return the square root of that), where is the estimator’s configured timeInterval (seconds, default 0.02 s in every estimator of this page, and non-negative). The estimators never measure themselves: it is a setter, typically fed from TimeIntervalEstimator (see Static/Dynamic Interval Detection and Measurement Generation), which averages the timestamps of the incoming samples.

Sensor PSD unit Root-PSD unit Common name

Accelerometer

velocity random walk

Gyroscope

angle random walk

Magnetometer

 — 

Why the time interval appears: averaging

The root-PSD is the rate-independent way to quote noise. Averaging consecutive white samples divides the standard deviation by , and the averaging time is , so

i.e. the noise left after averaging over seconds depends only on the root-PSD and , not on the sampling rate. Halving makes the per-sample grow by while the root-PSD stays the same. This is also why the synthetic-data generator (IMUErrors consumed by BodyKinematicsGenerator) draws each axis of noise with , and draws no noise at all when .

The averaging argument assumes white, uncorrelated noise. The package does not model bias instability or any other coloured noise.

Per-axis, average and norm forms

A triad estimator keeps one variance per axis, so for it exposes and plus two aggregates:

The norm form (getNoiseRootPsdNorm()) is what AccelerometerNoiseRootPsdSource / GyroscopeNoiseRootPsdSource report: the triad estimators return it from getAccelerometerBaseNoiseLevelRootPsd() / getGyroscopeBaseNoiseLevelRootPsd(), and the static-interval detectors report , where the base noise level is the accumulated standard-deviation norm (see Static/Dynamic Interval Detection and Measurement Generation). The magnitude is the same in both cases. Two consequences are worth knowing:

  • For isotropic noise with per-axis deviation the norm form is , i.e. times the per-axis root-PSD, not equal to it.

  • IMUErrors stores one root-PSD per sensor and BodyKinematicsGenerator applies it to every axis, so a norm-form value produced by IMUErrorsCreator yields synthetic noise times larger per axis than the device it was measured on. Divide by (or use the per-axis getters) if that matters.

(The consequence is an own derivation from the formulas above and from how BodyKinematicsGenerator uses the value; it is not stated in the Javadoc.)

Recursive and windowed variance

The recursive (online) update, common to every Accumulated* estimator, with samples already processed and the new sample :

The deviation is taken from the already updated mean. The exact population-variance recursion would use the product of the deviations from the old and the new mean; the form above is a slightly low approximation (the last term is smaller by a factor ) whose effect vanishes for large . The first sample sets the mean to the sample and leaves the variance at zero. Because the variance is a running population estimate, an Accumulated* estimator also forgets nothing: feed it only samples taken while the device is static.

The Windowed* estimators instead recompute, over the last windowSize samples (101 by default), the mean and the unbiased variance

with the window size. The PSD relations above are applied to that variance in the same way. Statistics are recomputed only by the add…​AndProcess methods (addMeasurementAndProcess, addTriadAndProcess); the plain addMeasurement / addTriad methods just store the sample. While the window holds fewer than samples the missing ones count as zero in the mean and variance, so read the statistics only once isWindowFilled() is true.

AccumulatedAccelerationTriadNoiseEstimator noiseEstimator =
        new AccumulatedAccelerationTriadNoiseEstimator();

// feed samples while the device is known to be static
for (double[] fxyz : staticSpecificForceSamples) {
    noiseEstimator.addTriad(fxyz[0], fxyz[1], fxyz[2]);
}

double stdNorm = noiseEstimator.getStandardDeviationNorm(); // m/s^2
double rootPsdNorm = noiseEstimator.getAccelerometerBaseNoiseLevelRootPsd(); // m/s^1.5 (AccelerometerNoiseRootPsdSource)

Approximate bias estimators

Unlike the full calibrators in Accelerometer Calibration, Gyroscope Calibration, and Magnetometer Calibration, the bias package’s two estimators assume the device is static at a single known position/orientation and neglect cross-coupling entirely — they only average measurements to get a quick bias (and noise PSD) estimate, good enough to seed a non-linear calibrator’s initial guess, or to use directly when cross-coupling errors are known to be negligible:

Class Purpose

BodyKinematicsBiasEstimator

Averages BodyKinematics samples at a known static NED/ECEF frame to estimate accelerometer and gyroscope bias plus noise PSD.

BodyMagneticFluxDensityBiasEstimator

Averages magnetic flux density samples at a known static position/orientation/instant (using the WMM for the expected field) to estimate hard-iron bias plus noise PSD.

Both classes' Javadoc explicitly point back to the noise estimators above for the case where only PSD (not bias) is needed and no known frame is available.

The estimate

With the cross-coupling and g-dependent terms set to zero the sensor models of the error model reduce to . Since the device is static at a known pose, is known and constant; call its predicted value . Each sample therefore gives an observation of the bias, , and the estimator keeps the running mean and variance of per axis, with the same recursion as the Accumulated* noise estimators (see recursive variance):

The noise PSD uses the same relations as before, with the estimator’s timeInterval (0.02 s by default): . getAccelerometerNoisePSD() and getGyroNoisePSD() return the mean over the three axes, while getAccelerometerNoiseRootPSD() and getGyroNoiseRootPSD() return the norm (see per-axis, average and norm forms); per-axis values are available as getRootPSDFx(), getRootPSDAngularRateX(), etc.

Estimator Expected (known-pose) value

BodyKinematicsBiasEstimator

Accelerometer and gyroscope outputs of an ideal IMU at rest, obtained from ECEFKinematicsEstimator with the same ECEF orientation at both epochs and zero velocity: the specific force that opposes gravity (and carries the centripetal term) resolved in body axes, and the Earth-rotation rate resolved in body axes. It is rebuilt whenever the position, orientation or time interval changes. The position/orientation can be given as NED or ECEF; it is stored as an ECEF frame.

BodyMagneticFluxDensityBiasEstimator

The WMM field at the given position and decimal year, rotated into body axes with the inverse of the frame’s attitude ( ). getRootPsd(), getAvgPsd() and getPsdX()…​ follow the same definitions as above.

Two practical limits follow from the model. First, anything the model leaves out — scale factor, cross-coupling, g-dependent bias — is absorbed into the estimated bias and is only valid at that one orientation; an orientation error leaks the (large) gravity or field vector into the bias. Second, the reported variance is that of the samples, not of the mean: the standard error of the bias estimate after samples is roughly (an own, textbook statement, not exposed as a getter by these classes).

double latitude = Math.toRadians(41.3851);
double longitude = Math.toRadians(2.1734);
double height = 0.0;

BodyKinematicsBiasEstimator biasEstimator =
        new BodyKinematicsBiasEstimator(latitude, longitude, height);

// feed samples while the device is known to be static at this position
for (BodyKinematics sample : staticKinematicsSamples) {
    biasEstimator.addBodyKinematics(sample);
}

Matrix accelerometerBias = biasEstimator.getAccelerometerBias(); // 3x1, m/s^2
Matrix gyroBias = biasEstimator.getGyroBias();                   // 3x1, rad/s

Root-level interfaces: how components exchange calibration results

These small interfaces are how IMUErrorsCreator and Kalman-filter configuration classes stay decoupled from which specific calibrator/estimator produced a value:

Interface Purpose

AccelerometerNoiseRootPsdSource / GyroscopeNoiseRootPsdSource

Exposes a single double getXxxBaseNoiseLevelRootPsd() — implemented by the noise estimators above and by the static-interval detectors/generators in Static/Dynamic Interval Detection and Measurement Generation, any of which can supply IMUErrorsCreator with a noise root-PSD.

AccelerometerBiasUncertaintySource / GyroscopeBiasUncertaintySource

Exposes Double getEstimatedBiasStandardDeviationNorm(): the square root of the sum of the three bias variances taken from the calibrator’s estimated covariance, , or null while no covariance has been estimated. Implemented by the non-linear and robust accelerometer/gyroscope calibrators (not by the linear ones, nor by the magnetometer calibrators); used to seed a Kalman filter’s initial uncertainty (INSLooselyCoupledKalmanInitializerConfig / INSTightlyCoupledKalmanInitializerConfig).

AccelerometerCalibrationSource / GyroscopeCalibrationSource

Expose getEstimatedBiases() and getEstimatedMa() (accelerometer) or getEstimatedBiases(), getEstimatedMg() and getEstimatedGg() (gyroscope), i.e. , and of the error model. IMUErrorsCreator is ready only when all of them are non-null (see calibration/fixers.adoc#imu-errors-creator).

Class Reference

Javadoc and source links for the classes used in the examples above:

Class Javadoc Source

com.irurueta.navigation.inertial.calibration.noise (37 classes)

Javadoc

Source

com.irurueta.navigation.inertial.calibration.bias (5 classes)

Javadoc

Source

AccelerometerNoiseRootPsdSource

Javadoc

Source

GyroscopeNoiseRootPsdSource

Javadoc

Source

AccelerometerBiasUncertaintySource

Javadoc

Source

GyroscopeBiasUncertaintySource

Javadoc

Source

AccelerometerCalibrationSource

Javadoc

Source

GyroscopeCalibrationSource

Javadoc

Source

AccumulatedAccelerationTriadNoiseEstimator

Javadoc

Source

BodyKinematicsBiasEstimator

Javadoc

Source

BodyKinematics

Javadoc

Source

Where to go next