fft_sine

 

Description

Performs nFFT-point discrete Fourier Sine transform. vSig will be padded with zeros if it has less than nFFT points and truncated if it has more.

Syntax

int fft_sine( int nFFT, vector & vSig )

Parameters

nFFT
[input] number of points to do discrete Fourier Sine transform.
vSig
[Modify]data for input, and Fourier sine transforms for output.

Return

Returns OE_NOERROR for success or error codes for failure.

Examples

Prior to compilation, load fft_utils.c to the workspace by executing the following LabTalk command:

Run.LoadOC("Originlab\fft_utils.c", 16);

To retain fft_utils.c in the workspace for successive sessions, drag and drop the file from the Temporary folder to the System folder.

EX1

 
#include <fft_utils.h> 
void fft_sine_ex1()
{
    // This example assumes a worksheet is active with three columns, where
    // column 2 has the signal. Column 3 will be filled with Fourier Sine
    // transform result.
    Worksheet wks = Project.ActiveLayer();
    Dataset dsData(wks, 1);
    Dataset dsFSine(wks, 2);
    // If all datasets are valid, then proceed
    if( dsData && dsFSine )
    {
        vector vec;
        vec = dsData;
        int nSize = vec.GetSize();
        // Perform sine transform with exact size of signal
        int iRet = fft_sine(nSize, vec);
        if(0 != iRet )
        {
            printf("Forward FFT returned error: %d\n", iRet );
            return;
        }
        // Store sine transform result
        dsFSine = vec;
    }
}

Remark

See Also

fft_cosine

header to Include

fft_utils.h

Reference