Engauge Digitizer 2
|
Fast cross correlation between two functions. More...
#include <Correlation.h>
Public Member Functions | |
Correlation (int N) | |
Single constructor. Slow memory allocations are done once and then reused repeatedly. | |
~Correlation () | |
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. | |
void | correlateWithoutShift (int N, const double function1[], const double function2[], double &corrMax) const |
Return the correlation of the two functions, without any shift. | |
Fast cross correlation between two functions.
We do not use complex.h along with fftw3.h since then the complex numbers will be native, which would then require platform-dependent code
Definition at line 14 of file Correlation.h.
Correlation::Correlation | ( | int | N | ) |
Single constructor. Slow memory allocations are done once and then reused repeatedly.
Definition at line 14 of file Correlation.cpp.
Correlation::~Correlation | ( | ) |
Definition at line 28 of file Correlation.cpp.
void Correlation::correlateWithoutShift | ( | int | N, |
const double | function1[], | ||
const double | function2[], | ||
double & | corrMax ) const |
Return the correlation of the two functions, without any shift.
The functions are normalized internally.
Definition at line 140 of file Correlation.cpp.
void Correlation::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.
The functions are normalized internally. The correlations vector, as a function of shift, is returned for logging
Definition at line 44 of file Correlation.cpp.