Function Descriptions
3.8 Real Fast Fourier Transform
Description:
This module computes a 32-bit floating-point real 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 RFFT_f32u function.
Header File:
FPU.h
Declaration:
void RFFT_f32 (RFFT_F32_STRUCT
*
)
Usage:
A pointer to the following structure is passed to the RFFT_f32 function:
typedef struct {
float32
*
InBuf;
float32
*
OutBuf;
float32
*
CosSinBuf;
float32
*
MagBuf;
float32
*
PhaseBuf;
Uint16 FFTSize;
Uint16 FFTStages;
} RFFT_F32_STRUCT;
Table 3.11 describes each element.
Alignment Requirements:
The input buffer must be aligned to a multiple of the 2*FFTSize. For example, if the FFTSize is
256 you must align the buffer corresponding to InBuf to 2*256 = 512. A smaller alignment will
not work for a 256 RFFT.
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 INBUF section.
#define RFFT_STAGES 8
#define RFFT_SIZE (1 << RFFT_STAGES)
//Buffer alignment for the input array,
//RFFT_f32u (optional), RFFT_f32 (required)
//Output of FFT overwrites input if
//RFFT_STAGES is ODD
#pragma DATA_SECTION(RFFTin1Buff,"RFFTdata1");
float32 RFFTin1Buff[RFFT_SIZE];
In the project’s linker command file, the RFFTdata1 section is then aligned to a multiple of the
FFTSize as shown below:
RFFTdata1 : > RAML4, PAGE = 1, ALIGN(512)
Sep 10, 2012 28