IBM InfoSphere Streams Version 4.1.0

Operator DWT

Primitive operator image not displayed. Problem loading file: ../../image/tk$com.ibm.streams.timeseries/op$com.ibm.streams.timeseries.analysis$DWT.svg

DEPRECATED: The com.ibm.streams.timeseries.analysis.DWT operator is deprecated and is replaced by the com.ibm.streams.timeseries.analysis.DWT2 operator. The deprecated operator might be removed in a future release.

The DWT 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 DWT operator uses a Daubechies wavelet of order 2 or 4, depending on the value of the order parameter. When you specify a value of 2 for the order 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 order 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 DWT 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. Otherwise, an error occurs when you compile the streams processing application. If the input time series is a list, then window configurations must not be provided. Otherwise, an error occurs when you compile the streams processing application.

The DWT operator is a multivariate operator.

Behavior in a consistent region

  • The DWT 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 DWT 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 a float64 data type and window configurations are not provided.

Windowing

The DWT 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 DWT 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.

Examples
These examples demonstrate how to use the DWT operator.

Summary

Ports
This operator has 1 input port and 1 output port.
Windowing
This operator optionally accepts a windowing configuration.
Parameters
This operator supports 4 parameters.

Required: inputTimeSeries

Optional: algorithm, flushOnFinal, order

Metrics
This operator reports 1 metrics.

Properties

Implementation
C++
Threading
Never - Operator never provides a single threaded execution context.

Input Ports

Ports (0)

This port 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

Output Ports

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.

Ports (0)

This port submits a tuple that contains the transformed timeseries. This port submits a tuple each time a timeseries 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

Parameters

This operator supports 4 parameters.
inputTimeSeries

Specifies the name of the attribute that contains the time series data in the input tuple. The supported data type is either a single float64 value or list<float64> values.

Properties

algorithm

Specifies the type of algorithm to apply on the input time series. The supported values are DWT for a discrete wavelet transformation and IDWT for an inverse discrete wavelet transformation. The default parameter value is DWT.

Properties

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

order

Specifies the order of the alogirthm to apply. The valid values are two and four, which represent the Daubechies wavelet 2 and Daubechies wavelet 4 algorithms, respectively. The default value is two.

Properties

Code Templates

DWT
stream<${schema}> ${outputStream} = DWT(${inputStream}) 
{
	param
		inputTimeSeries:		${timeSeriesExpression};

	output
		${outputStream}: ${outputExpression};
}
      

Metrics

numWindowsDropped - Counter

The number of times windows that are dropped because they have less than two time series or less than four series, depending on the value of the order parameter.

Libraries

No description for library.
Command
Library Name: tsatapi
Library Path: ../../../impl/lib/
Include Path: ../../../impl/include