spLib
|
Data Structures | |
class | spFFTRec |
A class to handle FFT execution. More... | |
Typedefs | |
typedef struct _spFFTRec * | spFFTRec |
FFT Execution (<sp/fft.h>) | |
int | spfftf (float *xRe, float *xIm, long fftl, int inv) |
int | spfft (double *xRe, double *xIm, long fftl, int inv) |
int | sprfftf (float *data, long fftl, int inv) |
int | sprfft (double *data, long fftl, int inv) |
Data Shift for FFT (<sp/fft.h>) | |
void | datashifts (short *data, long length, long shift) |
void | datashiftl (long *data, long length, long shift) |
void | datashiftf (float *data, long length, long shift) |
void | datashift (double *data, long length, long shift) |
void | ridatashifts (short *real, short *imag, long length, long shift) |
void | ridatashiftl (long *real, long *imag, long length, long shift) |
void | ridatashiftf (float *real, float *imag, long length, long shift) |
void | ridatashift (double *real, double *imag, long length, long shift) |
void | circshifts (short *data, long length, long shift) |
void | circshiftl (long *data, long length, long shift) |
void | circshiftf (float *data, long length, long shift) |
void | circshift (double *data, long length, long shift) |
void | ricircshifts (short *real, short *imag, long length, long shift) |
void | ricircshiftl (long *real, long *imag, long length, long shift) |
void | ricircshiftf (float *real, float *imag, long length, long shift) |
void | ricircshift (double *real, double *imag, long length, long shift) |
void | fftturnf (float *xRe, float *xIm, long fftl) |
void | fftturn (double *xRe, double *xIm, long fftl) |
void | fftshiftf (float *xRe, float *xIm, long fftl) |
void | fftshift (double *xRe, double *xIm, long fftl) |
FFT Execution with FFT Plugin (<sp/fft.h>) | |
int | spGetNumFFTPlugin (void) |
char * | xspSearchFFTPluginFile (int *index) |
spBool | spSetDefaultFFTPlugin (const char *name) |
spBool | spIsFFTPlugin (spPlugin *plugin) |
spPlugin * | spLoadFFTPlugin (const char *name) |
spBool | spFreeFFTPlugin (spPlugin *plugin) |
spFFTSpeed | spGetFFTSpeed (spFFTPrecision precision) |
spFFTRec | spInitBatchedFFTByPlugin (spPlugin *plugin, long order, long batch, spFFTPrecision precision) |
spFFTRec | spInitBatchedFFT (long order, long batch, spFFTPrecision precision) |
spFFTRec | spInitFFTByPlugin (spPlugin *plugin, long order, spFFTPrecision precision) |
spFFTRec | spInitFFT (long order, spFFTPrecision precision) |
spBool | spFreeFFT (spFFTRec fftrec) |
spBool | spResetFFTOrder (spFFTRec fftrec, long order) |
long | spGetFFTOrder (spFFTRec fftrec) |
long | spGetFFTLength (spFFTRec fftrec) |
long | spGetFFTBatch (spFFTRec fftrec) |
spBool | spExecFFTF (spFFTRec fftrec, float *real, float *imag, int inv) |
spBool | spExecFFT (spFFTRec fftrec, double *real, double *imag, int inv) |
spBool | spExecRealFFTF (spFFTRec fftrec, float *data, int inv) |
spBool | spExecRealFFT (spFFTRec fftrec, double *data, int inv) |
spBool | spExecFFTPowerF (spFFTRec fftrec, float *data, float exponent) |
spBool | spExecFFTPower (spFFTRec fftrec, double *data, double exponent) |
#define spFFTSpeed spComputeSpeed |
Indicates speed of FFT computation.
#define SP_FFT_HIGHEST_PRECISION SP_HIGHEST_PRECISION |
Highest precision.
#define SP_FFT_HIGH_DOUBLE_PRECISION SP_HIGH_DOUBLE_PRECISION |
Double type precision higher than normal double type.
#define SP_FFT_DOUBLE_PRECISION SP_DOUBLE_PRECISION |
double type precision.
#define SP_FFT_LOW_DOUBLE_PRECISION SP_LOW_DOUBLE_PRECISION |
double type precision lower than normal double type
#define SP_FFT_HIGH_FLOAT_PRECISION SP_HIGH_FLOAT_PRECISION |
float type precision higher than normal double type.
#define SP_FFT_FLOAT_PRECISION SP_FLOAT_PRECISION |
float type precision.
#define SP_FFT_LOW_FLOAT_PRECISION SP_LOW_FLOAT_PRECISION |
float type precision lower than normal float type
#define SP_FFT_32BIT_PRECISION SP_32BIT_PRECISION |
32-bit integer precision.
#define SP_FFT_24BIT_PRECISION SP_24BIT_PRECISION |
24-bit integer precision.
#define SP_FFT_16BIT_PRECISION SP_16BIT_PRECISION |
16-bit integer precision.
#define SP_FFT_IGNORE_PRECISION SP_IGNORE_PRECISION |
Indicates that precision is ignored.
#define SP_FFT_UNKNOWN_PRECISION SP_UNKNOWN_PRECISION |
Unknown precision.
#define SP_FFT_DEFAULT_PRECISION SP_FFT_FLOAT_PRECISION |
Default precision.
#define SP_FFT_SPEED_EXTREMELY_FAST SP_COMPUTE_SPEED_EXTREMELY_FAST |
Extremely fast speed.
#define SP_FFT_SPEED_VERY_FAST SP_COMPUTE_SPEED_VERY_FAST |
Very fast speed.
#define SP_FFT_SPEED_FASTER SP_COMPUTE_SPEED_FASTER |
Faster speed.
#define SP_FFT_SPEED_FAST SP_COMPUTE_SPEED_FAST |
Fast speed.
#define SP_FFT_SPEED_NORMAL SP_COMPUTE_SPEED_NORMAL |
Normal speed.
#define SP_FFT_SPEED_SLOW SP_COMPUTE_SPEED_SLOW |
Slow speed.
#define SP_FFT_SPEED_SLOWER SP_COMPUTE_SPEED_SLOWER |
Slower speed.
#define SP_FFT_SPEED_VERY_SLOW SP_COMPUTE_SPEED_VERY_SLOW |
Very slow speed.
#define SP_FFT_SPEED_EXTREMELY_SLOW SP_COMPUTE_SPEED_EXTREMELY_SLOW |
Extremely slow speed.
#define SP_FFT_SPEED_UNKNOWN SP_COMPUTE_SPEED_UNKNOWN |
Unknown speed.
typedef struct _spFFTRec* spFFTRec |
Definition of spFFTRec.
|
extern |
Executes FFT of input data.
[in] | xRe | The real part buffer of the data. The size of this buffer must be larger than fftl . |
[in] | xIm | The imaginary part buffer of the data. The size of this buffer must be larger than fftl . |
[in] | fftl | The number of FFT points. |
[in] | inv | Nonzero value enables execution of the inverse FFT. |
SP_SUCCESS | Success |
SP_FAILURE | Failure |
|
extern |
Executes FFT of input data.
[in] | xRe | The real part buffer of the data. The size of this buffer must be larger than fftl . |
[in] | xIm | The imaginary part buffer of the data. The size of this buffer must be larger than fftl . |
[in] | fftl | The number of FFT points. |
[in] | inv | Nonzero value enables execution of the inverse FFT. |
SP_SUCCESS | Success |
SP_FAILURE | Failure |
|
extern |
Executes FFT of input real data.
[in] | data | The buffer of the data. The size of this buffer must be larger than fftl . After FFT execution, data holds data[0]=Re(X[0]) , data[1]=Re(X[fftl/2]) , data[2*n]=Re(X[n]) , and data[2*n+1]=Im(X[n]) (n > 0, n < fftl/2), where X[n] is the complex spectrum. In other words, even elements except the index 0 and odd elements except the index 1 hold the real part and the imaginary part of the complex spectrum, respectively. |
[in] | fftl | The number of FFT points. |
[in] | inv | Nonzero value enables execution of the inverse FFT. |
SP_SUCCESS | Success |
SP_FAILURE | Failure |
|
extern |
Executes FFT of input real data.
[in] | data | The buffer of the data. The size of this buffer must be larger than fftl . After FFT execution, data holds data[0]=Re(X[0]) , data[1]=Re(X[fftl/2]) , data[2*n]=Re(X[n]) , and data[2*n+1]=Im(X[n]) (n > 0, n < fftl/2), where X[n] is the complex spectrum. In other words, even elements except the index 0 and odd elements except the index 1 hold the real part and the imaginary part of the complex spectrum, respectively. |
[in] | fftl | The number of FFT points. |
[in] | inv | Nonzero value enables execution of the inverse FFT. |
SP_SUCCESS | Success |
SP_FAILURE | Failure |
|
extern |
Shifts input data. The pushed out data by shifting is discarded.
[in] | data | The buffer containing input data. The input data is replaced with shifted data. |
[in] | length | The size of data . |
[in] | shift | The shift length. Positive and negative values indicate shift to left and right respectively. |
|
extern |
Shifts input data. The pushed out data by shifting is discarded.
[in] | data | The buffer containing input data. The input data is replaced with shifted data. |
[in] | length | The size of data . |
[in] | shift | The shift length. Positive and negative values indicate shift to left and right respectively. |
|
extern |
Shifts input data. The pushed out data by shifting is discarded.
[in] | data | The buffer containing input data. The input data is replaced with shifted data. |
[in] | length | The size of data . |
[in] | shift | The shift length. Positive and negative values indicate shift to left and right respectively. |
|
extern |
Shifts input data. The pushed out data by shifting is discarded.
[in] | data | The buffer containing input data. The input data is replaced with shifted data. |
[in] | length | The size of data . |
[in] | shift | The shift length. Positive and negative values indicate shift to left and right respectively. |
|
extern |
Shifts input complex data. The pushed out data by shifting is discarded.
[in] | real | The buffer containing input real data. The input data is replaced with shifted data. |
[in] | imag | The buffer containing input imaginary data. The input data is replaced with shifted data. |
[in] | length | The size of input data. |
[in] | shift | The shift length. Positive and negative values indicate shift to left and right respectively. |
|
extern |
Shifts input complex data. The pushed out data by shifting is discarded.
[in] | real | The buffer containing input real data. The input data is replaced with shifted data. |
[in] | imag | The buffer containing input imaginary data. The input data is replaced with shifted data. |
[in] | length | The size of input data. |
[in] | shift | The shift length. Positive and negative values indicate shift to left and right respectively. |
|
extern |
Shifts input complex data. The pushed out data by shifting is discarded.
[in] | real | The buffer containing input real data. The input data is replaced with shifted data. |
[in] | imag | The buffer containing input imaginary data. The input data is replaced with shifted data. |
[in] | length | The size of input data. |
[in] | shift | The shift length. Positive and negative values indicate shift to left and right respectively. |
|
extern |
Shifts input complex data. The pushed out data by shifting is discarded.
[in] | real | The buffer containing input real data. The input data is replaced with shifted data. |
[in] | imag | The buffer containing input imaginary data. The input data is replaced with shifted data. |
[in] | length | The size of input data. |
[in] | shift | The shift length. Positive and negative values indicate shift to left and right respectively. |
|
extern |
Circular-shifts input data.
[in] | data | The buffer containing input data. The input data is replaced with shifted data. |
[in] | length | The size of input data. |
[in] | shift | The shift length. Positive and negative values indicate shift to left and right respectively. |
|
extern |
Circular-shifts input data.
[in] | data | The buffer containing input data. The input data is replaced with shifted data. |
[in] | length | The size of input data. |
[in] | shift | The shift length. Positive and negative values indicate shift to left and right respectively. |
|
extern |
Circular-shifts input data.
[in] | data | The buffer containing input data. The input data is replaced with shifted data. |
[in] | length | The size of input data. |
[in] | shift | The shift length. Positive and negative values indicate shift to left and right respectively. |
|
extern |
Circular-shifts input data.
[in] | data | The buffer containing input data. The input data is replaced with shifted data. |
[in] | length | The size of input data. |
[in] | shift | The shift length. Positive and negative values indicate shift to left and right respectively. |
|
extern |
Circular-shifts input complex data.
[in] | real | The buffer containing input real data. The input data is replaced with shifted data. |
[in] | imag | The buffer containing input imaginary data. The input data is replaced with shifted data. |
[in] | length | The size of input data. |
[in] | shift | The shift length. Positive and negative values indicate shift to left and right respectively. |
|
extern |
Circular-shifts input complex data.
[in] | real | The buffer containing input real data. The input data is replaced with shifted data. |
[in] | imag | The buffer containing input imaginary data. The input data is replaced with shifted data. |
[in] | length | The size of input data. |
[in] | shift | The shift length. Positive and negative values indicate shift to left and right respectively. |
|
extern |
Circular-shifts input complex data.
[in] | real | The buffer containing input real data. The input data is replaced with shifted data. |
[in] | imag | The buffer containing input imaginary data. The input data is replaced with shifted data. |
[in] | length | The size of input data. |
[in] | shift | The shift length. Positive and negative values indicate shift to left and right respectively. |
|
extern |
Circular-shifts input complex data.
[in] | real | The buffer containing input real data. The input data is replaced with shifted data. |
[in] | imag | The buffer containing input imaginary data. The input data is replaced with shifted data. |
[in] | length | The size of input data. |
[in] | shift | The shift length. Positive and negative values indicate shift to left and right respectively. |
|
extern |
Makes the real part of the spectrum reflection symmetric and the imaginary part rotational symmetric with respect to the index fftl/2
. The right half data is not used for computation.
[in] | xRe | The buffer of the real part of input data. The right half data is overwritten. |
[in] | xIm | The buffer of the imaginary part of input data. The right half data is overwritten. If you don't use the immaginary part, NULL can be specified. |
[in] | fftl | The number of FFT points. The buffer size must be larger than this value. |
|
extern |
Makes the real part of the spectrum reflection symmetric and the imaginary part rotational symmetric with respect to the index fftl/2
. The right half data is not used for computation.
[in] | xRe | The buffer of the real part of input data. The right half data is overwritten. |
[in] | xIm | The buffer of the imaginary part of input data. The right half data is overwritten. If you don't use the immaginary part, NULL can be specified. |
[in] | fftl | The number of FFT points. The buffer size must be larger than this value. |
|
extern |
Circular-shifts input data so that the index fftl/2
of the buffer moves to the index 0
.
[in] | xRe | The buffer of the real part of input data. The input data is replaced with shifted data. |
[in] | xIm | The buffer of the imaginary part of input data. The input data is replaced with shifted data. |
[in] | fftl | The number of FFT points. The buffer size must be larger than this value. |
|
extern |
Circular-shifts input data so that the index fftl/2
of the buffer moves to the index 0
.
[in] | xRe | The buffer of the real part of input data. The input data is replaced with shifted data. |
[in] | xIm | The buffer of the imaginary part of input data. The input data is replaced with shifted data. |
[in] | fftl | The number of FFT points. The buffer size must be larger than this value. |
|
extern |
Gets the number of FFT plugins available.
|
extern |
Finds the name of an FFT plugin registered.
[in] | index | The address of a variable which holds the index to find. The index of the first call must be 0. After the function call, the value of the variable will be the index of the FFT plugin obtained. |
|
extern |
Sets the specified FFT plugin default.
[in] | name | A null-terminated string of the name of an FFT plugin. |
SP_TRUE | Success |
SP_FALSE | Failure |
Checks if the plugin is an FFT plugin.
[in] | plugin | spPlugin type pointer to check. |
SP_TRUE | Success |
SP_FALSE | Failure |
|
extern |
Loads an FFT plugin.
[in] | name | The name of the FFT plugin. |
Unloads the FFT plugin.
[in] | plugin | The loaded FFT plugin obtained by spLoadFFTPlugin() . |
SP_TRUE | Success |
SP_FALSE | Failure |
|
extern |
Gets speed of the default FFT engine. This function doesn't get speed of the plugin-based FFT engine if the plugin-based FFT is set to default.
[in] | precision | The precision of the FFT engine to get speed in spFFTPrecision type. |
|
extern |
Initializes resources for plugin-based FFT inside spFFTRec. The return value can be used for FFT-related functions such as spExecFFT() and spExecRealFFT() . The difference from spInitFFTByPlugin() is that a single FFT call executes multiple FFTs of the batch count in parallel. The buffer for spExecFFT() or spExecRealFFT() contains a series of vectors of the batch count.
[in] | plugin | The FFT plugin used as FFT engine. |
[in] | order | The order (the power of 2) of FFT points. For example, 8 for the FFT points of 256. |
[in] | batch | The batch count. |
[in] | precision | The precision of FFT engine such as SP_FFT_DEFAULT_PRECISION , SP_FFT_DOUBLE_PRECISION , SP_FFT_FLOAT_PRECISION and so on. Normally, SP_FFT_DEFAULT_PRECISION is recommended. Higher precision can make FFT execution slow on some environments. |
|
extern |
Initializes resources for FFT inside spFFTRec. The return value can be used for FFT-related functions such as spExecFFT() and spExecRealFFT() . The difference from spInitFFT() is that a single FFT call executes multiple FFTs of the batch count in parallel. The buffer for spExecFFT() or spExecRealFFT() contains a series of vectors of the batch count.
[in] | order | The order (the power of 2) of FFT points. For example, 8 for the FFT points of 256. |
[in] | batch | The batch count. |
[in] | precision | The precision of FFT engine such as SP_FFT_DEFAULT_PRECISION , SP_FFT_DOUBLE_PRECISION , SP_FFT_FLOAT_PRECISION and so on. Normally, SP_FFT_DEFAULT_PRECISION is recommended. Higher precision can make FFT execution slow on some environments. |
Initializes resources for plugin-based FFT inside spFFTRec. The return value can be used for FFT-related functions such as spExecFFT() and spExecRealFFT() .
[in] | plugin | The FFT plugin used as FFT engine. |
[in] | order | The order (the power of 2) of FFT points. For example, 8 for the FFT points of 256. |
[in] | precision | The precision of FFT engine such as SP_FFT_DEFAULT_PRECISION , SP_FFT_DOUBLE_PRECISION , SP_FFT_FLOAT_PRECISION and so on. Normally, SP_FFT_DEFAULT_PRECISION is recommended. Higher precision can make FFT execution slow on some environments. |
|
extern |
Initializes resources for FFT inside spFFTRec. The return value can be used for FFT-related functions such as spExecFFT() and spExecRealFFT() .
[in] | order | The order (the power of 2) of FFT points. For example, 8 for the FFT points of 256. |
[in] | precision | The precision of FFT engine such as SP_FFT_DEFAULT_PRECISION , SP_FFT_DOUBLE_PRECISION , SP_FFT_FLOAT_PRECISION and so on. Normally, SP_FFT_DEFAULT_PRECISION is recommended. Higher precision can make FFT execution slow on some environments. |
Frees the resources inside spFFTRec for FFT execution.
[in] | fftrec | spFFTRec type variable obtained by spInitFFT() or similar functions. |
SP_TRUE | Success |
SP_FALSE | Failure |
Resets the order of FFT. The buffer length must be larger than the length of 2 to the order-th power.
[in] | fftrec | spFFTRec type variable obtained by spInitFFT() or similar functions. |
[in] | order | The order (the power of 2) of FFT points. For example, 8 for the FFT points of 256. |
SP_TRUE | Success |
SP_FALSE | Failure |
|
extern |
Gets the order (the power of 2) of FFT points.
[in] | fftrec | spFFTRec type variable obtained by spInitFFT() or similar functions. |
|
extern |
Gets the number of FFT points.
[in] | fftrec | spFFTRec type variable obtained by spInitFFT() or similar functions. |
|
extern |
Gets the batch size.
[in] | fftrec | spFFTRec type variable obtained by spInitBatchedFFT() or spInitBatchedFFTByPlugin() . |
Executes FFT of input data with an FFT plugin.
[in] | fftrec | spFFTRec type variable obtained by spInitFFT() or similar functions. |
[in] | real | The real part buffer of the data. The size of this buffer must be larger than the number of FFT points. |
[in] | imag | The imaginary part buffer of the data. The size of this buffer must be larger than the number of FFT points. |
[in] | inv | Nonzero value enables execution of the inverse FFT. |
SP_TRUE | Success |
SP_FALSE | Failure |
Executes FFT of input data with an FFT plugin.
[in] | fftrec | spFFTRec type variable obtained by spInitFFT() or similar functions. |
[in] | real | The real part buffer of the data. The size of this buffer must be larger than the number of FFT points. |
[in] | imag | The imaginary part buffer of the data. The size of this buffer must be larger than the number of FFT points. |
[in] | inv | Nonzero value enables execution of the inverse FFT. |
SP_TRUE | Success |
SP_FALSE | Failure |
Executes FFT of input real data with an FFT plugin.
[in] | fftrec | spFFTRec type variable obtained by spInitFFT() or similar functions. |
[in] | data | The buffer of the data. The size of this buffer must be larger than the number of FFT points. After FFT execution, data holds data[0]=Re(X[0]) , data[1]=Re(X[fftl/2]) , data[2*n]=Re(X[n]) , and data[2*n+1]=Im(X[n]) (n > 0, n < fftl/2), where X[n] is the complex spectrum. In other words, even elements except the index 0 and odd elements except the index 1 hold the real part and the imaginary part of the complex spectrum, respectively. |
[in] | inv | Nonzero value enables execution of the inverse FFT. |
SP_TRUE | Success |
SP_FALSE | Failure |
Executes FFT of input real data with an FFT plugin.
[in] | fftrec | spFFTRec type variable obtained by spInitFFT() or similar functions. |
[in] | data | The buffer of the data. The size of this buffer must be larger than the number of FFT points. After FFT execution, data holds data[0]=Re(X[0]) , data[1]=Re(X[fftl/2]) , data[2*n]=Re(X[n]) , and data[2*n+1]=Im(X[n]) (n > 0, n < fftl/2), where X[n] is the complex spectrum. In other words, even elements except the index 0 and odd elements except the index 1 hold the real part and the imaginary part of the complex spectrum, respectively. |
[in] | inv | Nonzero value enables execution of the inverse FFT. |
SP_TRUE | Success |
SP_FALSE | Failure |
Calculates a power spectrum of input data with an FFT plugin.
[in] | fftrec | spFFTRec type variable obtained by spInitFFT() or similar functions. |
[in] | data | The buffer containing input data. The size of this buffer must be larger than the number of FFT points. After the function call, the buffer is replaced by the power spectrum calculated. |
[in] | exponent | The exponent value to a power spectrum. For example, 1.0 and 0.5 correspond to the power spectrum and the amplitude spectrum, respectively. |
SP_TRUE | Success |
SP_FALSE | Failure |
Calculates a power spectrum of input data with an FFT plugin.
[in] | fftrec | spFFTRec type variable obtained by spInitFFT() or similar functions. |
[in] | data | The buffer containing input data. The size of this buffer must be larger than the number of FFT points. After the function call, the buffer is replaced by the power spectrum calculated. |
[in] | exponent | The exponent value to a power spectrum. For example, 1.0 and 0.5 correspond to the power spectrum and the amplitude spectrum, respectively. |
SP_TRUE | Success |
SP_FALSE | Failure |