Engauge Digitizer
2
Toggle main menu visibility
Loading...
Searching...
No Matches
Correlation
Correlation.h
Go to the documentation of this file.
1
/******************************************************************************************************
2
* (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3
* under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4
* LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5
******************************************************************************************************/
6
7
#ifndef CORRELATION_H
8
#define CORRELATION_H
9
10
#include "fftw3.h"
11
14
class
Correlation
15
{
16
public
:
18
Correlation
(
int
N);
19
~Correlation
();
20
23
void
correlateWithShift
(
int
N,
24
const
double
function1 [],
25
const
double
function2 [],
26
int
&binStartMax,
27
double
&corrMax,
28
double
correlations [])
const
;
29
32
void
correlateWithoutShift
(
int
N,
33
const
double
function1 [],
34
const
double
function2 [],
35
double
&corrMax)
const
;
36
37
private
:
38
Correlation
();
39
40
int
m_N;
41
42
fftw_complex *m_signalA;
43
fftw_complex *m_signalB;
44
fftw_complex *m_outShifted;
45
fftw_complex *m_outA;
46
fftw_complex *m_outB;
47
fftw_complex *m_out;
48
49
fftw_plan m_planA;
50
fftw_plan m_planB;
51
fftw_plan m_planX;
52
};
53
54
#endif
// CORRELATION_H
Correlation::correlateWithoutShift
void correlateWithoutShift(int N, const double function1[], const double function2[], double &corrMax) const
Return the correlation of the two functions, without any shift.
Definition
Correlation.cpp:140
Correlation::~Correlation
~Correlation()
Definition
Correlation.cpp:28
Correlation::Correlation
Correlation(int N)
Single constructor. Slow memory allocations are done once and then reused repeatedly.
Definition
Correlation.cpp:14
Correlation::correlateWithShift
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:44
Generated on
for Engauge Digitizer by
1.17.0