7 Calculations | 125
As an example, we can apply the Accumulate_Rolling to the result to see the
actual accumulated values for the window.
result = Accumulate_Rolling_<function>(input, Window_Signal_
<function>(input, limit))
The result will be greater or equal the limit except at the start of the signal when
there are not yet enough samples.
Example:
Creating a moving window always containing at least 80 grams of CO
2
exhaust:
movingWindow = Window_Signal_Integral(CO2, 80)
The movingWindow can now be used to evaluate other signals normalized
to the CO
2
exhaust.
Accumulate_Prefix
Calculates the reduction of a given signal from start to current sample.
Syntax:
result = Accumulate_Prefix_<reduction_function>(input)
Arguments:
T result: the reduction of signal from start to current sample
T input : the signal to be reduced
Note: T can be any type supported by the given reduction function.
The Accumulate_Prefix reduction behavior accumulates the input samples with
the given reduction function. The result is a signal with all the intermediate res-
ults, i.e. result[i] = reduce(signal[1], …, signal[i]).
Note: result = Accumulate_Rolling(signal, -Infinity) except that
the memory usage is constant.
Accumulate_Reset
Calculates the reduction of a given signal from the last reset to the current
sample.
Syntax:
result = Accumulate_Reset_<reduction_function>(input,
reset)
Arguments:
T result: the reduction over signal since the last reset
T input: the signal to be reduced
bool reset: reduction is restarted when true
Note: T can be any type supported by the given reduction function.
The Accumulate_Reset reduction behavior accumulates the input samples with
the given reduction function. The reduction is restarted when the reset input is
MDA V8 | User Guide