undo_fft_shift

 

Description

This function undoes the results of fft_shift.

Syntax

int undo_fft_shift( vector<complex> & vSignal, vector & vFreq = NULL )

Parameters

vSignal
[modify] the original signal data for input, and the result signal for output
vFreq
[modify] the original frequence sequence for input, and the result frequence sequence 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 undo_fft_shift_ex1()
{
    vector<complex> vSignal = {-4-1.6569i, -4-4i, -4-9.6569i,    36, -4+9.6569i, -4+4i, -4+1.6569i, -4};
    vector vFreq = {-3, -2, -1, 0, 1, 2, 3, 4};
    
    //the result should be 
    //vSignal = {36, -4 + 9.6569i, -4 + 4i, -4 + 1.6569i, -4, -4 - 1.6569i, -4 - 4i, -4 - 9.6569i}
    //vFreq = {0, 1, 2, 3, 4, 5, 6, 7}
    int nRet = undo_fft_shift(vSignal, vFreq);    
}

Remark

See Also

header to Include

fft_utils.h

Reference