00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __CL_CycleDetect__
00023 #define __CL_CycleDetect__
00024
00025 #include "CL_API.h"
00026
00027 class CL_API CL_CycleDetect
00028 {
00029 public:
00030
00031 CL_CycleDetect(int mincyclelength = 30, int maxcyclelength = 200,
00032 int cyclestouse = 2);
00033 ~CL_CycleDetect();
00034
00035
00036
00037
00038 int determineCycle(const float *data,int &start, int &end,
00039 int straightcompare = 0);
00040
00041 private:
00042
00043 void trimAwaySilence(const float *data,int &start, int &end);
00044 void findFlattestRegion(const float *data,int &start, int &end);
00045 int findCycle(const float *data, int &start,int &end);
00046 void halfCheck(const float *data, int &start, int &end,float prev);
00047
00048 int myMaxCycle;
00049 int myMinCycle;
00050 int myNumCycles;
00051
00052 };
00053
00054 #endif