33.3 Differences Between Wrapper Functions and dsPIC® DSP Library

The PIC32 DSP wrapper function names, input parameters and return parameters use the sames as their counterparts in the dsPIC DSP library; however, these are some functional differences:

The number of coefficients in filter (filter->numCoeffs) must be larger than or equal to 4 and multiple of 4.

Table 33-1. Differences in Wrapper Functions
PIC32 DSP Wrapper Function Name Differences with Corresponding Function of dsPIC® DSP Library General Comments Regarding PIC32 DSP Library
FIR (int numSamps, short int* dstSamps, short int* srcSamps, FIRStruct* filter) Some of the parameters of the structure FIRStruct are not necessary for PIC32 library function. Hence, it is not necessary to initialize these parameters before the FIR function is called. These parameters are namely:

filter->coeffsEnd,

filter -> coeffsPage,

filter->delay End,

filter->delay
Number of coefficients in filter (filter->numCoeffs) must be larger than or equal to 4 and multiple of 4.
TwidFactorInit16 (int log2N, fractcomplex16* twidFactors, int conjFlag)

TwidFactorInit32 (int log2N, fractcomplex32* twidFactors, int conjFlag)

There is a provision in the TwidFactorInit function of dsPIC library, either to generate or not generate a complex conjugates of twiddles. It is controlled by flag conjFlag. There is no such facility in the PIC32 DSP library. Both TwidFactorInit16 and TwidFactorInit32 in PIC32 do not generate a complex conjugate of twiddles. However, the parameter is kept in the function prototype of TwidFactorInit of PIC32 to make it compatible with dsPIC.
Note:
  1. PIC32 supports both 16-bit and 32-bit vector math operations.
  2. The current version of PIC32 DSP wrapper functions does not support floating-point calculations.
  3. For all the vector math operations, the number of samples must be larger than or equal to 4 or multiple of 4.
  4. log2N must be larger than or equal to 3 for function FFTComplex16 and FFTComplex32.
  5. All the source and destination pointers used for math operations must be aligned on 4-byte boundaries.
  6. The include file for these DSP wrapper functions is <mchp_dsp_wrapper.h>.