LevelCrossings (FPScript)
Searches a data set for level crossings.
Syntax
LevelCrossings(DataSet, Level, Hysteresis, [ Orientation = EVENT_BOTH ] [ , Operation = EVENT_DEFAULT ])
The syntax of the LevelCrossings 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. |
||||||||||||
Level |
Specifies the level for which the crossings are to be found. 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. |
||||||||||||
Hysteresis |
The hysteresis forms a symmetrical band [level - hysteresis, level + hysteresis] around the specified level. A level crossing is then only accepted if the course of the curve enters the band from one side and then exits on the other side. 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 the orientation of the level crossings to be found. 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
Hysteresis prevents level crossings from being detected several times in noisy signals. If the course of the curve oscillates multiple times around the level before leaving the hysteresis band, then the mean value of the first and last crossing through the level is passed as an index.
Available in
FlexPro Basic, Professional, Developer Suite
Examples
LevelCrossings({1, 5, 7, 4, 3}, 5, 0) |
Results in {1L, 2L}. Results in the indices of the positions at which the level is crossed. |