NextGlobalExtremum (FPScript)

21.09.2021

Searches for the next global extreme from a given position onwards.

Syntax

NextGlobalExtremum(DataSet, [ Position ], [ Orientation = EVENT_BOTH ] [ , Direction = EVENT_RIGHT ])

 

The syntax of the NextGlobalExtremum function consists of the following parts:

Part

Description

DataSet

The data set to be searched.

Permitted data structures are data series und signal. 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.

Position

If you are searching in a signal, this is the X value where the search is to start. If you are searching a data series, this is the index of the value where the search is to start. Here, a negative index determines a position relative to the end of the data set. If you omit the argument or pass the value Empty, the search starts at the beginning or end of the data set, depending on the direction of the search. The first or last value of the data set is only taken into account if you omit the argument or pass the Empty value.

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 minima, maxima or both are to be searched for.

The argument Orientation can have the following values:

Constant

Meaning

EVENT_POSITIVE

Search for global maximum only.

EVENT_NEGATIVE

Search for global minimum only.

EVENT_BOTH

Search for global minimum and maximum.

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.

Direction

Specifies the direction of the search in the function.

The argument Direction can have the following values:

Constant

Meaning

EVENT_RIGHT

Search to the right.

EVENT_LEFT

Search to the left.

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_RIGHT.

Remarks

The result always has the data structure scalar value.

Global maxima or minima are all occurrences of the largest or smallest value in the data set.

If DataSet is a data series, the result is the index of the extremum found. If DataSet is a signal, the result is the X value of the extremum. If no extremum could be found, the value Empty is output as the result.

Available in

FlexPro Basic, Professional, Developer Suite

Examples

NextGlobalExtremum(Signal, , EVENT_BOTH, EVENT_LEFT)

Searches in a signal from the end of the signal heading left for the next global minimum or maximum.

Signal[[NextGlobalExtremum(Signal)]]

Searches for the first global minimum or maximum in a signal. The result is the Y value of the extremum found.

See Also

GlobalExtrema Function

GlobalMaximum Function

GlobalMinimum Function

Event Isolation Analysis Object

Share article or send as email:

You might be interested in these articles