| Data Acquisition Toolbox | Search  Help Desk |
Data Range and Engineering Units Properties
This section describes properties that control the range of data expected from your sensor, the range of the A/D converter, and the engineering units of the data returned to MATLAB. When data is acquired through a sensor and digitized by an A/D converter, you must be aware of these three issues:SensorRange property, the A/D range is set with the InputRange property, and the engineering units are set with the UnitsRange property. These are all channel properties and can be set on a per-channel basis.
For example, suppose you are using a microphone that can measure sound levels up to 120 dB and can produce an output voltage ranging from -1 to 1 volts. If you are measuring street noise in your application, then you might expect that the sound level never exceeds 60 dB. Assuming a linear relationship between the sound level and sensor output voltage, then you are using only 50% of the dynamic range of your sensor (-0.5 to 0.5 volts). In addition, your A/D converter may have several valid voltage ranges that it can be set to. The best A/D hardware range is the one that encompasses the expected sensor range most closely. For this example, let's assume the hardware only supports a range of -1 to 1 volts and that engineering units conversion is not required. The code shown below reflects this example.
ai = analoginput('winsound')
addchannel(ai, 1)
ch = ai.Channel(1)
set(ch, 'SensorRange', [-0.5 0.5])
set(ch, 'InputRange', [-1 1])
Setting the data range and engineering units is described in detail in "Engineering Unit Conversion".