Contenido principal

Barometer

Barometer sensor model with noise

Since R2025a

  • Barometer block

Libraries:
UAV Toolbox / UAV Scenario and Sensor Modeling

Description

The Barometer block models a barometer sensor that generates an air pressure reading with a measurement noise that consists of constant measurement bias, uncorrelated white noise, and correlated noise [1]. For more information on the noise model, see Noise Model.

Examples

expand all

Open the barometerSimulation.slx Simulink model

open_system("barometerSimulation");

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.

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.

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.

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).

Specifying a smaller decay factor models the correlated noise closer to white noise, while specifying a larger decay factor models the correlated noise closer to a random walk process.

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 subsequent simulations, as long as the model does not change.

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