fft_fft_cosine

 

Description

computes the discrete Cosine transform of iSize real data values.

Syntax

int fft_fft_cosine( int iSize, double * vSig )

Parameters

iSize
[input] the number of data values.
vSig
[modify] the original signal to be transformed, and the result of the transform

Return

Returns 0 for success or error codes for failure.

Examples

EX1

//Assume the current Worksheet has 2 columns, the first column 
//contains 8 data. This piece of code computes the discrete 
//Fourier cosine transform of n real data values. The result
//is output into the second column.

#include <..\originlab\fft.h>

void TEST_fft_fft_cosine()
{
    int n= 8, success;
    Worksheet wks = Project.ActiveLayer();
    if(wks)
    {
        Dataset xx(wks, 0);
        Dataset dx(wks, 1);
        dx.SetSize(n);            
    
        vector x = xx;
        success = fft_fft_cosine(n, x);
        //Output the result into the second column.
        dx = x;
    }
}

Remark

See Also

fft_fft_sine

header to Include

fft.h

Reference