2.1.22.2.2.4 fft_bandpass


Description

Performs band pass filtering of signal. The filtering is performed by using FFT functions.


Performs band pass filtering of signal. The filtering is performed by using FFT functions.

Syntax

int fft_bandpass( Curve & crvSignal, double dFLow, double dFHigh, bool bAddOffset = true )


int fft_bandpass( vector & vecSignal, double dFLow, double dFHigh, vector * vecTime = NULL, bool bAddOffset = true )

Parameters

crvSignal
[modify] Input: signal data; Output: filtered signal
dFLow
[Input] lower cutoff frequency
dFHigh
[Input] higher cutoff frequency
bAddOffset
[Input] add back DC offset after filtering(true) or not (false).
default is true.


vecSignal
[modify] Input: signal data; Output: filtered signal
dFLow
[Input] lower cutoff frequency
dFHigh
[Input] higher cutoff frequency
vecTime
[Input] frequence sequence of signal. default is NULL.
bAddOffset
[Input] add back DC offset after filtering(true) or not (false).
default is true.

Return

OE_NOERROR: success

positive: FFT error code


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_bandpass_ex1()
{
    double dFLow = 1.0, dFHigh = 6.5;
    vector vecX ;
    vector vecY;
    vecX.Data(1.0,10.0,1.0);
    vecY.Normal(10);
    Curve crvSignal(vecX, vecY);
    int iRet = fft_bandpass(crvSignal, dFLow, dFHigh);
}


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_bandpass_ex2()
{
    double dFLow = 1.0, dFHigh = 6.5;
    vector vecX;
    vector vecY;
    vecX.Data(1.0,10.0,1.0);
    vecY.Normal(10);
    int iRet = fft_bandpass(vecY, dFLow, dFHigh, &vecX);
}

Remark

See Also

fft_bandblock

Header to Include

fft_utils.h

Reference