2.1.22.2.1.34 fft_get_power_hermitian


Description

Caculate the power of a serial of signal sequences which is stored in the input array(vSig). Each signal sequence has the same width. Actually they are the result of FFT transform of a window of source signal as Hermitian-Form.

Syntax

int fft_get_power_hermitian( int iSeqSize, int iNumSeq, double * vSig, double * vResult )

Parameters

iSeqSize
[input] size of a signal sequence
iNumSeq
[input] number of all sequences
vSig
[input] input array contains all the signal sequences
vResult
[output]output array contains all the power sequences.

Return

Returns 0 for success or error codes for failure.

Examples

EX1

//Assume in the current worksheet, the first column is the result of FFT transform of a 
//window of source signal as Hermitian-Form. The signal data contains 20 value, every 5
//represents a fft result of a sequence applied window. And there are 4 sequences in this
//vector. At last the column B will show the result.

#include <..\originlab\fft.h>
Test_fft_get_power_hermitian()
{
    Worksheet wks = Project.ActiveLayer();
    if(wks)
    {
        Dataset dsSig(wks, 0);
        Dataset dsResult(wks, 1);            
    
        vector vecSig, vecResult;
        vecSig = dsSig;
        int nPadWinSize = 5;      // this is the length of sub-sequence of signal 
        int nSteps = 4;              // number of sub-sequence.
        vecResult.SetSize((nPadWinSize/2+1)*nSteps);
    
        int ret = fft_get_power_hermitian(nPadWinSize, nSteps, vecSig, vecResult);
        if (ret !=0 )
            out_str("return error, fail call");
        dsResult = vecResult;
    }
}

Remark

See Also

Header to Include

fft.h

Reference