Campbell Scientific CR3000 CR3000 Micrologger - Page 271
Running Average
View all Campbell Scientific CR3000 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 271 highlights
Section 7. Installation 7.8.19 Running Average The AvgRun() instruction calculates a running average of a measurement or calculated value. A running average is the average of the last N values where N is the number of values, as expressed in figure Running-Average Equation (p. 271), Figure 85: Running-average equation where XN is the most recent value of the source variable and XN-1 is the previous value (X1 is the oldest value included in the average, i.e., N-1 values back from the most recent). NANs are ignored in the processing of AvgRun() unless all values in the population are NAN. AvgRun() uses high-precision math, so a 32-bit extension of the mantissa is saved and used internally resulting in 56 bits of precision. Note This instruction should not normally be inserted within a For/Next construct with the Source and Destination parameters indexed and Reps set to 1. Doing so will perform a single running average, using the values of the different elements of the array, instead of performing an independent running average on each element of the array. The results will be a running average of a spatial average of the various source array elements. A running average is a digital low-pass filter; its output is attenuated as a function of frequency, and its output is delayed in time. The amounts of attenuation and phase shift (time delay) depend on the frequency of the input signal and the time length (which is related to the number of points) of the running average. Figure Running-Average Frequency Response (p. 273) is a graph of signal attenuation plotted against signal frequency normalized to 1/(running average duration). The signal is attenuated by a synchronizing filter with an order of 1 (simple averaging): Sin(πX) / (πX), where X is the ratio of the input signal frequency to the running-average frequency (running-average frequency = 1 / time length of the running average). Example: Scan period = 1 ms, N value = 4 (number of points to average), Running‐average duration = 4 ms Running‐average frequency = 1 / (running‐average duration = 250 Hz) Input‐signal frequency = 100 Hz 271