quick start:g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_algo.a #include <CorrelationDimension.h> CorrelationDimension(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION, SCALING scaling = DEF_SCALING, float epsilon_min = DEF_EPSILON_MIN, float epsilon_max = DEF_EPSILON_MAX, float epsilon_res = DEF_EPSILON_RES, float delta = DEF_DELTA, long theiler_correction = DEF_THEILER_CORRECTION); boolean eq(const CorrelationDimension& arg) const; boolean compute(VectorFloat& output, const MatrixFloat& input);
description:MatrixFloat input; VectorFloat output; CorrelationDimension cdim; cdim.compute(output, input);
static const String CLASS_NAME = L"CorrelationDimension";
enum ALGORITHM { NORMAL = 0, DEF_ALGORITHM = NORMAL };
enum IMPLEMENTATION { BACKWARD = 0, CENTRAL, SMOOTH, DEF_IMPLEMENTATION = BACKWARD };
enum SCALING { LINSCALE = 0, LOGSCALE, DEF_IMPLEMENTATION = LINSCALE };
static const NameMap CorrelationDimension::ALGO_MAP(L"CORRELATION");
static const NameMap CorrelationDimension::IMPL_MAP(L"BACKWARD, CENTRAL, SMOOTH");
static const NameMap CorrelationDimension::SCAL_MAP(L"LINSCALE, LOGSCALE");
static const String CorrelationDimension::DEF_PARAM = L"";
static const String CorrelationDimension::PARAM_ALGORITHM = L"algorithm";
static const String CorrelationDimension::PARAM_IMPLEMENTATION = L"implementation";
static const String CorrelationDimension::PARAM_SCALING = L"scaling";
static const String Correlation::PARAM_EPSILON_MIN = L"epsilon_min";
static const String Correlation::PARAM_EPSILON_MAX = L"epsilon_max";
static const String Correlation::PARAM_EPSILON_RES = L"epsilon_res";
static const String Correlation::PARAM_DELTA = L"delta";
static const String Correlation::PARAM_THEILER_CORRECTION = L"theiler_correction";
static const AlgorithmData::COEF_TYPE DEF_COEF_TYPE = AlgorithmData::RPS;
static const long ERR = 73900;
static const long ERR_EPSMIN = 73901;
static const long ERR_EPSMAX = 73902;
static const long ERR_EPSRES = 73903;
static const long ERR_EPS = 73904;
static const long ERR_DELTA_EPSMIN = 73905;
static const long ERR_DELTA_EPSMAX = 73906;
ALGORITHM algorithm_d;
IMPLEMENTATION implementation_d;
SCALING scaling_d;
static MemoryManager mgr_d;
static const String& name();
static boolean diagnose(Integral::DEBUG debug_level);
boolean debug(const unichar* message) const;
~CorrelationDimension();
CorrelationDimension(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION, SCALING scaling = DEF_SCALING);
CorrelationDimension(const CorrelationDimension& arg);
boolean assign(const CorrelationDimension& arg);
CorrelationDimension& operator= (const CorrelationDimension& arg);
long sofSize() const;
boolean read(Sof& sof, long tag, const String& name = CLASS_NAME);
boolean write(Sof& sof, long tag, const String& name = CLASS_NAME) const;
boolean readData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);
boolean writeData(Sof& sof, constString& pname = DEF_PARAM) const;
boolean eq(const CorrelationDimension& arg) const;
static void* operator new(size_t size);
static void* operator new[](size_t size);
static void operator delete(void* ptr);
static void operator delete[](void* ptr);
static boolean setGrowSize(long grow_size);
boolean clear(Integral::CMODE ctype = Integral::DEF_CMODE);
boolean setAlgorithm(ALGORITHM algorithm);
boolean setImplementation(IMPLEMENTATION implementation);
boolean setScaling(SCALING scaling);
boolean setEpsilonMin(float epsilon_min);
boolean setEpsilonMax(float epsilon_max);
boolean setEpsilonRes(long epsilon_res);
boolean setDelta(float delta);
boolean setTheilerCorrection(long theiler_correction);
boolean set(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION, SCALING scaling = DEF_SCALING, float epsilon_min = DEF_EPSILON_MIN, float epsilon_max = EPSILON_MAX, long epsilon_res = DEF_EPSILON_RES, float delta = DEF_DELTA, long theiler_correction = DEF_THEILER_CORRECTION);
ALGORITHM getAlgorithm() const;
IMPLEMENTATION getImplementation() const;
SCALING getScaling() const;
float getEpsilonMin() const;
float getEpsilonMax() const;
long getEpsilonRes() const;
float getDelta() const;
float getTheilerCorrection() const;
boolean get(ALGORITHM& algorithm, IMPLEMENTATION& implementation,SCALING& scaling, float& epsilon_min, float& epsilon_max, long& epsilon_res, float& delta, long& theiler_correction) const;
boolean compute(VectorFloat& output, const MatrixFloat& input, AlgorithmData::COEF_TYPE input_coef_type = DEF_COEF_TYPE, long index = DEF_CHANNEL_INDEX);
boolean assign(const AlgorithmBase& arg);
boolean eq(const AlgorithmBase& arg) const;
boolean const String& className() const;
boolean init();
boolean apply(Vector<AlgorithmData>& output, const Vector< CircularBuffer<AlgorithmData> >& input);
boolean setParser(SofParser* parser);
boolean readDataCommon(Sof& sof, const String& pname, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);
boolean writeDataCommon(Sof& sof, const String& pname);
boolean computeCorrDimBackward(VectorFloat& corrdim, const MatrixFloat& rps);
boolean computeCorrDimCentral(VectorFloat& corrdim, const MatrixFloat& rps);
boolean computeCorrDimSmooth(VectorFloat& corrdim, const MatrixFloat& rps);examples:
// declare the CorrelationDimension object // CorrelationDimension cdim; // generate input time series // VectorFloat time_series, dummy; Generator gen1; gen1.set(Generator::LORENTZ); gen1.setSampleFrequency((float)100); gen1.setGenSampleFrequency((float)100); gen1.setSignalDuration(10); gen1.setFrameDuration(10); gen1.compute(time_series, dummy); // reconstruct phase space for the input time series // Long D = 15, svd_window_size = 16; Rps rps_block; MatrixFloat rps_x; rps_block.set(Rps::SVD_EMBEDDING, Rps::EMBEDDING, D, svd_window_size); rps_block.compute(rps_x, time_series); // set all the variables necessary for computing correlation integral // Float epsilon_min = 1, epsilon_max = 200; Long epsilon_res = 40, theiler_correction = 150; Float delta = (float)1; cdim.setImplementation(CorrelationDimension::BACKWARD); cdim.setScaling(CorrelationDimension::LINSCALE); cdim.setEpsilonMin(epsilon_min); cdim.setEpsilonMax(epsilon_max); cdim.setEpsilonRes(epsilon_res); cdim.setTheilerCorrection(theiler_correction); // compute correlation dimension // VectorFloat dimension; cdim.compute(dimension, rps_x); dimension.debug(L"Dimension");
// declare the CorrelationDimension object // CorrelationDimension cdim; // generate input time series // VectorFloat time_series, dummy; Generator gen1; gen1.set(Generator::LORENTZ); gen1.setSampleFrequency((float)100); gen1.setGenSampleFrequency((float)100); gen1.setSignalDuration(10); gen1.setFrameDuration(10); gen1.compute(time_series, dummy); // reconstruct phase space for the input time series // Long D = 15, svd_window_size = 16; Rps rps_block; MatrixFloat rps_x; rps_block.set(Rps::SVD_EMBEDDING, Rps::EMBEDDING, D, svd_window_size); rps_block.compute(rps_x, time_series); // set all the variables necessary for computing correlation integral // Float epsilon_min = 1, epsilon_max = 200; Long epsilon_res = 40, theiler_correction = 150 Float delta = (float) 1; cdim.setImplementation(CorrelationDimension::SMOOTH); cdim.setScaling(CorrelationDimension::LOGSCALE); cdim.setEpsilonMin(epsilon_min); cdim.setEpsilonMax(epsilon_max); cdim.setEpsilonRes(epsilon_res); cdim.setTheilerCorrection(theiler_correction); // compute correlation dimension // VectorFloat dimension; cdim.compute(dimension, rps_x); dimension.debug(L"Dimension");