-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathToolCcf.h
More file actions
77 lines (60 loc) · 2.01 KB
/
ToolCcf.h
File metadata and controls
77 lines (60 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#if !defined(__ACA_Ccf_HEADER_INCLUDED__)
#define __ACA_Ccf_HEADER_INCLUDED__
#pragma once
#include "ErrorDef.h"
// forward declarations
class CFft;
/*! \brief computation of correlation (freq domain implementation)
*/
class CCcf
{
public:
CCcf(void);
virtual ~CCcf(void);
/*! initializes the class with the size of the distance matrix
\param iBlockLength
\return Error_t
*/
Error_t init(int iBlockLength);
/*! resets all internal class members
\return Error_t
*/
Error_t reset();
/*! computes cross correlation function
\param pfIn1 (block of data to be correlated)
\param pfIn2 (block of data to be correlated, equals pfIn1 when ACF)
\param bNormalize flag whether the output is normalized
\return Error_t
*/
Error_t compCcf(const float *pfIn1, const float *pfIn2, bool bNormalize = true);
/*! returns the length of the CCF result
\return int
*/
int getCcfLength(bool bisAcf = false);
/*! returns the correlation result
\param pfCcfResult result buffer
\param bisAcf returns only non-redundant ACF result if true
\return Error_t
*/
Error_t getCcf(float *pfCcfResult, bool bisAcf = false) const;
/*! returns the overall max
\param bisAcf search only non-redundant ACF result if true
\return float
*/
float getCcfMax(bool bisAcf = false) const;
/*! returns the index of the overall max
\param bisAcf search only non-redundant ACF result if true
\return float
*/
int getCcfMaxIdx(bool bisAcf = false) const;
private:
CCcf(const CCcf &that); //!< disallow copy construction
CCcf &operator=(const CCcf &c);
bool m_bIsInitialized = false; //!< true if init has been called
bool m_bWasProcessed = false; //!< true if process has been called
float *m_apfData[2] = { 0,0 }; //!< CCF result
CFft *m_pCFft = 0; //!< FFT instance
int m_iBlockLength = 0; //!< length of input
int m_iFftLength = 0; //!< length of FFT
};
#endif // __ACA_Ccf_HEADER_INCLUDED__