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
Returns
- double[]
Constant(double, int)
Creates a vector of a constant value
public static double[] Constant(double value, int N)
Parameters
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
t0DateTimefirst datetime in the array to be created
dT_sdoublesampling interval
Nintnumber 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
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
nRampintthe length in samples of the ramp(first value is startVal and lastVal is endVal)
startValdoubleendValdoublenPadBeginintthe number of samples to pad the signal at the beginning with startVal
nPadEndintthe 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
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
amplitudedoubleamplitude of sinus
sinusPeriod_sdoubletime for a complete 360 degree period of the sinus in seconds
dT_sdoublethe timebase
Nintnumber 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
stepStartIdxintindex of step
Ninttotal time series length
val1doublevalue before step
val2doublevalue after step
Returns
- double[]
created vector, or
nullif 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
step1StartIdxintstep2StartIdxintstep3StartIdxintNintval1doubleval2doubleval3doubleval4double
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
step1StartIdxintindex of first step change
step2StartIdxintindex of second step change
Nintval1doublevalue before steps
val2doublevalue of first step
val3doublevalue of second step
Returns
- double[]