beautypg.com

Campbell Scientific CR23X Micrologger User Manual

Page 177

background image

SECTION 10. PROCESSING INSTRUCTIONS

10-13

The Averaging Period Processing occurs
whenever the number of input samples entered
in Parameter 7 is satisfied or whenever an
Output Interval occurs (i.e., whenever the Output
Flag is set). Results from these calculations are
stored sequentially in Input Storage locations
starting with the location specified in Parameter
9. The calculations performed are shown below,
where N is the number of input samples in the
averaging period:

1.

Means:

M(X) =

Σ

X/N

2.

Variances:

V(X) =

Σ

X

2

/N - (

Σ

X/N)

2

3.

Standard Deviations:

SD(X) = V(X)

1/2

4.

Covariances:

CV(X,Y) =

Σ

XY/N -

Σ

X

Σ

Y/N

2

5.

Correlations:

CR(X) = CV(X,Y)/(SD(X)SD(Y))

NOTE:

1. The square root algorithm in the
CR23X returns a result of 0 for
negative arguments.

2. The divide algorithm returns the
largest floating point number possible
(

±

10

18

displayed as

±

99999) for a

divide by 0.

3. When computing the variance of a
constant signal, round off error
produces a small negative result.
The CR23X returns a 0 for the
square root of a negative number;
therefore, the standard deviation is
set to 0. If the signal is also used in a
correlation calculation, division by 0
returns an overrange value for the
correlation result.

If a fast execution interval is specified, it is
possible that the combined execution times of
the input and averaging period processing may
exceed the program table execution interval.
The occurrence of an execution interval Overrun
(see Section 1.1.1 of CR23X Operator's Manual)
is noted by a “

T

o

” in the lower right of the display

in the Running Table mode (

0

mode).

This results in the omission of one input sample.
The calculations are not affected, however, since
the number of input samples is incremented only
when valid input processing occurs. Averaging

period processing occurs only when the number
of input samples specified in Parameter 7 is
accumulated.

Regardless of whether all of the input samples
for the averaging period (specified in Parameter
7) have occurred or not, averaging period
processing occurs whenever the Output Flag is
set. This accommodates situations where the
Output Interval may not be an integer multiple of
the averaging period. If for example a 30 minute
Output Interval is set by Instruction 92 and an 8
minute averaging period is specified by
Parameter 7, then three 8 minute and one 6
minute calculations will occur. The proper
weighting of these values in producing the final
output is described below.

The Output Processing occurs only at the
Output Interval and involves averaging the
statistical results obtained at the averaging
periods. These final results are then stored
sequentially in Input Storage beginning with the
location specified in Parameter 9. The Sample
Instruction 70 must be used to transfer the data
to Final Storage. All but the last averaging
period in the Output Interval will contain the
same number of input scans as specified by
Parameter 7. To insure that results from the
averaging periods contribute to the final result
proportional to their averaging periods, the
output processing uses the following equation:

RF = (NR1 + NR2 + .... + N'RL)/NT

RF is the final result
R1 R2, etc., are the results from the averaging

period processing

RL is the result from the last averaging period

in the Output Interval

N

is the number of input samples in the
specified averaging period (Parameter 7)

N' is the number of input scans in the last

averaging period

NT is the total number of input samples

processed in the Output Interval

INTERMEDIATE STORAGE REQUIREMENTS

The number of Intermediate locations will
depend upon the number of input values and
outputs desired:

1.

Define K as the number of input values.

2.

Define S as the maximum of either the
variances, standard deviations, or C, where