Correlation calculator which utilizes FFT to perform fast correlation calculations. 更多...
#include <BlockCorrelator.h>
Public 成员函数 | |
| void | AutoCorrelate (const AlignedFloatBuffer &Input, AlignedFloatBuffer &Output) |
| Autocorrelate an input signal. 更多... | |
| void | CrossCorrelate (const AlignedFloatBuffer &InputA, const AlignedFloatBuffer &InputB, AlignedFloatBuffer &Output) |
| Cross correlate two input signals. 更多... | |
| FBlockCorrelator (const FBlockCorrelatorSettings &InSettings) | |
| Construct a block correlator with FBlockCorrelatorSettings | |
| int32 | GetNumInputValues () const |
| Returns the number of input values to use when calling CrossCorrelate(...) or AutoCorrelate(...) | |
| int32 | GetNumOutputValues () const |
| Returns the number of output values to use when calling CrossCorrelate(...) or AutoCorrelate(...) | |
| const FBlockCorrelatorSettings & | GetSettings () const |
| Return settings used to construct block correlator. | |
Correlation calculator which utilizes FFT to perform fast correlation calculations.
| void Audio::FBlockCorrelator::AutoCorrelate | ( | const AlignedFloatBuffer & | Input, |
| AlignedFloatBuffer & | Output | ||
| ) |
Autocorrelate an input signal.
The Output array is filled with the autocorrelation of the Input. Care should be taken when interpreting the output as the elements are ordered so that the autocorrelation value of zero lag is in the first element.
AutoCorr[k] = Sum_n(Input[n] * Input[n + k])
Then for M = GetNumInputValues() the Output array contains: Output = [AutoCorr[0], AutoCorr[1], ..., AutoCorr[M-1], AutoCorr[M], AutoCorr[-M + 1], AutoCorr[-M + 2], ..., AutoCorr[-2], AutoCorr[-1]]
| Input | - input block with GetNumInputValues() elements. |
| Output | - Output block with GetNumOutputValues() elements. |
| void Audio::FBlockCorrelator::CrossCorrelate | ( | const AlignedFloatBuffer & | InputA, |
| const AlignedFloatBuffer & | InputB, | ||
| AlignedFloatBuffer & | Output | ||
| ) |
Cross correlate two input signals.
The Output array is filled with the cross correlation between InputA and InputB. Care should be taken when interpreting the output as the elements are ordered so that the cross correlation value of zero lag is in the first element.
CrossCorr[k] = Sum_n(InputA[n] * InputB[n + k])
Then for M = GetNumInputValues() the Output array contains: Output = [CrossCorr[0], CrossCorr[1], ..., CrossCorr[M-1], CrossCorr[M], CrossCorr[-M + 1], CrossCorr[-M + 2], ..., CrossCorr[-2], CrossCorr[-1]]
| InputA | - First input block with GetNumInputValues() elements. |
| InputB | - Second input block with GetNumInputValues() elements. |
| Output | - Output block with GetNumOutputValues() elements. |