Function Descriptions
Example:
The following sample code obtains the FFT magnitude.
include "FPU.h"
#define RFFT_STAGES 8
#define RFFT_SIZE (1 << RFFT_STAGES)
/
*
RFFTin1Buff section to 2
*
FFT_SIZE in the linker file
*
/
#pragma DATA_SECTION(RFFTin1Buff,"RFFTdata1");
float32 RFFTin1Buff[RFFT_SIZE];
#pragma DATA_SECTION(RFFToutBuff,"RFFTdata2");
float32 RFFToutBuff[RFFT_SIZE];
#pragma DATA_SECTION(RFFTmagBuff,"RFFTdata3");
float32 RFFTmagBuff[RFFT_SIZE/2+1];
#pragma DATA_SECTION(RFFTF32Coef,"RFFTdata4");
float32 RFFTF32Coef[RFFT_SIZE];
RFFT_F32_STRUCT rfft;
main()
{
rfft.FFTSize = RFFT_SIZE;
rfft.FFTStages = RFFT_STAGES;
rfft.InBuf = &RFFTin1Buff[0]; /
*
Input buffer
*
/
rfft.OutBuf = &RFFToutBuff[0]; /
*
Output buffer
*
/
rfft.CosSinBuf = &RFFTF32Coef[0]; /
*
Twiddle factor buffer
*
/
rfft.MagBuf = &RFFTmagBuff[0]; /
*
Magnitude buffer
*
/
RFFT_f32_sincostable(&rfft); /
*
Calculate twiddle factor
*
/
RFFT_f32(&rfft); /
*
Calculate output
*
/
RFFT_f32_mag(&rfft) /
*
Calculate magnitude
*
/
}
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 1324 694
64 2654 1382
128 5342 2758
256 10718 5510
512 21470 11014
1024 42974 22022
2048 85982 44038
Table 3.18: Benchmark Information
Sep 10, 2012 39