14.1.7 Average Min Max [T-Series Datasheet] | LabJack
« Close

Datasheets and User Guides

App Notes

Software & Driver


14.1.7 Average Min Max [T-Series Datasheet]



This Average Mix Max Extended Feature will sample an analog input a specified number of times at a specified rate, then calculate the average, min, and max voltage.

If you are using this feature to reduce noise by oversampling-and-averaging, consider maximizing resolution first, since that is the best and fastest way to reduce noise.

This feature internally uses stream mode.


To configure, write to the following registers.

AIN#_EF_CONFIG_A - Number of Samples: The number of samples to be acquired.

  • Default: 200
  • Max: 16384

AIN#_EF_CONFIG_D - Scan Rate: The frequency at which samples will be collected.

  • Default: 6000

Sample Time

The maximum possible sample time is 180 ms.

Sample time is the number of samples divided by the sample frequency. For example, the period is 16.7 ms when using a scan rate of 6000 Hz and 100 samples:

100 samples / 6000 samples per second = 16.7 ms

If the signal has a known periodic component, then setting the sample time to an even multiple of the period will generally improve results.

Stream Configuration

This extended feature internally uses Stream-Burst to acquire the data set, so stream AIN configurations apply.

  • Crucially, set STREAM_RESOLUTION_INDEX between 0 and 8. Resolution index 9 is not supported in stream.


For results, read the following registers.

AIN#_EF_READ_A: Average volts
AIN#_EF_READ_B: Max volts
AIN#_EF_READ_C: Min volts

Only reading AIN#_EF_READ_A triggers a new measurement. Because multiple measurements are taken, a read of AIN#_EF_READ_A blocks for the length of the sample time.


To measure a 10 Hz sine wave with amplitude 0.1 V and DC offset of 1.2 V, set the number of samples to 100 and the scan rate to 1000. The total acquisition time is 100 ms, which is an even multiple of the signal's period.

AIN0_EF_CONFIG_A = 100   -- Number of samples
AIN0_EF_CONFIG_D = 1000  -- Scan rate

Results, with noise levels less than 600 µV:

AIN0_EF_READ_A = 1.201 V -- Average volts
AIN0_EF_READ_B = 1.301 V -- Max volts
AIN0_EF_READ_C = 1.101 V -- Min volts

We can change the sample time to emphasize the benefit of matching to the period. If we change AIN0_EF_CONFIG_A to 70 (an odd multiple of the signal's period), then the results are still centered on 1.2, 1.3, and 1.1 V—but noise levels are ±5 mV.


moises1953's picture

What is the maximum scan rate with 80 analog input signals from MUX80 and 1 digital input port (8bit) in one T7 stream?

It's posible to compute a mean value digital filter on the fly, not by oversampling each channel, but scaning all inputs and averaging?


labjack support's picture

1.  Take the max sample rate and divide that by 81.  You might have to back off from that a bit due to the overhead of dealing with so many channels, but that will be close.  See Table A.1.7:


2.  Not in hardware, but you can do that in your software.