CFFT

Computes the forward or inverse fast Fourier transform (FFT) of a complex signal.

Syntax

Intel IPP style:

IppStatus ippsqFFT_BitRev_32fc_I (Ipp32fc* pSrcDst, Ipp32u length);

IppStatus ippsqFFT_BitRev_16sc_I (Ipp16sc* pSrcDst, Ipp32u length);

IppStatus ippsqFFT_CToC_Direct_32fc_I (Ipp32fc* pSrcDst, Ipp32u length, Ipp8u invFlag, Ipp8u bitReverseFlag);

IppStatus ippsqFFT_CToC_Direct_16sc_I (Ipp16sc* pSrcDst, Ipp32u length, Ipp8u invFlag, Ipp8u bitReverseFlag);

IppStatus ippsqFFT_CToC_Direct_32sc_I (Ipp32sc* pSrcDst, Ipp32u length, Ipp8u invFlag, Ipp8u bitReverseFlag);

typedef struct {
    Ipp16u        fftLen;
    const Ipp32f *pTwiddle;
    const Ipp16u *pBitRevTable;
    Ipp16u        bitRevLength;
} IppsqFFTSpec_32f;

IppStatus ippsqFFTInit_32f (IppsqFFTSpec_32f* pSpec, Ipp32u length, Ipp8u* pBuffer);

IppStatus ippsqFFT_CToC_32fc_I (Ipp32fc* pSrcDst, Ipp8u invFlag, Ipp8u bitReverseFlag, IppsqFFTSpec_32f *pSpec);

typedef struct {
    Ipp16u        fftLen;
    const Ipp16s *pTwiddle;
    const Ipp16u *pBitRevTable;
    Ipp16u        bitRevLength;
} IppsqFFTSpec_16s;

IppStatus ippsqFFTInit_16s (IppsqFFTSpec_16s* pSpec, Ipp32u length, Ipp8u* pBuffer);

IppStatus ippsqFFT_CToC_16sc_I (Ipp16sc* pSrcDst, Ipp8u invFlag, Ipp8u bitReverseFlag, IppsqFFTSpec_16s *pSpec);

typedef struct {
    Ipp16u        fftLen;
    const Ipp32s *pTwiddle;
    const Ipp16u *pBitRevTable;
    Ipp16u        bitRevLength;
} IppsqFFTSpec_32s;

IppStatus ippsqFFTInit_32s (IppsqFFTSpec_32s* pSpec, Ipp32u length, Ipp8u* pBuffer);

IppStatus ippsqFFT_CToC_32sc_I (Ipp32sc* pSrcDst, Ipp8u invFlag, Ipp8u bitReverseFlag, IppsqFFTSpec_32s *pSpec);

DSP style:

typedef struct {
    Ipp16u        fftLen;
    const Ipp32f *pTwiddle;
    const Ipp16u *pBitRevTable;
    Ipp16u        bitRevLength;
} ippsq_cfft_instance_f32;

void ippsq_cfft_init_f32 (ippsq_cfft_instance_f32 *S, uint16_t fftLen, uint8_t* pBuffer);

void ippsq_cfft_f32 (const ippsq_cfft_instance_f32 *S, float32_t *p1, uint8_t ifftFlag, uint8_t bitReverseFlag);

typedef struct {
    Ipp16u        fftLen;
    const Ipp16s *pTwiddle;
    const Ipp16u *pBitRevTable;
    Ipp16u        bitRevLength;
} ippsq_cfft_instance_q15;

void ippsq_cfft_init_q15 (ippsq_cfft_instance_q15 *S, uint16_t fftLen, uint8_t* pBuffer);

void ippsq_cfft_q15 (const ippsq_cfft_instance_q15 *S, q15_t *p1, uint8_t ifftFlag, uint8_t bitReverseFlag);

typedef struct {
    Ipp16u        fftLen;
    const Ipp32s *pTwiddle;
    const Ipp16u *pBitRevTable;
    Ipp16u        bitRevLength;
} ippsq_cfft_instance_q31;

void ippsq_cfft_init_q31 (ippsq_cfft_instance_q31 *S, uint16_t fftLen, uint8_t* pBuffer);

void ippsq_cfft_q31 (const ippsq_cfft_instance_q31 *S, q31_t *p1, uint8_t ifftFlag, uint8_t bitReverseFlag);

Include Files

ippsq.h

dsp.h

Parameters

pSrcDst, p1

Pointer to the input and output array containing complex values.

length, fftLen

Number of the source/destination vector elements. The value must be a power of 2.

inv, ifftFlag

Inverse FFT flag. To compute the inverse FFT, set this parameter to any value not equal to zero.

bitReverseFlag

Bit reverse flag. To perform the bit reverse operation, set this parameter to any value not equal to zero.

pBuffer

External buffer to store initialization data.

pTwiddle

Pointer to the external buffer.

pBitRevTable

Unused pointer.

bitRevLength

Unused value.

Description

This function computes the forward or inverse fast Fourier transform (FFT) of a complex signal. To compute the inverse FFT, set the inv (ifftFlag for DSP) parameter to any value not equal to zero.

Before using the ippsqFFT_CToC_32fc_I, ippsqFFT_CToC_32sc_I, ippsqFFT_CToC_16sc_I, ippsq_cfft_f32, ippsq_cfft_q15, and ippsq_cfft_q31 functions, you need to perform initialization. These functions are faster than the corresponding functions with the _Direct suffix, and require additional external buffer to store sine table. The following table provides required buffer size for each function:

Function Buffer Size

ippsqFFT_CToC_32fc_I

ippsq_cfft_f32

sizeof(Ipp32f) * fftLen / 4

ippsqFFT_CToC_16sc_I

ippsq_cfft_q15

sizeof(Ipp16s) * fftLen / 4

ippsqFFT_CToC_32sc_I

ippsq_cfft_q31

sizeof(Ipp32s) * fftLen / 4

Intel IPP style: When using Intel IPP-style APIs with the _Direct suffix, you do not need to call any initialization functions. Intel IPP-style functions directly get all necessary parameters as arguments.

DSP style: Each function type (f32, q15, and q31) has its own state structure, initialize the fftLen field of the structure with the corresponding FFT length value, which must be a power of 2.

To perform the bit reverse operation, set the bitReverseFlag parameter to any value not equal to zero. The bit reverse operation is performed on the output of the direct or inverse Fourier transform.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when any of the specified pointers is NULL.
For more complete information about compiler optimizations, see our Optimization Notice.