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_F32<br />

4.20.2 Arguments<br />

Table 4-20. GDFLIB_FilterMA_F32 arguments<br />

Type Name Direction Description<br />

tFrac32 f32In input Value of input signal to be filtered in step (k). The value is a<br />

32-bit number in the Q1.31 <strong>for</strong>mat.<br />

GDFLIB_FILTER_MA_<br />

T_F32 *<br />

4.20.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 32-bit value in <strong>for</strong>mat Q1.31, representing the filtered value of the<br />

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

4.20.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 />

198 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!