Function Descriptions
Example:
The following sample code obtains the Complex FFT phase.
#include "FPU.h"
#define CFFT_STAGES 7
#define CFFT_SIZE (1 << CFFT_STAGES)
/
*
CFFTin1Buff section to 4
*
FFT_SIZE in the linker file
*
/
#pragma DATA_SECTION(CFFTin1Buff,"CFFTdata1");
float CFFTin1Buff[CFFT_SIZE
*
2];
#pragma DATA_SECTION(CFFTin2Buff,"CFFTdata2");
float CFFTin2Buff[CFFT_SIZE
*
2];
#pragma DATA_SECTION(CFFToutBuff,"CFFTdata3");
float CFFToutBuff[CFFT_SIZE
*
2];
#pragma DATA_SECTION(CFFTF32Coef,"CFFTdata4");
float CFFTF32Coef[CFFT_SIZE];
CFFT_F32_STRUCT cfft;
main()
{
cfft.InPtr = CFFTin1Buff; /
*
Input data buffer
*
/
cfft.OutPtr = CFFToutBuff; /
*
FFT output buffer
*
/
cfft.CoefPtr = CFFTF32Coef; /
*
Twiddle factor buffer
*
/
cfft.FFTSize = CFFT_SIZE; /
*
FFT length
*
/
cfft.Stages = CFFT_STAGES; /
*
FFT Stages
*
/
... ...
CFFT_f32_sincostable(&cfft);/
*
Initialize twiddle
*
/
/
*
buffer
*
/
CFFT_f32(&cfft); /
*
Calculate output
*
/
CFFT_f32_mag(&cfft); /
*
Calculate Magnitude
*
/
cfft.CurrentOutPtr=CFFTin2Buff;/
*
Change output buffer
*
/
CFFT_f32_phase(&cfft); /
*
Calculate phase
*
/
}
Benchmark Information:
The following table provides benchmark numbers for the function. Note that these include the
cycles used in the call/return from the function.
FFTSize C-Callable ASM (Cycle Count)
Standard Runtime Lib Fast Runtime Lib
32 29778 2141
64 63279 4253
128 110368 8477
256 242669 16925
512 485624 33821
1024 1002380 67613
Table 3.8: Benchmark Information
Sep 10, 2012 22