HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CL_CycleDetect.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: CL_CycleDetect.h ( Clip Library, C++)
7  *
8  * COMMENTS:
9  *
10  * Detects the most likely period of a repeating but not quite periodic
11  * waveform.
12  */
13 
14 #ifndef __CL_CycleDetect__
15 #define __CL_CycleDetect__
16 
17 #include "CL_API.h"
18 #include <SYS/SYS_Types.h>
19 
21 {
22 public:
23 
24  CL_CycleDetect(int mincyclelength = 30, int maxcyclelength = 200,
25  int cyclestouse = 2);
26  ~CL_CycleDetect();
27 
28  // returns 1 if a cycle could be found, 0 otherwise.
29  // start/end set to the start and end of one period of the waveform.
30  // start/end should initially be the start and end of the array data (0-n)
31  int determineCycle(const fpreal *data,int &start, int &end,
32  int straightcompare = 0);
33 
34 private:
35 
36  void trimAwaySilence(const fpreal *data,int &start, int &end);
37  void findFlattestRegion(const fpreal *data,int &start, int &end);
38  int findCycle(const fpreal *data, int &start,int &end);
39  void halfCheck(const fpreal *data, int &start, int &end,fpreal prev);
40 
41  int myMaxCycle;
42  int myMinCycle;
43  int myNumCycles;
44 
45 };
46 
47 #endif
GLuint start
Definition: glcorearb.h:474
#define CL_API
Definition: CL_API.h:10
GLuint GLuint end
Definition: glcorearb.h:474
GLboolean * data
Definition: glcorearb.h:130
double fpreal
Definition: SYS_Types.h:263