General Filtering (FIR, IIR) functions.

Functions

static _iq FirFilter (volatile _iq *in, _iq *b, unsigned int n)
static _iq FirFilterV2 (volatile _iq *in, _iq *b, unsigned int n)
static _iq IIRFilter (volatile _iq *in, volatile _iq *out, _iq *b, unsigned int nb, _iq *a, unsigned int na)
static void ShiftRight (volatile _iq *in, unsigned int n)
static void ShiftRightV2 (volatile _iq *in, unsigned int n)
static void Zeros (volatile _iq *v, unsigned int n)
static void MAvrgCoeffs (_iq *b, unsigned int n)

Function Documentation

static _iq FirFilter ( volatile _iq *  in,
_iq *  b,
unsigned int  n 
) [inline, static]

General FIR filter: out[0] = b[0]*in[0] + b[1]*in[1] + ... + b[n]*in[n]

Parameters:
in input vector. Vector MUST have size = n
b input coefficients vector. Vector MUST have size = n
n size of the filter

Definition at line 370 of file FilterAndRotations.h.

static _iq FirFilterV2 ( volatile _iq *  in,
_iq *  b,
unsigned int  n 
) [inline, static]

General FIR filter: out[0] = b[0]*in[0] + b[1]*in[1] + ... + b[n]*in[n]

Parameters:
in input vector. Vector MUST have size = n
b input coefficients vector. Vector MUST have size = n
n size of the filter TODO: test

Definition at line 389 of file FilterAndRotations.h.

static _iq IIRFilter ( volatile _iq *  in,
volatile _iq *  out,
_iq *  b,
unsigned int  nb,
_iq *  a,
unsigned int  na 
) [inline, static]

General IIR filter: out[0] = b[0]*in[0] + ... + b[nb]*in[nb] - (a[0]*out[0] + ... + a[na-1]*out[na])

Parameters:
in input vector. Vector MUST have size = nb
out output vector. After execution, out[0] contains the updated value
b input coefficients vector. Vector MUST have size = nb
nb size of input
a output coefficients vector. Vector MUST have size = na
na size of output

Definition at line 411 of file FilterAndRotations.h.

static void MAvrgCoeffs ( _iq *  b,
unsigned int  n 
) [inline, static]

Initializes Moving Average Coefficients

Parameters:
b coefficients vector. Vector MUST have size = n
n size of the vector

Definition at line 473 of file FilterAndRotations.h.

static void ShiftRight ( volatile _iq *  in,
unsigned int  n 
) [inline, static]

Shift vector right. After execution: in[n-1]=in[n-2],...,in[1]=in[0]

Parameters:
in input vector. Vector MUST have size = n
n size of the vector

Definition at line 426 of file FilterAndRotations.h.

static void ShiftRightV2 ( volatile _iq *  in,
unsigned int  n 
) [inline, static]

Shift vector right. After execution: in[n-1]=in[n-2],...,in[1]=in[0]

Parameters:
in input vector. Vector MUST have size = n
n size of the vector TODO: test

Definition at line 442 of file FilterAndRotations.h.

static void Zeros ( volatile _iq *  v,
unsigned int  n 
) [inline, static]

Initializes vector v components to be zero

Parameters:
v input vector. Vector MUST have size = n
n size of the vector

Definition at line 458 of file FilterAndRotations.h.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Generated on Mon Apr 23 12:59:21 2012 for TIMotorLIB by  doxygen 1.6.3