Engauge Digitizer  2
Public Member Functions | List of all members
Correlation Class Reference

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. More...
 
void correlateWithoutShift (int N, const double function1 [], const double function2 [], double &corrMax) const
 Return the correlation of the two functions, without any shift. More...
 

Detailed Description

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.

Member Function Documentation

◆ correlateWithoutShift()

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.

◆ correlateWithShift()

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.


The documentation for this class was generated from the following files: