03.08.2013 Views

Embedded Software and Motor Control Libraries for PXR40xx

Embedded Software and Motor Control Libraries for PXR40xx

Embedded Software and Motor Control Libraries for PXR40xx

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Function GDFLIB_FilterMA_FLT<br />

4.24.2 Arguments<br />

Table 4-24. GDFLIB_FilterMA_FLT arguments<br />

Type Name Direction Description<br />

tFloat fltIn input Value of the input signal to be filtered in step (k). The value is<br />

a single precision floating point data type.<br />

GDFLIB_FILTER_MA_<br />

T_FLT *<br />

4.24.3 Return<br />

pParam input,<br />

output<br />

Pointer to the filter structure with a filter accumulator <strong>and</strong> filter<br />

parameters.<br />

The function returns a single precision floating point value, representing the filtered value<br />

of the input signal in step (k).<br />

4.24.4 Description<br />

This function calculates a recursive <strong>for</strong>m of an average filter. The filter calculation<br />

consists of the following equations:<br />

Equation GDFLIB_FilterMA_Eq2<br />

Equation GDFLIB_FilterMA_Eq3<br />

Equation GDFLIB_FilterMA_Eq4<br />

where x(k) is the actual value of the input signal, acc(k) is the internal filter accumulator,<br />

y(k) is the actual filter output <strong>and</strong> n p is the number of points in the filtered window. The<br />

size of the filter window (number of filtered points) shall be defined prior to this function<br />

<strong>Embedded</strong> <strong>Software</strong> <strong>and</strong> <strong>Motor</strong> <strong>Control</strong> <strong>Libraries</strong> <strong>for</strong> <strong>PXR40xx</strong>, Rev. 1.0<br />

206 Freescale Semiconductor, Inc.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!