FlexPro
HistoryBase
Engineering
Training
Downloads
FlexPro Support
Knowledge
Community
About us
References
Jobs
General Contact
List Of Retailers
FlexPro Support
EN
DE
FR
Placeholder

FlexPro Documentation 2025

BlockCompress

Reduces the number of values in a data set using block operations or splits it into a list of segments.

Syntax

BlockCompress(DataSet, XInterval, [ Output = BC_OUTPUT_MEAN ] [ , Options = BC_OPTION_RESIDUAL ])

 

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

Part

Description

DataSet

The data set to be compressed.

Permitted data structures are Signal. 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.

XInterval

Specifies the block size as an X interval in the unit of the X component of DataSet.

Permitted data structures are Scalar value. All real data types are permitted.

The value must be greater than 0.

Void values are not permitted in this argument.

If the argument is a list, then the function is executed for each element of the list and the result is also a list.

Output

Specifies which results are to be output. If you select several results, the output will be a list.

The argument Output can have the following values:

Constant

Meaning

+ BC_OUTPUT_ALL

All available results, except the results Indices and List.

+ BC_OUTPUT_FIRSTVAL

The first Y value of each block is transferred to the result.

+ BC_OUTPUT_MEAN

The arithmetic mean of the Y values of each block is transferred to the result.

+ BC_OUTPUT_MINIMUM

The minimum of the Y values of each block is transferred to the result.

+ BC_OUTPUT_MAXIMUM

The maximum of the Y values of each block is transferred to the result.

+ BC_OUTPUT_RANGE

The range (maximum minus minimum) of the Y values of each block is transferred to the result.

+ BC_OUTPUT_INTEGRAL

The integral of each block formed using the trapezoidal rule is transferred to the result.

+ BC_OUTPUT_RMS

The root mean square of the Y values of each block is transferred to the result.

+ BC_OUTPUT_INDEX

The indices of the block boundaries are transferred to the result as a data series.

+ BC_OUTPUT_LIST

The result is a list with one element per block containing the Y and X data of the block. The element names are formed from the name of DataSet by appending an index. In this case, there is no data reduction. Only the void data points are filtered out. In the next step, apply any FPScript function that supports list processing.

If this argument is omitted, it will be set to the default value BC_OUTPUT_MEAN .

Options

Selects options for the algorithm.

The argument Options can have the following values:

Constant

Meaning

+ BC_OPTION_RESIDUAL

This option also outputs a value for the incomplete block at the end of the data set.

+ BC_OPTION_ALIGNLIMITS

The first block limit is calculated from the first X value plus the block size. This option adjusts (reduces) the block limit to an integer multiple of the block size. The option also affects the X values output. If it is active, the calculated block limits are output instead of the first X values of the blocks.

If this argument is omitted, it will be set to the default value BC_OPTION_RESIDUAL .

Remarks

Block compression reduces the data of a data set by creating one result value per block. Only data points in DataSet whose Y and X components are valid are processed. The block size is specified as an X interval in a unit compatible with the unit of the X component of DataSet compatible unit. An X value that lies exactly on a block boundary is assigned to the next block. The values in DataSet do not have to be equidistantly sampled. If a block does not contain any values, the value of the previous block is output again. The result is a signal with one value per block. The first X value in the block is transferred to the X component of the result.

Available in

FlexPro Basic, Professional, Developer Suite

Examples

BlockCompress(DataSet, 5 min)

Returns the 5-minute average values from DataSet.

BlockCompress(DataSet, 5 min, BC_OUTPUT_FIRSTVAL)

Reduces the data from DataSet to one value per 5 minutes.

Signal(ListToSeries(Quantile(BlockCompress(DataSet, 5 min, BC_OUTPUT_LIST), 0.5)), BlockCompress(DataSet, 5, BC_OUTPUT_FIRSTVAL).X)

Reduces the data from DataSet to a median value per 5 minutes. ListToSeries(Quantile(BlockCompress(DataSet, 5 min, BC_OUTPUT_LIST), 0.5)) splits the data into a list of sections, calculates the median for each section and converts the list of individual values into a data series. BlockCompress(DataSet, 5, BC_OUTPUT_FIRSTVAL).X returns the first X values of the sections as a data series. The function Signal function is used to combine the Y and X data series into a signal.

See Also

Maximum Function

Minimum Function

Mean Function

DeltaCompress Function

Reduce Function

LinearInterpolation Function

Sample Function

Resample Function

Signal Sampling Analysis Object