Function Descriptions
3.1 Complex Fast Fourier Transform
Description:
This module computes a 32-bit floating-point complex FFT including input bit reversing. This
version of the function requires input buffer memory alignment. If you do not wish to align the
input buffer, then use the CFFT_f32u function.
Header File:
FPU.h
Declaration:
void CFFT_f32 (CFFT_F32_STRUCT
*
)
Usage:
A pointer to the following structure is passed to the CFFT_f32 function:
typedef struct {
float32
*
InPtr;
float32
*
OutPtr;
float32
*
CoefPtr;
float32
*
CurrentInPtr;
float32
*
CurrentOutPtr;
Uint16 Stages;
Uint16 FFTSize;
} CFFT_F32_STRUCT;
Table 3.2 describes each element
Alignment Requirements:
The input buffer must be aligned to a multiple of the 2*FFTSize*sizeof(float) i.e. 4*FFTSize.
For example, if the FFTSize is 128 you must align the buffer corresponding to InPtr to 4*128 =
512. An alignment to a smaller value will not work for the 128-pt complex FFT.
To align the input buffer, use the DATA_SECTION pragma to assign the buffer to a code section
and then align the buffer to the proper offset in the linker command file. In this code example
the buffer is assigned to the CFFTin1Buff section.
#define CFFT_STAGES 7
#define CFFT_SIZE (1 << CFFT_STAGES)
//Buffer alignment for the input array,
//CFFT_f32u (optional), CFFT_f32 (required)
//Output of FFT overwrites input if
//CFFT_STAGES is ODD
#pragma DATA_SECTION(CFFTin1Buff,"CFFTdata1");
float CFFTin1Buff[CFFT_SIZE
*
2];
In the project’s linker command file, the CFFTdata1 section is then aligned to a multiple of the
FFTSize as shown below:
CFFTdata1 : > RAML4, PAGE = 1, ALIGN(512)
The buffers referenced by InPtr and OutPtr are used in ping-pong fashion. At the first stage of
the FFT InPtr and CurrentInPtr both point to the input buffer and OutPtr and CurrentOutPtr point
Sep 10, 2012 12