C++ Native Functions: com.ibm.streams.timeseries.generators

This page documents native functions that can be invoked from SPL, including the SPL interfaces that can be used to invoke each of the native functions.

Functions

public list<float64> generate_pulsetrain_wave(float64 frequency,uint32 length,float64 humpSize,uint32 samplesPerSecond)

Generates a pulse train representation of a time series, with a specified frequency, duration, sampling rate, and hump size.

You can use this function to generate pulse train wave signals, which you can use as input for time series operators and applications.

The following is an example of a pulse train:

Parameters

  • duration - Specifies the number of seconds in the time series that contains the pulse train.
  • frequency - Specifies the frequency of the pulse train wave in Hz.
  • humpsize - Specifies the hump size of the pulse to be generated. This parameter is optional and the value is specified as a float64 data type. The default value is 1.0.
  • samplingRate - Specifies the sampling rate of the pulse train wave in Hz.

Returns

Time series values of list<float64> type, which represent a pulse train. The number of values in the list is equal to the samplingRate parameter value multiplied by the duration parameter value. The amplitude of generated waves ranges between 1 and -1.

public list<float64> generate_sawtooth_wave(float64 frequency,uint32 length,uint32 samplesPerSecond)

Generates a sawtooth wave representation of a time series, with a specified frequency, duration, and sampling rate.

You can use this function to generate sawtooth wave signals, which you can use as input for time series operators and applications.

The following is an example of a sawtooth wave:

Parameters

  • duration - Specifies the number of seconds in the generated sawtooth wave time series.
  • frequency - Specifies the frequency of the sawtooth wave to be generated in Hz.
  • samplingRate - Specifies the sampling rate of the sawtooth wave to be generated in Hz.

Returns

Time series values of list<float64> type, which represent a sawtooth wave. The number of values in the list is equal to the samplingRate parameter value multiplied by the duration parameter value. The amplitude of generated waves ranges between 1 and -1.

public list<float64> generate_sine_wave(float64 frequency,uint32 length,uint32 samplesPerSecond)

Generates a sine wave representation of a time series, with a specified frequency, duration, and sampling rate.

You can use this function to generate sine wave signals, which you can use as input for time series operators and applications.

The following is an example of a sine wave:

Parameters

  • duration - Specifies the number of seconds in the generated sine wave time series.
  • frequency - Specifies the frequency of the sine wave to be generated in Hz.
  • samplingRate - Specifies the sampling rate of the sine wave to be generated in Hz.

Returns

Time series values of list<float64> type, which represent a sine wave. The number of values in the list is equal to the samplingRate parameter value multiplied by the duration parameter value. The amplitude of generated waves ranges between 1 and -1.

public list<float64> generate_square_wave(float64 frequency,uint32 length,uint32 samplesPerSecond)

Generates a square wave representation of time series with a specific frequency, duration, and sampling rate.

You can use this function to generate square wave signals, which you can use as input for time series operators and applications.

The following is an example of a square wave:

Parameters

  • duration - Specifies the number of seconds in the generated square wave time series.
  • frequency - Specifies the frequency of the square wave to be generated in Hz.
  • samplingRate - Specifies the sampling rate of the square wave to be generated in Hz.

Returns

Time series values of list<float64> type, which represent a square wave. The number of values in the list is equal to the samplingRate parameter value multiplied by the duration parameter value. The amplitude of generated waves ranges between 1 and -1.

public list<float64> generate_triangular_wave(float64 frequency,uint32 length,uint32 samplesPerSecond)

Generates a triangular wave representation of a time series, with a specified frequency, duration, and sampling rate.

You can use this function to generate triangular wave signals, which you can use as input for time series operators and applications.

The following is an example of a triangular wave:

Parameters

  • duration - Specifies the number of seconds in the generated triangular wave time series.
  • frequency - Specifies the frequency of the triangular wave to be generated in Hz.
  • samplingRate - Specifies the sampling rate of the triangular wave to be generated in Hz.

Returns

Time series values of list<float64> type, which represent a triangular wave. The number of values in the list is equal to the samplingRate parameter value multiplied by the duration parameter value. The amplitude of generated waves ranges between 1 and -1.