Class inertialsim::analysis::AllanDeviation¶
ClassList > inertialsim > analysis > AllanDeviation
Allan deviation (variance) analysis of random noise. More...
#include <allan_deviation.h>
Public Static Functions¶
| Type | Name |
|---|---|
| std::tuple< Scalar1D, Array, Array > | Calculate (const sensors::Measurement & measurement, int num_clusters=100) Calculate the Allan deviation of a uniformly sampled signal. |
| IntegerArray | Clusters (int samples, int num_clusters) Calculate Allan deviation cluster sizes. |
| Array | FitModel (const NoiseModel & model, const Scalar1D & tau, const Array & allan_deviation, const std::optional< Array > & allan_deviation_deviation=std::nullopt) Fit standard noise parameters to an Allan deviation signal. |
| Scalar1D | Log10Interp (const Scalar1D & x, const Scalar1D & xp, const Scalar1D & fp, std::optional< double > left=std::nullopt, std::optional< double > right=std::nullopt) Linear interpolation in base-10 logarithmic space. |
Detailed Description¶
Allan deviation (or its square, Allan variance) is a standard technique for analysis of random noise sources in inertial sensors. See Standards [05] and [06] for further details.
This class provides methods to calculate Allan deviation and its estimated accuracy. It also provides methods to extract best-fit parameters from an Allan deviation signal.
Public Static Functions Documentation¶
function Calculate¶
Calculate the Allan deviation of a uniformly sampled signal.
static std::tuple< Scalar1D , Array , Array > inertialsim::analysis::AllanDeviation::Calculate (
const sensors::Measurement & measurement,
int num_clusters=100
)
The Allan deviation is a statistical measure used in characterizing random processes in time domain signals. It is calculated as the standard deviation of a sliding window of time averages across a signal, with the window varying from a minimum value of a single sample up to a maximum of half the duration of the signal (the Nyquist frequency). Each window covers a "cluster" of data points of a fixed length (given that the signal is uniformly sampled in time).
Allan deviation (or its square, Allan variance) is the standard method for characterizing noise in inertial sensors. The function returns the fully overlapping Allan deviation as defined in Section C.1. of Standard [05]. See also Reference [20] for further details.
Parameters:
measurementMeasurement object containing the sensor data to analyze. This should be uniformly sampled time series data. The results will be calculated independently for each channel.num_clustersNumber of logarithmically spaced cluster sizes to return. Must be at least 1. Default = 100.
Returns:
Tuple containing:
- tau: Averaging time (in seconds) corresponding to each Allan deviation output. Tau is logarithmically spaced from a minimum <= the sample period to a maximum <= the Nyquist frequency (half the sample rate).
- allan_deviation: An estimate of the Allan deviation of the input signal.
- allan_deviation_deviation: An estimate of the standard deviation of the Allan deviation.
function Clusters¶
Calculate Allan deviation cluster sizes.
static IntegerArray inertialsim::analysis::AllanDeviation::Clusters (
int samples,
int num_clusters
)
The Allan deviation of a signal is a function of averaging time. For a uniformly sampled signal this is equivalent to the number of consecutive samples in a cluster. This function returns unique, integer, logarithmically spaced cluster sizes from a minimum of 1 to a maximum of N/2 where N is the number of samples in the signal.
Note: because it is not always possible to select logarithmically spaced integers, the number of clusters returned may be less than the requested number of clusters.
Parameters:
samplesNumber of samples in the signal. Must be at least 2.num_clustersNumber of logarithmically spaced cluster sizes to return. Must be at least 1.
Returns:
Vector of unique, logarithmically spaced, integer cluster sizes. The length of the returned value will be <= num_clusters.
Exception:
std::invalid_argumentif samples < 2 or num_clusters < 1.
function FitModel¶
Fit standard noise parameters to an Allan deviation signal.
static Array inertialsim::analysis::AllanDeviation::FitModel (
const NoiseModel & model,
const Scalar1D & tau,
const Array & allan_deviation,
const std::optional< Array > & allan_deviation_deviation=std::nullopt
)
Find the coefficients of quantization (Q), random walk (N), bias instability (B), rate random walk (K), and rate ramp (R) noises that best fit the Allan deviation data (in the weighted least squares sense). See Calculate() to calculate the required inputs from sensor measurements.
See Standard [05], Section C.1 and Reference [20] & Reference [29] for further details. Note: this procedure is optimal in the sense of Reference [29] when the model is correctly specified.
The resulting model parameters can then be used in IMU, gyro, and accelerometer specifications.
Parameters:
modelNoiseModel specifying which coefficients to include in the least squares model fit.tauAveraging time (in seconds) corresponding to each Allan deviation input.allan_deviationAllan deviation.allan_deviation_deviationOptional estimate of the standard deviation of the Allan deviation. If nullopt, all inputs will be weighted equally.
Returns:
Array of up to 5 noise parameters [Q, N, B, K, R]. Units will be compatible with the units of the input Allan deviation. If model excludes some parameters, the included parameters will be returned in the order shown. Negative coefficients will be truncated to 0.0. This typically indicates insufficient data and/or a mis-specified model.
Exception:
std::invalid_argumentif model does not include any coefficients to fit.
function Log10Interp¶
Linear interpolation in base-10 logarithmic space.
static Scalar1D inertialsim::analysis::AllanDeviation::Log10Interp (
const Scalar1D & x,
const Scalar1D & xp,
const Scalar1D & fp,
std::optional< double > left=std::nullopt,
std::optional< double > right=std::nullopt
)
The inputs all have the same meaning as they do for standard linear interpolation functions.
Parameters:
xThe x-coordinates at which to evaluate the interpolated values.xpThe x-coordinates of the data points, must be monotonically increasing.fpThe y-coordinates of the data points, same length as xp.leftValue to return for x < xp[0], default is fp[0].rightValue to return for x > xp[-1], default is fp[-1].
Returns:
Interpolated values corresponding to each value in x.
The documentation for this class was generated from the following file cpp/include/inertialsim/analysis/allan_deviation.h