EasyManua.ls Logo

ETAS MDA V8 - Page 126

Default Icon
153 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
7 Calculations | 126
true. The result is a signal with all the intermediate results, i.e. result[i] =
reduce(signal[k], …, signal[i]) where k is the index of the last time
reset was true or 1 if it never was true.
Example: Accumulate_Reset_Maximum
Signal Reset Result
1 false 1
5 false 5
3 false 5
2 true 2
Accumulate_Samples
Calculates a rolling reduction over a given number of samples.
Syntax:
result = Accumulate_Samples_<reduction_function>(input,
count)
Arguments:
T result: the reduction over the last count samples
T input: the signal to reduce
const int count: the number of samples to reduce
Note: T can be any type supported by the given reduction function.
The Accumulate_Samples function calculates the reduction over the last count
samples before and including the current sample. At the beginning when there
are less than count samples, all available samples are reduced.
Note: Accumulate_RollingSample<R>(input, count) = Accumulate_
Rolling<R>(input, State_Delay(Master(), -Infinity, count))
Reduction Functions
A reduction function is a function that takes a sequence of values and calculates
a single result value, the reduction.
reduction = Reduce(value[1], …, value[n])
In the border case n=0 the reduction function is applied to an empty sequence of
values:
neutral = Reduce()
This defines a "neutral" element of the reduction.
A reduction function can be defined by repeatedly combining two values with a
combine function. For example if we use the addition as the combine function we
get the sum of the input values:
tmp[0] = 0
tmp[i] = tmp[i-1] + value[i]
reduction = tmp[n]
MDA V8 | User Guide

Table of Contents

Related product manuals