Function Descriptions
Item Description Format Comment
InBuf Input data Pointer to 32-bit float array Not Used.
OutBuf Output buffer Pointer to 32-bit float array Result of RFFT_adc_f32. This buffer
is then used as the input to the magni-
tude and phase calculations. The out-
put order for FFTSize = N is:
OutBuf[0] = real[0]
OutBuf[1] = real[1]
OutBuf[2] = real[2]
...
OutBuf[N/2] = real[N/2]
OutBuf[N/2+1] = imag[N/2-1]
...
OutBuf[N-3] = imag[3]
OutBuf[N-2] = imag[2]
OutBuf[N-1] = imag[1]
CosSinBuf Twiddle factors Pointer to 32-bit float array Calculate using
RFFT_f32_sincostable( ).
FFTSize FFT size Uint16 Must be a power of 2 greater than or
equal to 32.
FFTStages Number of stages Uint16 Stages = log2(FFTSize)
MagBuf Magnitude buffer Pointer to 32-bit float array Output from the magnitude calculation
if the magnitude functions is called.
FFTSize/2 in length.
PhaseBuf Phase buffer Pointer to 32-bit float array Output from the phase calculation if the
phase function is called. FFTSize/2 in
length.
Table 3.15: Elements of the Data Structure RFFT_F32_STRUCT
#define RFFT_STAGES 9
#define RFFT_SIZE (1 << RFFT_STAGES)
//Buffer alignment for the input array,
//RFFT_adc_f32u (optional) RFFT_adc_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(1024)
Notes:
1. If the input buffer is not properly aligned, then the output will be unpredictable.
2. If you do not wish to align the input buffer, then you must use the RFFT_adc_f32u
function which does not have any input buffer alignment requirements. Using
RFFT_adc_f32u will, however, result in a lower cycle performance.
3. All buffers and stack are placed in internal memory (zero-wait states in data space).
Sep 10, 2012 34