Logo
MSP DSP Library
Common

Macros

#define DSPLIB_TABLE_OFFSET   2
 Offset used to store table size.
 
#define CMPLX_INCREMENT   (2)
 Increment size for complex data.
 
#define CMPLX_REAL(ptr)   ((ptr)[0])
 Access the real portion of complex data.
 
#define CMPLX_IMAG(ptr)   ((ptr)[1])
 Access the imaginary portion of complex data.
 
#define _Q15(A)   ((_q15)((A) * ((uint32_t)1 << 15)))
 Convert number to Q15 fixed point.
 
#define _IQ31(A)   ((_iq31)((A) * ((uint32_t)1 << 31)))
 Convert number to IQ31 fixed point.
 
#define __saturate(x, min, max)   (((x)>(max))?(max):(((x)<(min))?(min):(x)))
 Saturate input to minimum or maximum value and return value.
 
#define DSPLIB_DATA(var, align)
 Place data with alignment, when LEASC is used data is placed into the shared RAM section.
 
#define __q15mpy(A, B)   ((int16_t)(((int32_t)(A) * (int32_t)(B)) >> 15))
 Real Q15 multiply with result returned.
 
#define __q31mpy(A, B)   ((int32_t)(((int64_t)(A) * (int64_t)(B)) >> 31))
 Real IQ31 multiply with result returned.
 
#define __q15iq31mpy(A, B)   ((int32_t)(((int64_t)(A) * (int64_t)(B)) >> 15))
 Real Q15 by IQ31 multiply with result returned.
 

Detailed Description

This file provides common definitions, useful conversion macros and abstracted functions to support the core DSPLib functions. While not all macros and functions in this file are useful outside of DSPLib the main application can use any of them as needed.