HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 
27  // returns 1 if a cycle could be found, 0 otherwise.
28  // start/end set to the start and end of one period of the waveform.
29  // start/end should initially be the start and end of the array data (0-n)
30  int determineCycle(const fpreal *data,int &start, int &end,
31  int straightcompare = 0);
32 
33 private:
34 
35  void trimAwaySilence(const fpreal *data,int &start, int &end);
36  void findFlattestRegion(const fpreal *data,int &start, int &end);
37  int findCycle(const fpreal *data, int &start,int &end);
38  void halfCheck(const fpreal *data, int &start, int &end,fpreal prev);
39 
40  int myMaxCycle;
41  int myMinCycle;
42  int myNumCycles;
43 
44 };
45 
46 #endif
GLuint start
Definition: glcorearb.h:475
#define CL_API
Definition: CL_API.h:10
GLuint GLuint end
Definition: glcorearb.h:475
fpreal64 fpreal
Definition: SYS_Types.h:277
Definition: format.h:895