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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.14.2 Arguments<br />

Table 4-14. GDFLIB_FilterIIR2_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 1.31 fractional <strong>for</strong>mat.<br />

GDFLIB_FILTER_IIR2_<br />

T_F32 *const<br />

4.14.3 Return<br />

pParam input,<br />

output<br />

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

parameters.<br />

The function returns a 32-bit value in fractional <strong>for</strong>mat 1.31, representing the filtered<br />

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

4.14.4 Description<br />

This function calculates the second order infinite impulse (IIR) filter. The IIR filters are<br />

also called recursive filters because both the input <strong>and</strong> the previously calculated output<br />

values are used <strong>for</strong> calculation of the filter equation in each step. This <strong>for</strong>m of feedback<br />

enables transfer of the energy from the output to the input, which theoretically leads to an<br />

infinitely long impulse response (IIR).<br />

A general <strong>for</strong>m of the IIR filter expressed as a transfer function in the Z-domain is<br />

described as follows:<br />

Equation GDFLIB_FilterIIR2_Eq1<br />

where N denotes the filter order. The second order IIR filter in the Z-domain is there<strong>for</strong>e<br />

given from eq. GDFLIB_FilterIIR2_Eq1 as:<br />

Equation GDFLIB_FilterIIR2_Eq2<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 />

Chapter 4 API References<br />

Freescale Semiconductor, Inc. 183

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

Saved successfully!

Ooh no, something went wrong!