PositivePeaks (FPScript)

21.09.2021

Searches in a data set for positive peaks.

Syntax

PositivePeaks(DataSet, Level, [ Orientation = EVENT_BOTH ], [ Operation = EVENT_DEFAULT ], [ DeltaXmin ] [ , DeltaXmax ])

 

The syntax of the PositivePeaks 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 the X component additional restrictions do apply.The values must be monotonously increasing.

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.

Level

Specifies the level above which the values must lie.

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

Only peaks are found that have level crossings in both directions.

The argument Orientation can have the following values:

Constant

Meaning

EVENT_BEGINNING

Search only for beginnings of peaks.

EVENT_END

Search only for ends of peaks.

EVENT_BOTH

Search for peak beginnings and ends.

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:

Constant

Meaning

EVENT_INDEX

The indices of the values or points meeting the condition are placed in the result data set.

EVENT_EXTRACT

Only the points or values meeting the condition are transferred into the result data set.

EVENT_SETVOID

The points or values that do not meet the condition are also included in the result data set, but there they are marked as void.

EVENT_DEFAULT

Corresponds to EVENT_SETVOID if a data matrix or signal series is present, and otherwise EVENT_INDEX.

+ EVENT_COMPLEMENT

This constant can be optionally added and then reverses the selected operation. Then, for example, for EVENT_EXTRACT, the points that do not meet the condition are copied.

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.

DeltaXmin

Optionally determines the minimum duration or number of values that an event must endure to be valid. If you search within a signal, this is the X range from the first value of the event to the last value of the event. If you search within a data series, this is the minimum number of data points that the event must have.

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 first element in the list is taken. If this is also a list, then the process is repeated.

DeltaXmax

Optionally determines the maximum duration or number of values that an event can endure to be valid. If you search within a signal, this is the X range from the first value of the event to the last value of the event. If you search within a data series, this is the maximum number of data points that the event can have.

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 first element in the list is taken. If this is also a list, then the process is repeated.

Remarks

Only peaks are found that have level crossings in both directions. A peak beginning is found when the value is greater than or equal to the level and the previous value is less than the level. A peak end is found when the value is greater than or equal to the level and the subsequent value is less than the level.

Available in

FlexPro Basic, Professional, Developer Suite

Examples

PositivePeaks({1,1,2,3,4,5,4,3,2,4,4,1,4}, 3, EVENT_POSITIVE)

Results in {3L, 9L, 12L}. Searches within the data set for positive peaks whose level crossing is at 3. The indices where the peaks begin are returned.

PositivePeaks(Signal({1,1,2,3,4,5,4,3,2,4,4,1},1), 3, EVENT_BOTH, EVENT_INDEX, 3, 4)

Results in {3L, 7L}. Searches within the signal for positive peaks whose level crossing is at 3. The indices where the peaks begin and end are returned. A peak width must be at least 3, but no more than 4.

See Also

NegativePeaks Function

NextPositivePeak Function

LevelCrossings Function

ValuesAboveLevel Function

ValuesBelowLevel Function

ValuesInInterval Function

TimePeriods Function

Event Isolation Analysis Object

Share article or send as email:

You might be interested in these articles