Engauge Digitizer  2
 All Classes Files Functions Variables Enumerations Enumerator Friends Pages
Correlation.h
1 #ifndef CORRELATION_H
2 #define CORRELATION_H
3 
4 #include "fftw3.h"
5 
9 {
10 public:
12  Correlation(int N);
13  ~Correlation();
14 
17  void correlateWithShift (int N,
18  const double function1 [],
19  const double function2 [],
20  int &binStartMax,
21  double &corrMax,
22  double correlations []) const;
23 
26  void correlateWithoutShift (int N,
27  const double function1 [],
28  const double function2 [],
29  double &corrMax) const;
30 
31 private:
32  Correlation();
33 
34  int m_N;
35 
36  fftw_complex *m_signalA;
37  fftw_complex *m_signalB;
38  fftw_complex *m_outShifted;
39  fftw_complex *m_outA;
40  fftw_complex *m_outB;
41  fftw_complex *m_out;
42 
43  fftw_plan m_planA;
44  fftw_plan m_planB;
45  fftw_plan m_planX;
46 };
47 
48 #endif // CORRELATION_H
Fast cross correlation between two functions.
Definition: Correlation.h:8
void correlateWithShift(int N, const double function1[], const double function2[], int &binStartMax, double &corrMax, double correlations[]) const
Return the shift in function1 that best aligns that function with function2.
Definition: Correlation.cpp:38
void correlateWithoutShift(int N, const double function1[], const double function2[], double &corrMax) const
Return the correlation of the two functions, without any shift.