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

4.1.3 Return<br />

void<br />

4.1.4 Description<br />

The function per<strong>for</strong>ms the initialization procedure <strong>for</strong> the GDFLIB_FilterFIR_F32<br />

function. In particular, the function per<strong>for</strong>ms the following operations:<br />

1. Resets the input buffer index to zero.<br />

2. Initializes the input buffer pointer to the pointer provided as an argument.<br />

3. Resets the input buffer.<br />

After initialization, made by the function, the parameters <strong>and</strong> state structures should be<br />

provided as arguments to calls of the GDFLIB_FilterFIR_F32 function.<br />

Note<br />

The input buffer pointer (State->pInBuf) must point to a Read/<br />

Write memory region, which must be at least the number of the<br />

filter taps long. The number of taps in a filter is equal to the<br />

filter order + 1. There is no restriction as to the location of the<br />

parameters structure as long as it is readable.<br />

CAUTION<br />

No check is per<strong>for</strong>med <strong>for</strong> R/W capability <strong>and</strong> the length of the<br />

input buffer (pState->pInBuf).<br />

4.1.5 Re-entrancy<br />

The function is re-entrant only if the calling code is provided with a distinct instance of<br />

the structure pointed to by pState.<br />

4.1.6 Code Example<br />

#include "gdflib.h"<br />

#define FIR_NUMTAPS 16<br />

#define FIR_NUMTAPS_MAX 64<br />

#define FIR_ORDER (FIR_NUMTAPS - 1)<br />

GDFLIB_FILTERFIR_PARAM_T_F32 Param;<br />

GDFLIB_FILTERFIR_STATE_T_F32 State;<br />

tFrac32 f32InBuf[FIR_NUMTAPS_MAX];<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 />

150 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!