Microchip® Advanced Software Framework

op_dsp16_fix_sqrt.c File Reference
#include "dsp.h"
#include "preprocessor.h"

Macros

#define DSP16_SQRT_NEWTON_ITERATION(x_num, data)
 
#define DSP16_SQRT_ONE_POINT_FIVE   ((S32) (3 << (DSP16_QB-1)))
 

Functions

dsp16_t dsp16_op_sqrt (dsp16_t num)
 16-bit fixed point version of the square root function. More...
 

#define DSP16_SQRT_NEWTON_ITERATION (   x_num,
  data 
)
Value:
a = ((S32) x)*((S32) x); \
a = (((S32) num)*a) >> (DSP16_QB+1); \
x = (((S32) x)*(DSP16_SQRT_ONE_POINT_FIVE - a)) >> (DSP16_QB);
#define DSP16_SQRT_ONE_POINT_FIVE
Definition: op_dsp16_fix_sqrt.c:46
return a(a%b)
int32_t S32
32-bit signed integer.
Definition: compiler.h:217
#define DSP16_QB
number of fractional bits
Definition: dsp_types.h:137

Referenced by dsp16_op_sqrt().

#define DSP16_SQRT_ONE_POINT_FIVE   ((S32) (3 << (DSP16_QB-1)))