Contenido principal

barometerSensor

Barometer sensor model with noise

Since R2026a

Description

The barometerSensor System object™ 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.

To simulate a barometer sensor:

  1. Create the barometerSensor object and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects?

Creation

Description

barometer = barometerSensor returns a barometerSensor System object that simulates barometer readings.

barometer = barometerSensor(PropertyName=Value) returns a barometerSensor System object with each property name set to the specified value.

Properties

expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

If a property is tunable, you can change its value at any time.

For more information on changing property values, see System Design in MATLAB Using System Objects.

Sensor sample rate in Hz, specified as a positive scalar.

Data Types: single | double

Constant measurement bias in Pa, specified as a finite scalar.

Tunable: Yes

Data Types: single | double

White noise standard variance, specified as a nonnegative finite scalar. This property specifies the power spectral density of the sensor noise in Pa/√Hz.

Tunable: Yes

Data Types: single | double

Correlated noise standard variance in Pa, specified as a nonnegative finite scalar.

Tunable: Yes

Data Types: single | double

Correlated noise decay factor, specified 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.

Tunable: Yes

Data Types: single | double

Random number source, specified as one of these values:

  • "Global stream" — Generate random numbers using the current global random number stream.

  • "mt19937ar with seed" — Generate random numbers using the mt19937ar algorithm with the seed specified by the RandomSeed property.

Data Types: char | string

Random number initial seed, specified as a real nonnegative integer. This property specifies the initial seed of the mt19937ar algorithm.

Dependencies

To enable this property, set RandomStream property to "mt19937ar with seed".

Data Types: single | double

Usage

Description

barometerReading = barometer(airPressure) generates a measured air pressure reading from a true air pressure input.

Input Arguments

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 Arguments

expand all

Measured air pressure in Pa, returned as a nonnegative scalar or N-element vector. The length of barometerReading matches the length of airPressure

Data Types: single | double

Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object named obj, use this syntax:

release(obj)

expand all

stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object

Algorithms

expand all

References

[1] Sabatini, Angelo, and Vincenzo Genovese. “A Stochastic Approach to Noise Modeling for Barometric Altimeters.” Sensors 13, no. 11 (November 18, 2013): 15692–707. https://doi.org/10.3390/s131115692.

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2026a

See Also