Function Descriptions
3.16 Finite Impulse Response Filter
Description:
This routine implements the non-recursive difference equation of an all-zero filter (FIR), of
order N. All the coefficients of all-zero filter are assumed to be less than 1 in magnitude.
Header File:
FPU.h
Declaration:
void FIR_FP_calc(FIR_FP_handle)
Usage:
A pointer to the following structure is passed to the FIR_f32 function:
typedef struct {
float
*
coeff_ptr;
float
*
dbuffer_ptr;
int cbindex;
int order;
float input;
float output;
void (
*
init)(void
*
);
void (
*
calc)(void
*
);
}FIR_FP;
Table 3.21 describes each element
Item Description Format Comment
coeff_ptr Pointer to Filter coefficient Pointer to 32-bit float array Place the coefficients in a section (e.g.
“coeffilt”) aligned to 2x number of coef-
ficients
dbuffer_ptr Delay buffer ptr Pointer to 32-bit float array Place the Delay in a section (e.g.
“firldb”) aligned to an even number of
words
cbindex Circular Buffer Index Uint16 Index to the delay buffer
order Order of the Filter Uint16 Order is number of coefficients minus
one
input Latest Input sample 32-bit float can be assigned to an ADC input
output Filter Output 32-bit float
*init Pointer to Init funtion n/a Points to FIR_FP_init
*calc Pointer to calc funtion n/a Points to FIR_FP_calc
Table 3.21: Elements of the Data Structure
Sep 10, 2012 46