Table of Contents

Class TimeSeriesCreator

Namespace
TimeSeriesAnalysis.Utility
Assembly
TimeSeriesAnalysis.dll

Class for static methods create different types of time-series for testing.

public static class TimeSeriesCreator
Inheritance
TimeSeriesCreator
Inherited Members

Methods

Concat(double[], double[])

Combine to signals of length N1 and N2 into a new signal of length N1+N2

public static double[] Concat(double[] u1, double[] u2)

Parameters

u1 double[]
u2 double[]

Returns

double[]

Constant(double, int)

Creates a vector of a constant value

public static double[] Constant(double value, int N)

Parameters

value double

constant value of time-series

N int

number of data points of time-series

Returns

double[]

CreateDateStampArray(DateTime, double, int)

Create an array of DateTimes starting at t0 of length N and with sampling interval dT_s

public static DateTime[] CreateDateStampArray(DateTime t0, double dT_s, int N)

Parameters

t0 DateTime

first datetime in the array to be created

dT_s double

sampling interval

N int

number of desired data points

Returns

DateTime[]

Noise(int, double, int?)

Create a white-noise random time-series

public static double[] Noise(int N, double noiseAmplitude, int? seed = null)

Parameters

N int
noiseAmplitude double
seed int?

Returns

double[]

Ramp(int, double, double, int, int)

Create a ramp that starts at startVal and ends at endVal over N

public static double[] Ramp(int nRamp, double startVal, double endVal, int nPadBegin = 0, int nPadEnd = 0)

Parameters

nRamp int

the length in samples of the ramp(first value is startVal and lastVal is endVal)

startVal double
endVal double
nPadBegin int

the number of samples to pad the signal at the beginning with startVal

nPadEnd int

the number of samples to pad the signal at the end with endVal

Returns

double[]

RandomWalk(int, double, double, int?)

Creates a random-walk time-series

public static double[] RandomWalk(int N, double stepAmplitude, double startval = 0, int? seed = null)

Parameters

N int
stepAmplitude double
startval double
seed int?

Returns

double[]

Sinus(double, double, double, int)

Create an array representing a sinus

public static double[] Sinus(double amplitude, double sinusPeriod_s, double dT_s, int N)

Parameters

amplitude double

amplitude of sinus

sinusPeriod_s double

time for a complete 360 degree period of the sinus in seconds

dT_s double

the timebase

N int

number of desired data points in return array

Returns

double[]

an array containing the specified sinus

Step(int, int, double, double)

Create a step change vector of a given length N starting at value val1 and ending at val2, step occuring at index stepStartIdx

public static double[] Step(int stepStartIdx, int N, double val1, double val2)

Parameters

stepStartIdx int

index of step

N int

total time series length

val1 double

value before step

val2 double

value after step

Returns

double[]

created vector, or null if inputs make no sense

ThreeSteps(int, int, int, int, double, double, double, double)

Create a time-series with three step changes

public static double[] ThreeSteps(int step1StartIdx, int step2StartIdx, int step3StartIdx, int N, double val1, double val2, double val3, double val4)

Parameters

step1StartIdx int
step2StartIdx int
step3StartIdx int
N int
val1 double
val2 double
val3 double
val4 double

Returns

double[]

TwoSteps(int, int, int, double, double, double)

Create a time-series with two step changes

public static double[] TwoSteps(int step1StartIdx, int step2StartIdx, int N, double val1, double val2, double val3)

Parameters

step1StartIdx int

index of first step change

step2StartIdx int

index of second step change

N int
val1 double

value before steps

val2 double

value of first step

val3 double

value of second step

Returns

double[]