DeltaCompress (FPScript)

21.09.2021

Reduces the number of values in a data set through delta compression.

Syntax

DeltaCompress(DataSet, DeltaY, [ Predecessors = 0 ] [ , Operation = EVENT_EXTRACT ])

 

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

Part

Description

DataSet

The data set to be compressed.

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.

DeltaY

Specifies the minimum Y interval by which the amplitude is to rise or fall so that a value can be copied.

Permitted data structures are scalar value. All numeric data types are permitted. The unit has to be compatible with that of parameter DataSet.

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.

Predecessors

Specifies the number of predecessors to be copied for each value accepted. Improves the reproduction of slopes in a compressed data set.

Permitted data structures are scalar value. All numeric data types are permitted.

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

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

Remarks

The delta compression reduces the data of a data set by removing all values for which the absolute deviation from the preceding value is smaller than a given threshold value. For signals that show a constant value over long distances, this can lead to a considerable reduction in data without losing a large amount of information. The algorithm first uses the first value in DataSet that is not a void floating point value as the first sampling point of the compressed data set. For subsequent values, the absolute value of the difference is compared to the specified DeltaY. If this is greater than DeltaY, then this value is the next reference value and it as well as the specified number of predecessor values become part of the compressed data set.

Available in

FlexPro Basic, Professional, Developer Suite

Examples

DeltaCompress({3, 5, 4, 2, 7, 6, 8, 1}, 1.5)

Results in {3, 5, 2, 7, 1}.

DeltaCompress({3, 5, 4, 2, 7, 6, 8, 1}, 1.5, 1)

Results in {3, 5, 4, 2, 7, 8, 1}.

See Also

Reduce Function

LinearInterpolation Function

Sample Function

Resample Function

Signal Sampling Analysis Object

Share article or send as email:

You might be interested in these articles