7 Calculations | 127
A reduction function can also be defined based on existing reduction functions.
Minimum
The Minimum reduction function returns the minimum of all input values:
combine(a, b) = min(a, b)
The Minimum is available for all numeric data types.
Maximum
The Maximum reduction function returns the maximum of all input values:
combine(a, b) = max(a, b)
The Maximum is available for all numeric data types.
Count
The reduction function returns the number of samples:
Count(values[1], …, values[n]) = n
Add
The Add reduction function returns the sum of all input values:
combine(a, b) = a + b
Average
The Average reduction function calculates the average over the input values.
This is simply the sum of the samples divided by the number of the samples:
Average(values) = Add(values) / Count(values)
Integral
The Integral reduction function calculates the area under the signal curve from
the time of the first sample to the time of the last sample selected. It assumes
step interpolation, i.e. it is the sum over the rectangles extending to the right of
each sample:
r_i = s_i * (t_i+1 - t_i)
Here s_i is the value and t_i is the time of the sample at index i. The rectangle of
the last sample is not included in the sum as it extends past the end time of the
range.
MDA V8 | User Guide