04.01.2015 Views

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Section 7. Installation<br />

where X N is the most recent value of the source variable and X N-1 is the previous<br />

value (X 1 is the oldest value included in the average, i.e., N-1 values back from<br />

the most recent). NANs are ignored in the processing of AvgRun() unless all<br />

values in the population are NAN.<br />

AvgRun() uses high-precision math, so a 32-bit extension of the mantissa is saved<br />

and used internally resulting in 56 bits of precision.<br />

Note This instruction should not normally be inserted within a For/Next<br />

construct with the Source and Destination parameters indexed and Reps set to 1.<br />

Doing so will perform a single running average, using the values of the different<br />

elements of the array, instead of performing an independent running average on<br />

each element of the array. The results will be a running average of a spatial<br />

average of the various source array elements.<br />

A running average is a digital low-pass filter; its output is attenuated as a function<br />

of frequency, and its output is delayed in time. The amounts of attenuation and<br />

phase shift (time delay) depend on the frequency of the input signal and the time<br />

length (which is related to the number of points) of the running average.<br />

Figure Running-Average Frequency Response (p. 265) is a graph of signal<br />

attenuation plotted against signal frequency normalized to 1/(running average<br />

duration). The signal is attenuated by a synchronizing filter with an order of 1<br />

(simple averaging): Sin(πX) / (πX), where X is the ratio of the input signal<br />

frequency to the running-average frequency (running-average frequency = 1 /<br />

time length of the running average).<br />

Example:<br />

Scan period = 1 ms,<br />

N value = 4 (number of points to average),<br />

Running‐average duration = 4 ms<br />

Running‐average frequency = 1 / (running‐average duration = 250 Hz)<br />

Input‐signal frequency = 100 Hz<br />

Input frequency to running average (normalized frequency) = 100 / 250<br />

= 0.4<br />

Sin(0.4π) / (0.4π) = 0.757 (or read from figure Running‐Average<br />

Frequency Response (p. 265), where the X axis is 0.4)<br />

For a 100‐Hz input signal with an Amplitude of 10‐V peak to peak, a<br />

running average outputs a 100‐Hz signal with an amplitude of 7.57‐V<br />

peak to peak.<br />

There is also a phase shift, or delay, in the AvgRun() output. The formula for<br />

calculating the delay, in number of samples, is:<br />

Delay in samples = (N‐1)/2<br />

264

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!