2.1.22.2.1.27 fft_fft_correlation


Description

calculates the circular correlation of two real vectors of period iSize.

Syntax

int fft_fft_correlation( int iSize, double * vSig1, double * vSig2 )

Parameters

iSize
[input] the number of data values.
vSig1
[modify] one sequences of period iSize for input, and the corresponding elements of the discrete correlation for output.
vSig2
[modify] the other sequences of period iSize for input, and the discrete Fourier transform of the correlation for output.

Return

Returns 0 for success or error codes for failure.

Examples

EX1

//Assume the current Worksheet has 4 columns, the first two columns contain 2 sets of real
//data values. This piece of code computes the circular correlation of two real vectors.
//The result is output into the third column, and it's Fourier transform is in the
//fourth column.

#include <..\originlab\fft.h>    
void TEST_fft_fft_correlation()
{
    int n=8, success;
    
    Worksheet wks = Project.ActiveLayer();
    if(wks)
    {
        Dataset xx(wks, 0);
        Dataset yy(wks, 1);
        Dataset aa(wks, 2);
        Dataset bb(wks, 3);
        
        vector x = xx;
        vector y = yy;
        
        success = fft_fft_correlation(n, x, y);
        aa = x;
        bb = y;
    }
}

Remark

See Also

Header to Include

fft.h

Reference