2.1.22.2.1.24 fft_fft_coherence


Description

Calculate fft coherence

Syntax

int fft_fft_coherence( int nSize, const double * pSignal1, const double * pSignal2, int nSelect, double * pCoherence, int nWinSize, const double * pWindow, int iFftLen, int nOverlap = 0 )

Parameters

nSize
[input] size of input signal.
pSignal1
[input] input signal1.
pSignal2
[input] input signal2.
nSelect
[input] new size of the coherence
pCoherence
[output] result of coherence
nWinSize
[input] Window Size.
pWindow
[input] window data sequence to be applied
iFftLen
[input] number of paddings (0)
nOverlap
[input] Number of samples by which the sections overlap. The value of nOverlap should be no more than nWinSize.
By default (nOverlap = 0), the number of overlap samples is set to 0.

Return

Return 0 for success.

Examples

EX1

#include <..\OriginLab\fft.h>
void fft_fft_coherence_ex1()
{
    vector vWin(8);
    fftw_create_window_data(8, vWin, HAMMING_WIN);
    
    vector vsig1 = {0, 0, 0, 1, 1, 0, 0, 0};
    vector vsig2 = {1, 1, 0, 0, 0, 0, 1, 1};
    vector vcor(8);
    fft_fft_coherence(8, vsig1, vsig2, 8, vcor, 8, vWin, 8, 0);
}

Remark

See Also

Header to Include

fft.h

Reference