2.1.22.2.2.12 fft_threshold


Description

Performs threshold filtering of the signal. All components below the specified threshold amplitude in the frequency spectrum of the signal are removed. The filtering is performed by using FFT functions.

Syntax

int fft_threshold( Curve & crvSignal, double dThreshold )


int fft_threshold( vector & vecSignal, double dThreshold, vector * vecTime = NULL )

Parameters

crvSignal
[modify] Input: signal data; Output: filtered signal
dThreshold
[input] threshold value; must be greater than 0


vecSignal
[modify] Input: signal data; Output: filtered signal
dThreshold
[input] threshold value; must be greater than 0
vecTime
[input] frequence sequence of signal. default is NULL.

Return

OE_NOERROR: success

positive: FFT error code

Examples

EX1

//Before compile this example, run the following LabTalk command in Command Window:
// 		run.LoadOC("Originlab\fft_utils.c", 16);
 
#include <fft_utils.h> 
void fft_threshold_ex1()
{
    vector vecX ;
    vector vecY;
    vecX.Data(1.0, 10.0, 1.0);
    vecY.Normal(10);
    Curve crv(vecX, vecY);
    int iRet = fft_threshold(crv, 0.1);
}


EX2

//Before compile this example, run the following LabTalk command in Command Window:
// 		run.LoadOC("Originlab\fft_utils.c", 16);
 
#include <fft_utils.h> 
void fft_threshold_ex2()
{
    vector vecX ;
    vector vecY;
    vecX.Data(1.0, 10.0, 1.0);
    vecY.Normal(10);
    int iRet = fft_threshold(vecY, 0.1, &vecX);
}

Remark

See Also

Header to Include

fft_utils.h

Reference