IBM InfoSphere Streams Version 4.1.0

Operator CrossCorrelateMulti

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

In signal processing, cross-correlation is a measure of similarity of two time series as a function of a time-lag applied to one of them. Cross-correlation is also known as a sliding dot product or sliding inner-product, which is defined by the following formula: (f*g)[n]=Σ f*[m] g[n+m]

In this formula, f and g are two input time series. Cross-correlation is often used in pattern recognition. Output of cross-correlation indicates the amount of overlap or similarities between two input time series.

The CrossCorrelateMulti operator is capable of cross correlating two or more timeseries at a time. A single input port is used to consume a univariate timeseries list. The operator inserts the univariate list into a window. When the window trigger occurs, the operator calculates the cross correlation for each timeseries.

The operator is capable of calculating the cross correlation using either the FFT, Pearson or standard algorithm. The standard algorithm formula used for cross correlation is (f*g)[n]=Σ f*[m] g[n+m].

Behavior in a consistent region

  • The CrossCorrelateMulti 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.

Summary

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

Required: inputTimeSeries

Optional: algorithm, normalize, lag

Metrics
This operator does not report any metrics.

Properties

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

Input Ports

Ports (0)

This port consumes the values for the timeseries that are to be cross correlated. The inputTimeSeries parameter specifies the name of the attribute on this port that contains the time series data. The accepted data type is list<float64>.

Windowing

This port supports a tumbling window with a count-based, delta-based, time-based or punctuation-based eviction policy.

When the window is evicted, each timeseries is cross correlated with every other timeseries. The result of the cross correlation is submitted on the output port. Each submitted tuple is followed by a window marker.

Properties

Output Ports

Assignments
This operator allows any SPL expression of the correct type to be assigned to output attributes.
Output Functions
CrossCorrelatefunctions
<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.

map<set<int32>, list<float64>> crossCorrelateTimeSeries()

This function returns a map<set<int32>, list<float64>> that holds the results of cross correlating multiple signals. The map key, set<int32>, contains the indices of both time series that were cross correlated. The map value contains the result of the cross correlation. Each signal being cross correlated has the same length.

Ports (0)

This port submits a tuple that contains the result of the cross correlation. This port submits a tuple each time the timeseries are cross correlated, which occurs whenever the window is evicted. 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

inputTimeSeries

Specifies the name of the input timeseries attribute.

Properties

algorithm

Specifies the algorithm that the operator uses to calculate cross correlation. The supportws values are FFT, standard and pearson. The default value is FFT.

Properties

normalize

Specifies whether the operator calculates raw or normalized cross correlation. The operator normalizes the output time series by using the following formula: ncorr(x,y)= corr(x,y)/sqrt(corr(x,x)*corr(y,y)) where x and y represent the input time series. The default value is set to false.

Properties

lag

Specifies the maximum lag of the correlation process. The crosscorrelation results are over the range [-lag:lag]. The length of the returned results is a list of length 2*lag+1. When not specified, the lag value is the length of the longest of the input time series data.

Properties

Libraries

Cross correlate library
Library Name: tsatapi
Library Path: ../../../impl/lib
Include Path: ../../../impl/include