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. | |
| 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.
| 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 131 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.
1.6.1