Extrema (FPScript)
Searches for local minima and/or maxima in a data set.
Syntax
Extrema(DataSet, Hysteresis, [ Orientation = EVENT_BOTH ] [ , Operation = EVENT_DEFAULT ])
The syntax of the Extrema function consists of the following parts:
Part |
Description |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DataSet |
The data set to be searched. Permitted data structures are data series, data matrix, signal und signal series. All numeric data types are permitted. For complex data types the absolute value is formed. If the argument is a list, then the function is executed for each element of the list and the result is also a list. |
||||||||||||
Hysteresis |
Specifies the minimum amount by which the signal amplitude must rise or fall once a local maximum or minimum has been recognized in order for it to be accepted as a local extreme. Permitted data structures are scalar value. All numeric data types are permitted. The unit has to be compatible with that of parameter DataSet. For complex data types the absolute value is formed. If the argument is a list, then the function is executed for each element of the list and the result is also a list. |
||||||||||||
Orientation |
Specifies whether to search for minima, maxima or both. The argument Orientation can have the following values:
If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated. If this argument is omitted, it will be set to the default value EVENT_BOTH. |
||||||||||||
Operation |
Specifies the way the function operates. The argument Operation can have the following values:
If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated. If this argument is omitted, it will be set to the default value EVENT_DEFAULT. |
Remarks
The local extrema in the data set are identified using a hysteresis. A value is recognized as a local maximum when the previous values in the data set increase by at least the specified hysteresis amount, and the subsequent values decrease by at least the specified hysteresis amount. A value is recognized as a local minimum when the previous values in the data set decrease by at least the specified hysteresis amount, and the subsequent values increase by at least the specified hysteresis amount.
Available in
FlexPro Basic, Professional, Developer Suite
Examples
Extrema({1, 3, 5, 4, 1}, 1, EVENT_BOTH, EVENT_EXTRACT) |
Results in 5. |