Operator TSWindowing
The TSWindowing operator can be used to isolate a portion of the signal in a specified duration. The operator weights a portion of the signal by using a weighting function that tapers down to zero at the edge.
The TSWindowing operator is a windowed operator that requires window configuration to be specified. The TSWindowing operator requires at least four time series tuples to apply time series windowing functions. Otherwise, the window is dropped and a window punctuation is output.
The windowing functions that are currently supported are: Hamming, Hann, Blackman, Cosine, and Triangle.
Behavior in a consistent region
- The TSWindowing operator is not supported in a consistent region. A warning occurs when you compile your streams processing application.
- The operator cannot be the start of a consistent region. An error occurs when you compile your streams processing application.
Exceptions
The TSWindowing operator throws an exception in the following case:
- The input time series contains less than 8 elements.
Windowing
The TSWindowing operator supports the following window configurations:
tumbling(count|punctuation|time|delta)-based eviction
sliding(count|time|delta)-based eviction and based trigger
For the tumbling variants, tuples are windowed when the window gets full and flushes. The appropriate time series windowing function is applied on the window and it is output immediately, followed by a window marker punctuation.
For the sliding variants, the windowing function is applied on tuples when the window triggers. The output tuple that contains the windowed list is sent immediately, followed by a window marker punctuation.
The sliding windows for an TSWindowing operator do not fire until the window is full for the first time. This rule does not apply to sliding windows with time-based trigger policies. Such windows are assumed to be full when they start out.
Both for tumbling and sliding windows, when a time-based window with no tuples in it fires, just a window marker punctuation is output. When a tumbling, punctuation-based window with no tuples in it receives a window marker punctuation, just a window marker punctuation is output. If any window has less than four time series tuples, the specific window is dropped because time series windowing requires at least four times series tuples to work with.
If the flushOnFinal parameter value is true, the final punctuation flushes the pending windows.
Summary
- Ports
- This operator has 1 input port and 1 output port.
- Windowing
- This operator requires a windowing configuration.
- Parameters
- This operator supports 3 parameters.
Required: inputTimeSeries
Optional: algorithm, flushOnFinal
- Metrics
- This operator reports 1 metric.
Properties
- Implementation
- C++
- Threading
- Always - Operator always provides a single threaded execution context.
- Ports (0)
-
This port consumes the time series data that is to be processed by the windowing algorithm. The inputTimeSeries parameter specifies the name of the attribute on this port that contains the time series data. The accepted data type is float64.
- Properties
-
- Optional: false
- ControlPort: false
- TupleMutationAllowed: false
- WindowingMode: Windowed
- WindowPunctuationInputMode: WindowBound
- Assignments
- This operator requires that assignments made to output attributes cannot reference input stream attributes.
- Output Functions
-
- TSWindowFunctions
-
- <any T> T AsIs(T v)
-
The default function for output attributes. By default, this function assigns the output attribute to the value of the input attribute with the same name.
- list<float64> windowedTimeSeries()
-
Returns the time series data after being processed by the windowing algorithm. The return type can be either list<float64> (multivariate) or float64 (univariate).
- Ports (0)
-
This port submits a tuple that contains the result of the windowing algorithm on the input time series. This port submits a tuple whenever a time series has been processed by the windowing algorithm. Custom output functions are used to specify the value of the output tuple attributes. The output tuple attributes whose assignments are not specified are assigned from input attributes.
- Properties
-
- Optional: false
- TupleMutationAllowed: false
- WindowPunctuationOutputMode: Generating
Required: inputTimeSeries
Optional: algorithm, flushOnFinal
- algorithm
-
Specifies the type windowing function to apply to the time series. The supported windowing algorithms are:
- Hamming
- Hann
- Blackman
- Cosine
- Triangle
The default value is Hamming.
- Properties
-
- Type: WindowTypes (HAMMING, HANN, BLACKMAN, COSINE, TRIANGLE)
- Cardinality: 1
- Optional: true
- ExpressionMode: CustomLiteral
- flushOnFinal
-
Specifies whether the pending tuples in the window are flushed when a final punctuation is received. If set to true, then the window is flushed and the window is processed. If set to false, then the window is dropped and no processing occurs. The default value is false.
- Properties
-
- Type: boolean
- Cardinality: 1
- Optional: true
- ExpressionMode: Expression
- inputTimeSeries
-
Specifies the name of the attribute that contains the time series data in the input tuple. The supported data type is float64.
- Properties
-
- Type: float64
- Cardinality: 1
- Optional: false
- ExpressionMode: Expression
- TSWindowing
-
stream<${schema}> ${outputStream} = TSWindowing(${inputStream}) { param inputTimeSeries: ${timeSeriesAttributeExpression}; output ${outputStream}: ${outputExpression}; }
- numWindowsDropped - Counter
-
Counts the number of windows that have been dropped because they contained less than four time series tuples.
- No description for library.