MotorWare f2806x Module API Documentation

- Main Page
- Modules
- Data Structures
- Files

Data Structures | Typedefs | Functions
FILTER_FO

## Data Structures
struct | _FILTER_FO_
| Defines the first-order filter (FILTER_FO) object. More...
struct | _FILTER_FO_Obj_
| Defines the first-order filter (FILTER_FO) object. More...

## Typedefs
typedef struct _FILTER_FO_ | FILTER_FO_Obj
| Defines the first-order filter (FILTER_FO) object. More...
typedef struct _FILTER_FO_Obj_ * | FILTER_FO_Handle
| Defines the first-order filter (FILTER_FO) handle. More...
typedef struct _FILTER_FO_Obj_ | FILTER_FO_Obj
| Defines the first-order filter (FILTER_FO) object. More...
typedef struct _FILTER_FO_Obj_ * | FILTER_FO_Handle
| Defines the first-order filter (FILTER_FO) handle. More...

## Functions
static _iq | FILTER_FO_get_a1 (FILTER_FO_Handle handle)
| Gets the first-order filter denominator coefficient a1. More...
static _iq | FILTER_FO_get_b0 (FILTER_FO_Handle handle)
| Gets the first-order filter numerator coefficient b0. More...
static _iq | FILTER_FO_get_b1 (FILTER_FO_Handle handle)
| Gets the first-order filter numerator coefficient b1. More...
static _iq | FILTER_FO_get_x1 (FILTER_FO_Handle handle)
| Gets the first-order filter input value at time sample n=-1. More...
static _iq | FILTER_FO_get_y1 (FILTER_FO_Handle handle)
| Gets the first-order filter output value at time sample n=-1. More...
void | FILTER_FO_getDenCoeffs (FILTER_FO_Handle handle, _iq *pa1)
| Gets the first-order filter denominator coefficients. More...
void | FILTER_FO_getInitialConditions (FILTER_FO_Handle handle, _iq *px1, _iq *py1)
| Gets the initial conditions of the first-order filter. More...
void | FILTER_FO_getNumCoeffs (FILTER_FO_Handle handle, _iq *pb0, _iq *pb1)
| Gets the first-order filter numerator coefficients. More...
FILTER_FO_Handle | FILTER_FO_init (void *pMemory, const size_t numBytes)
| Initializes the first-order filter. More...
static _iq | FILTER_FO_run (FILTER_FO_Handle handle, const _iq inputValue)
| Runs a first-order filter of the form y[n] = b0*x[n] + b1*x[n-1] - a1*y[n-1]. More...
static _iq | FILTER_FO_run_form_0 (FILTER_FO_Handle handle, const _iq inputValue)
| Runs a first-order filter of the form y[n] = b0*x[n] - a1*y[n-1]. More...
static void | FILTER_FO_set_a1 (FILTER_FO_Handle handle, const _iq a1)
| Sets the first-order filter denominator coefficient a1. More...
static void | FILTER_FO_set_b0 (FILTER_FO_Handle handle, const _iq b0)
| Sets the first-order filter numerator coefficient b0. More...
static void | FILTER_FO_set_b1 (FILTER_FO_Handle handle, const _iq b1)
| Sets the first-order filter numerator coefficient b1. More...
static void | FILTER_FO_set_x1 (FILTER_FO_Handle handle, const _iq x1)
| Sets the first-order filter input value at time sample n=-1. More...
static void | FILTER_FO_set_y1 (FILTER_FO_Handle handle, const _iq y1)
| Sets the first-order filter output value at time sample n=-1. More...
void | FILTER_FO_setDenCoeffs (FILTER_FO_Handle handle, const _iq a1)
| Sets the first-order filter denominator coefficients. More...
void | FILTER_FO_setInitialConditions (FILTER_FO_Handle handle, const _iq x1, const _iq y1)
| Sets the initial conditions of the first-order filter. More...
void | FILTER_FO_setNumCoeffs (FILTER_FO_Handle handle, const _iq b0, const _iq b1)
| Sets the first-order filter numerator coefficients. More...
void | FILTER_FO_getDenCoeffs (FILTER_FO_Handle handle, float_t *pa1)
| Gets the first-order filter denominator coefficients. More...
void | FILTER_FO_getInitialConditions (FILTER_FO_Handle handle, float_t *px1, float_t *py1)
| Gets the initial conditions of the first-order filter. More...
void | FILTER_FO_getNumCoeffs (FILTER_FO_Handle handle, float_t *pb0, float_t *pb1)
| Gets the first-order filter numerator coefficients. More...
static float_t | FILTER_FO_run (FILTER_FO_Handle handle, const float_t inputValue)
| Runs a first-order filter of the form y[n] = b0*x[n] + b1*x[n-1] - a1*y[n-1]. More...
static float_t | FILTER_FO_run_form_0 (FILTER_FO_Handle handle, const float_t inputValue)
| Runs a first-order filter of the form y[n] = b0*x[n] - a1*y[n-1]. More...
static void | FILTER_FO_set_a1 (FILTER_FO_Handle handle, const float_t a1)
| Sets the first-order filter denominator coefficient a1. More...
static void | FILTER_FO_set_b0 (FILTER_FO_Handle handle, const float_t b0)
| Sets the first-order filter numerator coefficient b0. More...
static void | FILTER_FO_set_b1 (FILTER_FO_Handle handle, const float_t b1)
| Sets the first-order filter numerator coefficient b1. More...
static void | FILTER_FO_set_x1 (FILTER_FO_Handle handle, const float_t x1)
| Sets the first-order filter input value at time sample n=-1. More...
static void | FILTER_FO_set_y1 (FILTER_FO_Handle handle, const float_t y1)
| Sets the first-order filter output value at time sample n=-1. More...
void | FILTER_FO_setDenCoeffs (FILTER_FO_Handle handle, const float_t a1)
| Sets the first-order filter denominator coefficients. More...
void | FILTER_FO_setInitialConditions (FILTER_FO_Handle handle, const float_t x1, const float_t y1)
| Sets the initial conditions of the first-order filter. More...
void | FILTER_FO_setNumCoeffs (FILTER_FO_Handle handle, const float_t b0, const float_t b1)
| Sets the first-order filter numerator coefficients. More...

## Detailed Description

## Data Structure Documentation

struct _FILTER_FO_

Defines the first-order filter (FILTER_FO) object.

Definition at line 71 of file 32b/filter_fo.h.

Data Fields
_iq | a1 | the denominator filter coefficient value for z^(-1)
_iq | b0 | the numerator filter coefficient value for z^0
_iq | b1 | the numerator filter coefficient value for z^(-1)
_iq | x1 | the input value at time sample n=-1
_iq | y1 | the output value at time sample n=-1

struct _FILTER_FO_Obj_

Defines the first-order filter (FILTER_FO) object.

Definition at line 69 of file float/filter_fo.h.

Data Fields
float_t | a1 | the denominator filter coefficient value for z^(-1)
float_t | b0 | the numerator filter coefficient value for z^0
float_t | b1 | the numerator filter coefficient value for z^(-1)
float_t | x1 | the input value at time sample n=-1
float_t | y1 | the output value at time sample n=-1

## Typedef Documentation

typedef struct _FILTER_FO_Obj_* FILTER_FO_Handle

Defines the first-order filter (FILTER_FO) handle.

Definition at line 84 of file float/filter_fo.h.

typedef struct _FILTER_FO_Obj_* FILTER_FO_Handle

Defines the first-order filter (FILTER_FO) handle.

Definition at line 86 of file 32b/filter_fo.h.

typedef struct _FILTER_FO_Obj_ FILTER_FO_Obj

Defines the first-order filter (FILTER_FO) object.

typedef struct _FILTER_FO_ FILTER_FO_Obj

Defines the first-order filter (FILTER_FO) object.

## Function Documentation

static _iq FILTER_FO_get_a1 | ( | FILTER_FO_Handle | handle | ) |
| inline static

Gets the first-order filter denominator coefficient a1.

Parameters

  [in] | handle | The filter handle
  [in] | a1 | The filter coefficient value for z^(-1)

Definition at line 104 of file 32b/filter_fo.h.

References _FILTER_FO_::a1.

Referenced by PID_getDerFilterParams().

static _iq FILTER_FO_get_b0 | ( | FILTER_FO_Handle | handle | ) |
| inline static

Gets the first-order filter numerator coefficient b0.

Parameters

  [in] | handle | The filter handle
  [in] | b0 | The filter coefficient value for z^0

Definition at line 115 of file 32b/filter_fo.h.

References _FILTER_FO_::b0.

Referenced by OFFSET_getBeta(), and PID_getDerFilterParams().

static _iq FILTER_FO_get_b1 | ( | FILTER_FO_Handle | handle | ) |
| inline static

Gets the first-order filter numerator coefficient b1.

Parameters

  [in] | handle | The filter handle

Returns
  The filter coefficient value for z^(-1)

Definition at line 126 of file 32b/filter_fo.h.

References _FILTER_FO_::b1.

Referenced by PID_getDerFilterParams().

static _iq FILTER_FO_get_x1 | ( | FILTER_FO_Handle | handle | ) |
| inline static

Gets the first-order filter input value at time sample n=-1.

Parameters

  [in] | handle | The filter handle

Returns
  The input value at time sample n=-1

Definition at line 137 of file 32b/filter_fo.h.

References _FILTER_FO_::x1.

Referenced by PID_getDerFilterParams().

static _iq FILTER_FO_get_y1 | ( | FILTER_FO_Handle | handle | ) |
| inline static

Gets the first-order filter output value at time sample n=-1.

Parameters

  [in] | handle | The filter handle

Returns
  The output value at time sample n=-1

Definition at line 148 of file 32b/filter_fo.h.

References _FILTER_FO_::y1.

Referenced by PID_getDerFilterParams().

void FILTER_FO_getDenCoeffs | ( | FILTER_FO_Handle | handle,
|  | float_t * | pa1
| ) |  |

Gets the first-order filter denominator coefficients.

Parameters

  [in] | handle | The filter handle
  [in] | pa1 | The pointer to memory for the filter coefficient value for z^(-1)

Definition at line 69 of file float/filter_fo.c.

References _FILTER_FO_::a1.

void FILTER_FO_getDenCoeffs | ( | FILTER_FO_Handle | handle,
|  | _iq * | pa1
| ) |  |

Gets the first-order filter denominator coefficients.

Parameters

  [in] | handle | The filter handle
  [in] | pa1 | The pointer to memory for the filter coefficient value for z^(-1)

Definition at line 58 of file 32b/filter_fo.c.

References _FILTER_FO_::a1.

void FILTER_FO_getInitialConditions | ( | FILTER_FO_Handle | handle,
|  | float_t * | px1,
|  | float_t * | py1
| ) |  |

Gets the initial conditions of the first-order filter.

Parameters

  [in] | handle | The filter handle
  [in] | px1 | The pointer to memory for the input value at time sample n=-1
  [in] | py1 | The pointer to memory for the output value at time sample n=-1

Definition at line 80 of file float/filter_fo.c.

References _FILTER_FO_::x1, and _FILTER_FO_::y1.

void FILTER_FO_getInitialConditions | ( | FILTER_FO_Handle | handle,
|  | _iq * | px1,
|  | _iq * | py1
| ) |  |

Gets the initial conditions of the first-order filter.

Parameters

  [in] | handle | The filter handle
  [in] | px1 | The pointer to memory for the input value at time sample n=-1
  [in] | py1 | The pointer to memory for the output value at time sample n=-1

Definition at line 69 of file 32b/filter_fo.c.

References _FILTER_FO_::x1, and _FILTER_FO_::y1.

void FILTER_FO_getNumCoeffs | ( | FILTER_FO_Handle | handle,
|  | float_t * | pb0,
|  | float_t * | pb1
| ) |  |

Gets the first-order filter numerator coefficients.

Parameters

  [in] | handle | The filter handle
  [in] | pb0 | The pointer to memory for the filter coefficient value for z^0
  [in] | pb1 | The pointer to memory for the filter coefficient value for z^(-1)

Definition at line 93 of file float/filter_fo.c.

References _FILTER_FO_::b0, and _FILTER_FO_::b1.

void FILTER_FO_getNumCoeffs | ( | FILTER_FO_Handle | handle,
|  | _iq * | pb0,
|  | _iq * | pb1
| ) |  |

Gets the first-order filter numerator coefficients.

Parameters

  [in] | handle | The filter handle
  [in] | pb0 | The pointer to memory for the filter coefficient value for z^0
  [in] | pb1 | The pointer to memory for the filter coefficient value for z^(-1)

Definition at line 82 of file 32b/filter_fo.c.

References _FILTER_FO_::b0, and _FILTER_FO_::b1.

Referenced by OFFSET_getBeta().

FILTER_FO_Handle FILTER_FO_init | ( | void * | pMemory,
|  | const size_t | numBytes
| ) |  |

Initializes the first-order filter.

Parameters

  [in] | pMemory | A pointer to the memory for the first-order filter object
  [in] | numBytes | The number of bytes allocated for the first-order filter object, bytes

Returns
  The filter (FILTER) object handle

Definition at line 94 of file 32b/filter_fo.c.

Referenced by OFFSET_init(), and PID_init().

static _iq FILTER_FO_run | ( | FILTER_FO_Handle | handle,
|  | const _iq | inputValue
| ) |  |
| inline static

Runs a first-order filter of the form y[n] = b0*x[n] + b1*x[n-1] - a1*y[n-1].

Parameters

  [in] | handle | The filter handle
  [in] | inputValue | The input value to filter

Returns
  The output value from the filter

Definition at line 189 of file 32b/filter_fo.h.

References _IQmpy, _FILTER_FO_Obj_::a1, _FILTER_FO_::a1, _FILTER_FO_Obj_::b0, _FILTER_FO_::b0, _FILTER_FO_Obj_::b1, _FILTER_FO_::b1, _FILTER_FO_Obj_::x1, _FILTER_FO_::x1, _FILTER_FO_Obj_::y1, and _FILTER_FO_::y1.

Referenced by OFFSET_run(), PID_run_parallel(), and PID_run_series().

static float_t FILTER_FO_run | ( | FILTER_FO_Handle | handle,
|  | const float_t | inputValue
| ) |  |
| inline static

Runs a first-order filter of the form y[n] = b0*x[n] + b1*x[n-1] - a1*y[n-1].

Parameters

  [in] | handle | The filter handle
  [in] | inputValue | The input value to filter

Returns
  The output value from the filter

Definition at line 190 of file float/filter_fo.h.

References _FILTER_FO_Obj_::a1, _FILTER_FO_::a1, _FILTER_FO_Obj_::b0, _FILTER_FO_::b0, _FILTER_FO_Obj_::b1, _FILTER_FO_::b1, _FILTER_FO_Obj_::x1, _FILTER_FO_::x1, _FILTER_FO_Obj_::y1, and _FILTER_FO_::y1.

static _iq FILTER_FO_run_form_0 | ( | FILTER_FO_Handle | handle,
|  | const _iq | inputValue
| ) |  |
| inline static

Runs a first-order filter of the form y[n] = b0*x[n] - a1*y[n-1].

Parameters

  [in] | handle | The filter handle
  [in] | inputValue | The input value to filter

Returns
  The output value from the filter

Definition at line 219 of file 32b/filter_fo.h.

References _IQmpy, _FILTER_FO_Obj_::a1, _FILTER_FO_::a1, _FILTER_FO_Obj_::b0, _FILTER_FO_::b0, _FILTER_FO_Obj_::y1, and _FILTER_FO_::y1.

static float_t FILTER_FO_run_form_0 | ( | FILTER_FO_Handle | handle,
|  | const float_t | inputValue
| ) |  |
| inline static

Runs a first-order filter of the form y[n] = b0*x[n] - a1*y[n-1].

Parameters

  [in] | handle | The filter handle
  [in] | inputValue | The input value to filter

Returns
  The output value from the filter

Definition at line 219 of file float/filter_fo.h.

References _FILTER_FO_Obj_::a1, _FILTER_FO_::a1, _FILTER_FO_Obj_::b0, _FILTER_FO_::b0, _FILTER_FO_Obj_::y1, and _FILTER_FO_::y1.

static void FILTER_FO_set_a1 | ( | FILTER_FO_Handle | handle,
|  | const float_t | a1
| ) |  |
| inline static

Sets the first-order filter denominator coefficient a1.

Parameters

  [in] | handle | The filter handle
  [in] | a1 | The filter coefficient value for z^(-1)

Definition at line 242 of file float/filter_fo.h.

References _FILTER_FO_Obj_::a1, and _FILTER_FO_::a1.

static void FILTER_FO_set_a1 | ( | FILTER_FO_Handle | handle,
|  | const _iq | a1
| ) |  |
| inline static

Sets the first-order filter denominator coefficient a1.

Parameters

  [in] | handle | The filter handle
  [in] | a1 | The filter coefficient value for z^(-1)

Definition at line 242 of file 32b/filter_fo.h.

References _FILTER_FO_Obj_::a1, and _FILTER_FO_::a1.

static void FILTER_FO_set_b0 | ( | FILTER_FO_Handle | handle,
|  | const float_t | b0
| ) |  |
| inline static

Sets the first-order filter numerator coefficient b0.

Parameters

  [in] | handle | The filter handle
  [in] | b0 | The filter coefficient value for z^0

Definition at line 255 of file float/filter_fo.h.

References _FILTER_FO_Obj_::b0, and _FILTER_FO_::b0.

static void FILTER_FO_set_b0 | ( | FILTER_FO_Handle | handle,
|  | const _iq | b0
| ) |  |
| inline static

Sets the first-order filter numerator coefficient b0.

Parameters

  [in] | handle | The filter handle
  [in] | b0 | The filter coefficient value for z^0

Definition at line 255 of file 32b/filter_fo.h.

References _FILTER_FO_Obj_::b0, and _FILTER_FO_::b0.

static void FILTER_FO_set_b1 | ( | FILTER_FO_Handle | handle,
|  | const _iq | b1
| ) |  |
| inline static

Sets the first-order filter numerator coefficient b1.

Parameters

  [in] | handle | The filter handle
  [in] | b1 | The filter coefficient value for z^(-1)

Definition at line 268 of file 32b/filter_fo.h.

References _FILTER_FO_Obj_::b1, and _FILTER_FO_::b1.

static void FILTER_FO_set_b1 | ( | FILTER_FO_Handle | handle,
|  | const float_t | b1
| ) |  |
| inline static

Sets the first-order filter numerator coefficient b1.

Parameters

  [in] | handle | The filter handle
  [in] | b1 | The filter coefficient value for z^(-1)

Definition at line 268 of file float/filter_fo.h.

References _FILTER_FO_Obj_::b1, and _FILTER_FO_::b1.

static void FILTER_FO_set_x1 | ( | FILTER_FO_Handle | handle,
|  | const _iq | x1
| ) |  |
| inline static

Sets the first-order filter input value at time sample n=-1.

Parameters

  [in] | handle | The filter handle
  [in] | x1 | The input value at time sample n=-1

Definition at line 281 of file 32b/filter_fo.h.

References _FILTER_FO_Obj_::x1, and _FILTER_FO_::x1.

static void FILTER_FO_set_x1 | ( | FILTER_FO_Handle | handle,
|  | const float_t | x1
| ) |  |
| inline static

Sets the first-order filter input value at time sample n=-1.

Parameters

  [in] | handle | The filter handle
  [in] | x1 | The input value at time sample n=-1

Definition at line 281 of file float/filter_fo.h.

References _FILTER_FO_Obj_::x1, and _FILTER_FO_::x1.

static void FILTER_FO_set_y1 | ( | FILTER_FO_Handle | handle,
|  | const _iq | y1
| ) |  |
| inline static

Sets the first-order filter output value at time sample n=-1.

Parameters

  [in] | handle | The filter handle
  [in] | y1 | The output value at time sample n=-1

Definition at line 294 of file 32b/filter_fo.h.

References _FILTER_FO_Obj_::y1, and _FILTER_FO_::y1.

static void FILTER_FO_set_y1 | ( | FILTER_FO_Handle | handle,
|  | const float_t | y1
| ) |  |
| inline static

Sets the first-order filter output value at time sample n=-1.

Parameters

  [in] | handle | The filter handle
  [in] | y1 | The output value at time sample n=-1

Definition at line 294 of file float/filter_fo.h.

References _FILTER_FO_Obj_::y1, and _FILTER_FO_::y1.

void FILTER_FO_setDenCoeffs | ( | FILTER_FO_Handle | handle,
|  | const float_t | a1
| ) |  |

Sets the first-order filter denominator coefficients.

Parameters

  [in] | handle | The filter handle
  [in] | a1 | The filter coefficient value for z^(-1)

Definition at line 125 of file float/filter_fo.c.

References _FILTER_FO_::a1.

void FILTER_FO_setDenCoeffs | ( | FILTER_FO_Handle | handle,
|  | const _iq | a1
| ) |  |

Sets the first-order filter denominator coefficients.

Parameters

  [in] | handle | The filter handle
  [in] | a1 | The filter coefficient value for z^(-1)

Definition at line 109 of file 32b/filter_fo.c.

References _FILTER_FO_::a1.

Referenced by OFFSET_setBeta(), and PID_setDerFilterParams().

void FILTER_FO_setInitialConditions | ( | FILTER_FO_Handle | handle,
|  | const float_t | x1,
|  | const float_t | y1
| ) |  |

Sets the initial conditions of the first-order filter.

Parameters

  [in] | handle | The filter handle
  [in] | x1 | The input value at time sample n=-1
  [in] | y1 | The output value at time sample n=-1

Definition at line 136 of file float/filter_fo.c.

References _FILTER_FO_::x1, and _FILTER_FO_::y1.

void FILTER_FO_setInitialConditions | ( | FILTER_FO_Handle | handle,
|  | const _iq | x1,
|  | const _iq | y1
| ) |  |

Sets the initial conditions of the first-order filter.

Parameters

  [in] | handle | The filter handle
  [in] | x1 | The input value at time sample n=-1
  [in] | y1 | The output value at time sample n=-1

Definition at line 120 of file 32b/filter_fo.c.

References _FILTER_FO_::x1, and _FILTER_FO_::y1.

Referenced by OFFSET_setInitCond(), and PID_setDerFilterParams().

void FILTER_FO_setNumCoeffs | ( | FILTER_FO_Handle | handle,
|  | const _iq | b0,
|  | const _iq | b1
| ) |  |

Sets the first-order filter numerator coefficients.

Parameters

  [in] | handle | The filter handle
  [in] | b0 | The filter coefficient value for z^0
  [in] | b1 | The filter coefficient value for z^(-1)

Definition at line 133 of file 32b/filter_fo.c.

References _FILTER_FO_::b0, and _FILTER_FO_::b1.

Referenced by OFFSET_setBeta(), and PID_setDerFilterParams().

void FILTER_FO_setNumCoeffs | ( | FILTER_FO_Handle | handle,
|  | const float_t | b0,
|  | const float_t | b1
| ) |  |

Sets the first-order filter numerator coefficients.

Parameters

  [in] | handle | The filter handle
  [in] | b0 | The filter coefficient value for z^0
  [in] | b1 | The filter coefficient value for z^(-1)

Definition at line 149 of file float/filter_fo.c.

References _FILTER_FO_::b0, and _FILTER_FO_::b1.