fft_factor
Description
Set the sign of the Exponential Phase factor for the FFT operation.
Syntax
int fft_factor( vector<complex> & vSignal )
Parameters
- vSignal
- [modify] input:the original signal to be transformed, output: the result of the transform
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_factor_ex1()
{
vector<complex> vSignal = {36, -4 + 9.6569i, -4 + 4i, -4 + 1.6569i,
-4, -4 - 1.6569i, -4 - 4i, -4 - 9.6569i};
int nRet = fft_factor(vSignal);
if( 0 != nRet )
{
printf("fft_factor function returned error: %d\n", nRet);
return;
}
}
//the result should be
//{36, -4 - 9.6569i, -4 -4i, -4 -1.6569i, -4, -4 - 1.6569i, -4 + 4i, -4 + 9.6569i}
Remark
This function is to set the sign of the Exponential Phase factor for the FFT operation.
After the transformation of the function, the phase factor will be of opposite sign,
which means its imaginary components and the phase angle will have opposite signs.
See Also
header to Include
fft_utils.h
Reference
|