FIR Filter


Detailed Description

FIR Filter functions

See http://dspguru.com/info/faqs/fir/basics.htm

\

Files

Data Structures

Defines

Typedefs

Functions


Define Documentation

#define FIR_FILTER_DEFINE _name,
_log2size   ) 
 

Defines a new filter variable

Parameters:
_name Name of filter
_log2size Size of filter as log2 of actual size
Use &_name.filter

Example:

 #define myAverageLog2Size 3

 FIR_FILTER_DEFINE(myAverage,myAverageLog2Size);
 
 FIR_Filter_Init(&myAverage.filter,myAverageLog2Size);


Typedef Documentation

typedef uint8_t FIR_FilterSize_t
 

Size (number of taps) of a FIR filter.

typedef int16_t FIR_FilterSample_t
 

Sample.

typedef int8_t FIR_FilterCoefficient_t
 

Coefficient.

typedef int32_t FIR_FilterAcculatedSum_t
 

Accumlated sum to avoid overrun this must be able to hold.


Function Documentation

void FIR_Filter_Init FIR_Filter_t filter_p,
const FIR_FilterSize_t  log2size
 

Inits a FIR filter structure

Parameters:
filter_p Pointer to filter structure
log2size log2 of the size of the filter. Log2 is used to get fast circular buffer, the position can be masked by single &= instruction.

FIR_FilterSample_t FIR_Filter_BoxCar_Input FIR_Filter_t filter_p,
const FIR_FilterSample_t  sample
 

Inputs a sample to the filter using a BOXCAR coefficient table (all ones)

FIR_FilterSample_t FIR_Filter_GetNormalizedSum const FIR_Filter_t *const  filter_p  ) 
 

Returns the normalized sum of the filter. (Sum / taps * max_cooeffcient)


Copyright 2002 Jörgen Birkler. For accelR8 Accelerometer on Mon Jan 19 21:43:20 2004 by Doxygen 1.3.5.