Logo
MSP DSP Library
Support

Data Structures

struct  msp_cmplx_bitrev_q15_params
 Parameter structure for Q15 complex bit-reversal. More...
 
struct  msp_cmplx_bitrev_iq31_params
 Parameter structure for IQ31 complex bit-reversal. More...
 
struct  msp_split_q15_params
 Parameter structure for Q15 split operation. More...
 
struct  msp_split_iq31_params
 Parameter structure for IQ31 split operation. More...
 

Macros

#define MSP_ALIGN_FFT_Q15(n)   (n*2)
 Calculate the alignment for a 16-bit real FFT from length parameter.
 
#define MSP_ALIGN_FFT_IQ31(n)   (n*4)
 Calculate the alignment for a 32-bit real FFT from length parameter.
 
#define MSP_ALIGN_CMPLX_FFT_Q15(n)   (n*4)
 Calculate the alignment for a 16-bit complex FFT from length parameter.
 
#define MSP_ALIGN_CMPLX_FFT_IQ31(n)   (n*8)
 Calculate the alignment for a 32-bit complex FFT from length parameter.
 

Functions

msp_status msp_cmplx_bitrev_q15 (const msp_cmplx_bitrev_q15_params *params, int16_t *src)
 Complex bit-reversal function. More...
 
msp_status msp_cmplx_bitrev_iq31 (const msp_cmplx_bitrev_iq31_params *params, int32_t *src)
 Complex bit-reversal function. More...
 
msp_status msp_split_q15 (const msp_split_q15_params *params, int16_t *src)
 Split operation for performing the final step of a real FFT. More...
 
msp_status msp_split_iq31 (const msp_split_iq31_params *params, int32_t *src)
 Split operation for performing the final step of a real FFT. More...
 

Detailed Description

Support functions used for real and complex FFT functions. These functions do not need to be called outside of DSPLib.

Function Documentation

msp_status msp_cmplx_bitrev_iq31 ( const msp_cmplx_bitrev_iq31_params params,
int32_t *  src 
)

Complex bit-reversal function.

Details
Inputs to the real and complex fft functions need to be in bit reversed order before the result can be computed. The DSPLib fft functions contain a parameter to perform the bit reversal and this API does not need to be invoked directly. Alternatively the application can store input in bit reversed order and skip this step although it may be more efficient to store in linear order using pointer increment or DMA copy and performing the bit reversal all at once.
Pseudo code
y = bitrevorder(x)
LEA Support
This function is supported by LEA and requires data to be placed into shared LEA memory with 4-byte alignment.
Parameters
paramsPointer to the complex bit-reversal parameter structure.
srcPointer to the complex data array to perform the bit-reversal on.
Returns
Status of the operation.
msp_status msp_cmplx_bitrev_q15 ( const msp_cmplx_bitrev_q15_params params,
int16_t *  src 
)

Complex bit-reversal function.

Details
Inputs to the real and complex fft functions need to be in bit reversed order before the result can be computed. The DSPLib fft functions contain a parameter to perform the bit reversal and this API does not need to be invoked directly. Alternatively the application can store input in bit reversed order and skip this step although it may be more efficient to store in linear order using pointer increment or DMA copy and performing the bit reversal all at once.
Pseudo code
y = bitrevorder(x)
LEA Support
This function is supported by LEA and requires data to be placed into shared LEA memory with 4-byte alignment.
Parameters
paramsPointer to the complex bit-reversal parameter structure.
srcPointer to the complex data array to perform the bit-reversal on.
Returns
Status of the operation.
msp_status msp_split_iq31 ( const msp_split_iq31_params params,
int32_t *  src 
)

Split operation for performing the final step of a real FFT.

Details
Performs the final stage of a discreet Fourier transform (DFT) of real inputs. First a complex FFT of size length/2 with must be performed before this function can be called. The DSPLib real fft functions invoke this function directly and this API does not need to be called directly from the application.
Pseudo code
G(k) = 0.5*(X(k) + X*(N-k)) - 0.5*j*(e^-j2*pi*k/2N)*(X(k) - X*(N-k))
LEA Support
This function is supported by LEA and requires data to be placed into shared LEA memory with alignment equal to four times the data length (e.g. a 256-point real FFT requires 1024-byte alignment). When allocating data the MSP_ALIGN_FFT_IQ31 macro can be used to calculate correct alignment. The twiddle table pointer parameter is not used with LEA and can be null or uninitialized.
Parameters
paramsPointer to the split parameter structure.
srcPointer to the data array to perform the split operation on.
Returns
Status of the operation.
msp_status msp_split_q15 ( const msp_split_q15_params params,
int16_t *  src 
)

Split operation for performing the final step of a real FFT.

Details
Performs the final stage of a discreet Fourier transform (DFT) of real inputs. First a complex FFT of size length/2 with must be performed before this function can be called. The DSPLib real fft functions invoke this function directly and this API does not need to be called directly from the application.
Pseudo code
G(k) = 0.5*(X(k) + X*(N-k)) - 0.5*j*(e^-j2*pi*k/2N)*(X(k) - X*(N-k))
LEA Support
This function is supported by LEA and requires data to be placed into shared LEA memory with alignment equal to twice the data length (e.g. a 256-point real FFT requires 512-byte alignment). When allocating data the MSP_ALIGN_FFT_Q15 macro can be used to calculate correct alignment. The twiddle table pointer parameter is not used with LEA and can be null or uninitialized.
Parameters
paramsPointer to the split parameter structure.
srcPointer to the data array to perform the split operation on.
Returns
Status of the operation.