Contenido principal

Barometer

R2026b

Model barometer sensor with measurement noise for UAV altitude estimation

Since R2025a

  • Barometer sensor block for UAV altitude estimation in Simulink

Libraries:
UAV Toolbox / UAV Scenario and Sensor Modeling

Description

The Barometer block models a barometer sensor that adds measurement noise to the true air pressure input. The noise consists of three additive components: a constant bias offset, uncorrelated white Gaussian noise (scaled by the Noise density parameter), and correlated noise modeled as a first-order autoregressive process (controlled by the Bias instability and Decay factor parameters) [1]. For the noise equations, see Noise Model. Use this block to simulate barometric pressure readings for UAV altitude estimation in the presence of sensor noise. For MATLAB script-based workflows, use the barometerSensor System object instead.

Examples

expand all

Open the barometerSimulation.slx Simulink model

open_system("barometerSimulation");

Simulink model with Lapse Rate Model, Rate Transition, Barometer, and Pressure Altitude blocks connected to scope outputs at 50 m altitude

The model consists of the following blocks:

  1. Lapse Rate Model (Aerospace Blockset) — Simulates lapse rate atmospheric model. The block receives altitude in meter, and outputs the atmospheric air pressure in Pascal, which is then measured by the barometer sensor. In this model, the input altitude is 50 meter.

  2. Rate Transition — Simulates the discrete measurement of the Barometer sensor. In this model, the block is configured with a sample time of 0.1 second.

  3. Barometer — Simulates a barometer sensor that generates air pressure reading in Pascal with a measurement noise that consists of constant measurement bias, uncorrelated white noise, and correlated noise.

  4. Pressure Altitude (Aerospace Blockset) — Computes the altitude above mean sea level in meters based on the air pressure reading.

  5. Measured Pressure Scope — Visualizes the pressure reading.

  6. Altitude Scope — Visualizes the computed altitude above mean sea level and ground truth.

Run the model, and then open scope blocks to see the simulation results.

Scope plot of Measured Air Pressure in Pa fluctuating around 1.0072 x 10^4 Pa over 10 seconds due to sensor noise

Scope plot of Altitude in meters showing noisy Calculated Pressure Altitude fluctuating around the 50 m Ground Truth line

Ports

Input

expand all

True air pressure in Pa, specified as a scalar or N-element vector, where N is the number of air pressure measurements. In a typical UAV simulation, connect this port to an atmosphere model or a pressure-from-altitude computation.

Data Types: single | double

Output

expand all

Measured air pressure in Pa, returned as a nonnegative scalar or N-element vector. The length of Measured pressure matches the length of True pressure. Use this output as the sensor input to an altitude estimation or state estimation algorithm.

Data Types: single | double

Parameters

expand all

Specify the constant measurement bias as a finite scalar, in Pa.

Specify the white noise standard variance as a nonnegative finite scalar. This parameter specifies the power spectral density of the sensor noise in Pa/√Hz.

Specify the correlated noise standard variance as a nonnegative finite scalar, in Pa.

Specify the correlated noise decay factor as a scalar in the range (0, 1).

A smaller decay factor models the correlated noise closer to independent white noise at each time step. A larger decay factor models the correlated noise closer to a random walk (unbounded drift).

Specify the initial seed of the mt19937ar random number generator algorithm as a real, nonnegative integer scalar.

Select the type of simulation to run from these options:

  • Interpreted execution — Simulate the model using the MATLAB® interpreter. For more information, see Interpreted Execution vs. Code Generation (Simulink).

  • Code generation — Simulate the model using generated C code. The first time you run a simulation, Simulink® generates C code for the block. The C code is reused for later simulations, as long as the model does not change.

Tips

To configure the block for a specific barometer sensor, obtain these values from the sensor datasheet:

  • Set Noise density to the sensor noise spectral density (typically listed in Pa/√Hz or equivalent units on the datasheet).

  • Set Bias instability to the long-term bias stability specification.

  • Set Decay factor to a value near 1 (such as 0.99) for sensors with slow-drifting bias. Use a smaller value for sensors with faster-varying bias.

  • Set Constant bias to 0 for a calibrated sensor, or to the expected residual offset.

Algorithms

expand all

References

[1] Sabatini, A.M., and V. Genovese. “A Stochastic Approach to Noise Modeling for Barometric Altimeters.” Sensors 13 (November 2013): 15692-15707. https://doi.org/10.3390/s131115692

Version History

Introduced in R2025a