Table Of Contents

Dynamic Averaging Method

Last Modified: January 31, 2020

The dynamic averaging method for frequency and period measurements provides configuration options that can be set before the start of an acquisition. These options affect the amount of averaging or filtering applied to the counter measurements allowing for tradeoffs in measurement accuracy and noise versus latency. During the acquisition, the counter continuously measures and filters the input signal periods to produce frequency or period measurements. The NI 9326 and 9361 use this method.

With Counter Filtering Enabled

The NI 9326 can enable low pass filtering of counter signals to give accurate measurement of in-band frequencies while rejecting higher frequency noise. Set the CI.Filter.Enable attribute/property to true to enable filtering. Filtering is enabled by default and is recommended as the easiest way to achieve accurate, low-noise counter measurements.

With filtering enabled, you can then specify the filter cutoff frequency using the CI.Filter.Freq attribute/property to control amount of filtering applied. Lower cutoffs provide lower noise but longer latency. The latency of the filter can be queried using the CI.FilterDelay attribute/property. Each counter can be configured with independent settings.

spd-note-note
Note

The measurement time, divisor, and maximum measurable period parameters are ignored when filtering is enabled.

With Counter Filtering Disabled

If CI.Filter.Enable is set to false or if counter filtering is not supported on your device, then the dynamic averaging method produces measurements by averaging one or more periods of the input signal. The amount of averaging performed is controlled by the following:

  • Divisor—Specifies the number of periods of the input signals to measure and average. Use a larger divisor to get more averaging and lower noise measurements.
  • Measurement Time—Specifies the amount of time over which to measure periods of the input signal to get the average value of the input signal period. Use a longer measurement time to get more averaging and lower noise measurements.
  • Maximum Measurable Period—Specifies the duration to wait for the input signal transitions before a no valid measurement found state is indicated. Set this to be longer than the slowest frequency you wish to measure.
spd-note-note
Note

The input divisor and measurement time settings wired into DAQmx Create Virtual Channel VI are ignored. Instead, DAQmx calculates default values for these settings based on the minimum and maximum values wired to the DAQmx Create Virtual Channel VI. You can use a channel property node to override these defaults allows for better control over the amount of averaging applied to your application.

During an acquisition, the dynamic averaging method will average between 1 period and divisor periods of the input signal to determine the input signal's frequency. The measurement time property sets an upper limit to the amount of time that is used for this averaging. As a result, the dynamic averaging method balances measurement accuracy vs. measurement latency throughout the input signal range as shown in the following table.

Signal Frequency Counter Behavior
High

(Divisor*Input Signal Period < Measurement Time)

Measures divisor periods of signal.
Medium

(Input Signal Period < Measurement Time < Divisor*Input Signal Period)

Measures between 1 and Divisor periods of the signal, depending on the number of periods that fit within the Measurement Time.
Low

(Input Signal Period >= Measurement Time)

Measure 1 period of signal.
Very Low

(Input Signal Period > Maximum Measurable Period)

Input signal is slower than the maximum measurable period. 0 Hz returned.

The measurement time and divisor can also be set manually using the property node before the acquisition starts if the auto measurement settings are not desired. The measurement time or divisor can be disabled by setting it to zero.

Measurement Time Divisor Notes
0 1 Measure 1 period of the input signal, similar to the 1 Counter (Low Frequency) method.
Input measurement time 0 Counts the number of periods of the input signal that occur during input measurement time, similar to the 2 Counters (High Frequency) method.
0 Input divisor Counts how long it takes for the input divisor periods of the signal to elapse, similar to the 2 Counters (Large Range) method.

You can view examples of the dynamic averaging method in the NI 9361 datasheet, which you can find at ni.com/manuals.


Recently Viewed Topics