CSI-DSP  Version 1.0.0
CSI DSP Software Library
Functions
Complex FFT Functions

Functions

void csky_fft_lib_cx16_fft (q31_t log2_buf_len, q15_t *in_buf, q15_t *out_buf, const q15_t *twi_table, const uint16_t *bitrev_tbl, q15_t *temp_buf, q7_t *ScaleShift, q31_t br)
 Processing function for the Q15 complex FFT. More...
 
void csky_fft_lib_cx32_fft (q31_t log2_buf_len, q31_t *in_buf, q31_t *out_buf, const q31_t *twi_table, const uint16_t *bitrev_tbl, q31_t *temp_buf, q31_t br)
 Processing function for the Q31 complex FFT. More...
 
void csky_fft_lib_cx16_ifft (q31_t log2_buf_len, q15_t *in_buf, q15_t *out_buf, const q15_t *twi_table, const uint16_t *bitrev_tbl, q15_t *temp_buf, q7_t *ScaleShift, q31_t br)
 Processing function for the Q15 complex inverse FFT. More...
 
void csky_fft_lib_cx32_ifft (q31_t log2_buf_len, q31_t *in_buf, q31_t *out_buf, const q31_t *twi_table, const uint16_t *bitrev_tbl, q31_t *temp_buf, q31_t br)
 Processing function for the Q31 complex inverse FFT. More...
 

Description

Brief Introduction
Only Q15 and Q31 data is designed in this library. The FFT functions operate in-place as the original ones. The input data is complex and contains 2*fftLen interleaved values as shown below.
 {real[0], imag[0], real[1], imag[1],..} 
The FFT result will be contained in the same array and the frequency domain values will have the same interleaving. Unlike the Original Method the forward transform, the inverse transform are seperated, so the ifftFlaga is not needed.
Algorithm
For the lengths of [64, 256, 1024], the algorithm is the combination of multiple radix-4 stages. While, for the lengths of [32, 128, 512], the algorithm is multiple radix-4 stages along with a single radix-2 stage.
The function uses the standard FFT definition, the inverse transform includes a scale of 1/fftLen, which realized by multiply 1/2 at every stage. And this matches the textbook definition of the inverse FFT.
Initialization
Different from the Original Method , there is no initialization needed among this library. All the parameters and constants are passed to each function straightforwardly.

Function Documentation

void csky_fft_lib_cx16_fft ( q31_t  log2_buf_len,
q15_t in_buf,
q15_t out_buf,
const q15_t twi_table,
const uint16_t *  bitrev_tbl,
q15_t temp_buf,
q7_t ScaleShift,
q31_t  br 
)
Parameters
[in]log_buf_lenlog2 value of FFT size, the FFT size N is (1<<log2_buf_len)
[in,out]*in_bufpoint to the input and output memory
[in]*out_bufnot used
[in]*twi_tablepoint to the twi table
[in]*bitrev_tblpoint to the bit reversal table
[in]*temp_bufnot used
[in]*ScaleShiftnot used
[in]brbit reversal flag, always set
Returns
none.
Note
The time domin data and the frequency domain data are all in Q15 format, the forward transform is easy to overflow. So care to use it to avoid overflow.
void csky_fft_lib_cx16_ifft ( q31_t  log2_buf_len,
q15_t in_buf,
q15_t out_buf,
const q15_t twi_table,
const uint16_t *  bitrev_tbl,
q15_t temp_buf,
q7_t ScaleShift,
q31_t  br 
)
Parameters
[in]log_buf_lenlog2 value of FFT size, the FFT size N is (1<<log2_buf_len)
[in,out]*in_bufpoint to the input and output memory
[in]*out_bufnot used
[in]*twi_tablepoint to the twi table
[in]*bitrev_tblpoint to the bit reversal table
[in]*temp_bufnot used
[in]*ScaleShiftnot used
[in]brbit reversal flag, always set
Returns
none.
void csky_fft_lib_cx32_fft ( q31_t  log2_buf_len,
q31_t in_buf,
q31_t out_buf,
const q31_t twi_table,
const uint16_t *  bitrev_tbl,
q31_t temp_buf,
q31_t  br 
)
Parameters
[in]log_buf_lenlog2 value of FFT size, the FFT size N is (1<<log2_buf_len)
[in,out]*in_bufpoint to the input and output memory
[in]*out_bufnot used
[in]*twi_tablepoint to the twi table
[in]*bitrev_tblpoint to the bit reversal table
[in]*temp_bufnot used
[in]brbit reversal flag, always set
Returns
none.
Note
The time domin data and the frequency domain data are all in Q31 format, the forward transform is easy to overflow. So care to use it to avoid overflow.
void csky_fft_lib_cx32_ifft ( q31_t  log2_buf_len,
q31_t in_buf,
q31_t out_buf,
const q31_t twi_table,
const uint16_t *  bitrev_tbl,
q31_t temp_buf,
q31_t  br 
)
Parameters
[in]log_buf_lenlog2 value of FFT size, the FFT size N is (1<<log2_buf_len)
[in,out]*in_bufpoint to the input and output memory
[in]*out_bufnot used
[in]*twi_tablepoint to the twi table
[in]*bitrev_tblpoint to the bit reversal table
[in]*temp_bufnot used
[in]brbit reversal flag, always set
Returns
none.