Operator DWT2
The DWT2 operator applies a discrete wavelet transform (DWT) on a vector time series. You can use the operator to implement time series signal decomposition. For example, you can decompose a time series into power and magnitude components.
In numerical analysis and functional analysis, a discrete wavelet transform (DWT) is any wavelet transform for which the wavelets are discretely sampled. As with other wavelet transforms, a key advantage it has over Fourier transforms is temporal resolution: it captures both frequency and time information.
The DWT2 operator uses a Daubechies wavelet of order 2 or 4, depending on the value of the waveletIndex parameter. When you specify a value of 2 for the waveletIndex parameter, the list in the input time series must have at least two time series values. When you specify a value of 4 for the waveletIndex parameter, the list in the input time series must have at least four time series values. If fewer values exist in the list, an exception occurs.
The DWT2 operator expects input time series as list<float64> values. If the input time series is a single value of float64 type, then window configurations must be provided. If the input time series is a list, then window configurations must not be provided. Otherwise, errors occur when you compile the streams processing application.
The DWT2 operator is a multivariate operator.
Behavior in a consistent region
- The DWT2 operator can be an operator within the reachability graph of a consistent region.
- The operator cannot be the start of a consistent region. An error occurs when you compile your streams processing application.
Exceptions
The DWT2 operator throws an exception in the following cases:
- The input time series is a list and the size of the list increases.
- The input time series is single value with the float64 data type and window configurations are not provided.
Windowing
The DWT2 operator supports the following window configurations when the input time series is a single float64 value:
- Tumbling, with a count-based, time-based, or punctuation-based eviction policy
- Sliding, with a count-based, time-based, or delta-based eviction and trigger policies
The window must contain at least four tuples if the order parameter value is 4 and at least two tuples if the order parameter value is 2. Otherwise, the window is dropped, a message is logged in the pec.*pepe-id*.log file, and only a window marker punctuation is output.
For the tumbling variants, tuples are transformed when the window is full (and flushes). The transformed time series is output immediately, followed by a window marker punctuation.
For the sliding variants, tuples are transformed when the window triggers. The transformed time series is output immediately, followed by a window marker punctuation.
The sliding windows for a DWT2 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, only a window marker punctuation is output. When a tumbling, punctuation-based window with no tuples in it receives a window marker punctuation, only a window marker punctuation is output. The final punctuation flushes the pending windows if the flushOnFinal parameter is true.
Summary
- Ports
- This operator has 1 input port and 1 output port.
- Windowing
- This operator optionally accepts a windowing configuration.
- Parameters
- This operator supports 5 parameters.
Required: inputTimeSeries, waveletIndex
Optional: algorithm, flushOnFinal, level
- Metrics
- This operator does not report any metrics.
Properties
- Implementation
- C++
- Threading
- Never - Operator never provides a single threaded execution context.
- Ports (0)
-
Consumes the input timeseries to be transformed. The inputTimeSeries parameter specifies the name of the attribute on this port that contains the time series data. The accepted data types are float64 and list<float64>.
- Properties
-
- Optional: false
- ControlPort: false
- TupleMutationAllowed: false
- WindowingMode: OptionallyWindowed
- WindowPunctuationInputMode: WindowBound
- Assignments
- This operator allows any SPL expression of the correct type to be assigned to output attributes.
- Output Functions
-
- DWTFunctions
-
- <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> DWTTransform()
-
Returns a list value that holds the transformed time series data.
- list<float64> getDetails(int32 level)
-
Returns the wavelet details at the specified level. Setting level to -1 will return the details at the maximum possible level.
- list<float64> getApproximations(int32 level)
-
Returns the wavelet approximations at the specified level. Setting level to -1 will return the details at the maximum possible level.
- int32 getMaxLevel()
-
Returns the maximum possible level for the given time series.
- Ports (0)
-
Submits a tuple that contains the transformed time series. This port submits a tuple each time a time series is transformed. 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, waveletIndex
Optional: algorithm, flushOnFinal, level
- algorithm
-
This parameter specifies the type of algorithm to apply on the input time series. Supported values are DWT for a discrete wavelet transformation and IDWT for an inverse discrete wavelet transformation. The default parameter value is DWT.
- Properties
-
- Type: DWTAlgo (DWT, IDWT)
- Cardinality: 1
- Optional: true
- ExpressionMode: CustomLiteral
- flushOnFinal
-
Flush the window when final punctuation is received, Default is false. This parameter has no effect when the operator is configured without a window.
- Properties
-
- Type: boolean
- Cardinality: 1
- Optional: true
- ExpressionMode: Constant
- inputTimeSeries
-
The parameter value specifies the name of the attribute that contains the time series data in the input tuple. The supported data type is either a float64 or list<float64>.
- Properties
-
- Type
- Cardinality: 1
- Optional: false
- ExpressionMode: Attribute
- level
-
Decomposes the signal up to the specified level
- Properties
-
- Type: int32
- Cardinality: 1
- Optional: true
- ExpressionMode: Expression
- waveletIndex
-
Specifies the order of the algorithm to apply. Valid values are 1 - 100 (inclusive).
- Properties
-
- Type: int32
- Cardinality: 1
- Optional: false
- ExpressionMode: Expression
- DWT2
-
stream<${schema}> ${outputStream} = DWT2(${inputStream}) { param inputTimeSeries: ${timeSeriesExpression}; output ${outputStream}: ${outputExpression}; }
- No description for library.