Data Structures | Typedefs | Functions
FILTER_NOTCH

Data Structures

struct  _FILTER_NOTCH_CoeffObj_
 Defines the notch filter coefficient (FILTER_COEFF) object. More...
 
struct  _FILTER_NOTCH_Obj_
 Defines the notch filter (FILTER_NOTCH) object. More...
 

Typedefs

typedef struct _FILTER_NOTCH_CoeffObj_ FILTER_NOTCH_CoeffObj
 Defines the notch filter coefficient (FILTER_COEFF) object. More...
 
typedef struct _FILTER_NOTCH_CoeffObj_FILTER_NOTCH_Coeff_Handle
 Defines the notch filter coefficient (FILTER_NOTCH_Coeff) handle. More...
 
typedef struct _FILTER_NOTCH_Obj_ FILTER_NOTCH_Obj
 Defines the notch filter (FILTER_NOTCH) object. More...
 
typedef struct _FILTER_NOTCH_Obj_FILTER_NOTCH_Handle
 Defines the notch filter (FILTER_NOTCH) handle. More...
 

Functions

static float32_t FILTER_NOTCH_get_in1 (FILTER_NOTCH_Handle handle)
 Gets the notch filter input value at time sample n-1. More...
 
static float32_t FILTER_NOTCH_get_in2 (FILTER_NOTCH_Handle handle)
 Gets the notch filter input value at time sample n-2. More...
 
static float32_t FILTER_NOTCH_get_out (FILTER_NOTCH_Handle handle)
 Gets the nothc filter output value at time sample n. More...
 
static float32_t FILTER_NOTCH_get_out1 (FILTER_NOTCH_Handle handle)
 Gets the nothc filter output value at time sample n-1. More...
 
static float32_t FILTER_NOTCH_get_out2 (FILTER_NOTCH_Handle handle)
 Gets the nothc filter output value at time sample n-2. More...
 
FILTER_NOTCH_Coeff_Handle FILTER_COEFF_init (void *pMemory, const size_t numBytes)
 Initializes the notch filter coefficient handle. More...
 
FILTER_NOTCH_Handle FILTER_NOTCH_init (void *pMemory, const size_t numBytes)
 Initializes the notch filter. More...
 
static void FILTER_NOTCH_set_in (FILTER_NOTCH_Handle handle, const float32_t in)
 Sets the notch filter input value at time sample n. More...
 
static void FILTER_NOTCH_set_in1 (FILTER_NOTCH_Handle handle, const float32_t in1)
 Sets the notch filter input value at time sample n-1. More...
 
static void FILTER_NOTCH_set_in2 (FILTER_NOTCH_Handle handle, const float32_t in2)
 Sets the notch filter input value at time sample n-2. More...
 
static void FILTER_NOTCH_set_out (FILTER_NOTCH_Handle handle, const float32_t out)
 Sets the notch filter output value at time sample n. More...
 
static void FILTER_NOTCH_set_out1 (FILTER_NOTCH_Handle handle, const float32_t out1)
 Sets the notch filter output value at time sample n-1. More...
 
static void FILTER_NOTCH_set_out2 (FILTER_NOTCH_Handle handle, const float32_t out2)
 Sets the notch filter output value at time sample n-2. More...
 
static float32_t FILTER_NOTCH_run (FILTER_NOTCH_Handle notchHandle, FILTER_NOTCH_Coeff_Handle coeffHandle)
 Runs a notch filter of the form y[n] = a1*y[n-1] + a2*y[n-2] + b0*x[n] + b1*x[n-1] + b2*x[n-2]. More...
 
void FILTER_NOTCH_reset (FILTER_NOTCH_Handle handle)
 Resets the notch filter. More...
 
void FILTER_COEFF_update (FILTER_NOTCH_Coeff_Handle handle, const float32_t Ts, const float32_t freqGrid, const float32_t c2, const float32_t c1)
 Updates the notch filter numerator coefficients. More...
 

Detailed Description

Typedef Documentation

◆ FILTER_NOTCH_CoeffObj

Defines the notch filter coefficient (FILTER_COEFF) object.

◆ FILTER_NOTCH_Coeff_Handle

Defines the notch filter coefficient (FILTER_NOTCH_Coeff) handle.

◆ FILTER_NOTCH_Obj

Defines the notch filter (FILTER_NOTCH) object.

◆ FILTER_NOTCH_Handle

Defines the notch filter (FILTER_NOTCH) handle.

Function Documentation

◆ FILTER_NOTCH_get_in1()

static float32_t FILTER_NOTCH_get_in1 ( FILTER_NOTCH_Handle  handle)
inlinestatic

Gets the notch filter input value at time sample n-1.

Parameters
[in]handleThe notch filter handle
Returns
The input value at time sample n-1

References _FILTER_NOTCH_Obj_::in1.

◆ FILTER_NOTCH_get_in2()

static float32_t FILTER_NOTCH_get_in2 ( FILTER_NOTCH_Handle  handle)
inlinestatic

Gets the notch filter input value at time sample n-2.

Parameters
[in]handleThe notch filter handle
Returns
The input value at time sample n-2

References _FILTER_NOTCH_Obj_::in2.

◆ FILTER_NOTCH_get_out()

static float32_t FILTER_NOTCH_get_out ( FILTER_NOTCH_Handle  handle)
inlinestatic

Gets the nothc filter output value at time sample n.

Parameters
[in]handleThe notch filter handle
Returns
The output value at time sample n

References _FILTER_NOTCH_Obj_::out.

◆ FILTER_NOTCH_get_out1()

static float32_t FILTER_NOTCH_get_out1 ( FILTER_NOTCH_Handle  handle)
inlinestatic

Gets the nothc filter output value at time sample n-1.

Parameters
[in]handleThe notch filter handle
Returns
The output value at time sample n-1

References _FILTER_NOTCH_Obj_::out1.

◆ FILTER_NOTCH_get_out2()

static float32_t FILTER_NOTCH_get_out2 ( FILTER_NOTCH_Handle  handle)
inlinestatic

Gets the nothc filter output value at time sample n-2.

Parameters
[in]handleThe notch filter handle
Returns
The output value at time sample n-2

References _FILTER_NOTCH_Obj_::out2.

◆ FILTER_COEFF_init()

FILTER_NOTCH_Coeff_Handle FILTER_COEFF_init ( void *  pMemory,
const size_t  numBytes 
)

Initializes the notch filter coefficient handle.

Parameters
[in]pMemoryA pointer to the memory for the notch filter coefficient object
[in]numBytesThe number of bytes allocated for the notch filter coefficient object, bytes
Returns
The notch filter (FILTER_COEFF) object handle

◆ FILTER_NOTCH_init()

FILTER_NOTCH_Handle FILTER_NOTCH_init ( void *  pMemory,
const size_t  numBytes 
)

Initializes the notch filter.

Parameters
[in]pMemoryA pointer to the memory for the notch filter object
[in]numBytesThe number of bytes allocated for the notch filter object, bytes
Returns
The notch filter (FILTER_NOTCH) object handle

◆ FILTER_NOTCH_set_in()

static void FILTER_NOTCH_set_in ( FILTER_NOTCH_Handle  handle,
const float32_t  in 
)
inlinestatic

Sets the notch filter input value at time sample n.

Parameters
[in]handleThe filter handle
[in]inThe input value at time sample n
Returns
None

References _FILTER_NOTCH_Obj_::in.

◆ FILTER_NOTCH_set_in1()

static void FILTER_NOTCH_set_in1 ( FILTER_NOTCH_Handle  handle,
const float32_t  in1 
)
inlinestatic

Sets the notch filter input value at time sample n-1.

Parameters
[in]handleThe filter handle
[in]in1The input value at time sample n-1
Returns
None

References _FILTER_NOTCH_Obj_::in1.

◆ FILTER_NOTCH_set_in2()

static void FILTER_NOTCH_set_in2 ( FILTER_NOTCH_Handle  handle,
const float32_t  in2 
)
inlinestatic

Sets the notch filter input value at time sample n-2.

Parameters
[in]handleThe filter handle
[in]in2The input value at time sample n-2
Returns
None

References _FILTER_NOTCH_Obj_::in2.

◆ FILTER_NOTCH_set_out()

static void FILTER_NOTCH_set_out ( FILTER_NOTCH_Handle  handle,
const float32_t  out 
)
inlinestatic

Sets the notch filter output value at time sample n.

Parameters
[in]handleThe notch filter handle
[in]outThe output value at time sample n
Returns
None

References _FILTER_NOTCH_Obj_::out.

◆ FILTER_NOTCH_set_out1()

static void FILTER_NOTCH_set_out1 ( FILTER_NOTCH_Handle  handle,
const float32_t  out1 
)
inlinestatic

Sets the notch filter output value at time sample n-1.

Parameters
[in]handleThe notch filter handle
[in]out1The output value at time sample n-1
Returns
None

References _FILTER_NOTCH_Obj_::out1.

◆ FILTER_NOTCH_set_out2()

static void FILTER_NOTCH_set_out2 ( FILTER_NOTCH_Handle  handle,
const float32_t  out2 
)
inlinestatic

Sets the notch filter output value at time sample n-2.

Parameters
[in]handleThe notch filter handle
[in]out2The output value at time sample n-2
Returns
None

References _FILTER_NOTCH_Obj_::out2.

◆ FILTER_NOTCH_run()

static float32_t FILTER_NOTCH_run ( FILTER_NOTCH_Handle  notchHandle,
FILTER_NOTCH_Coeff_Handle  coeffHandle 
)
inlinestatic

Runs a notch filter of the form y[n] = a1*y[n-1] + a2*y[n-2] + b0*x[n] + b1*x[n-1] + b2*x[n-2].

Parameters
[in]notchHandleThe filter notch handle
[in]coeffHandleThe filter coefficient handle
Returns
The output value from the filter

References _FILTER_NOTCH_CoeffObj_::a1, _FILTER_NOTCH_CoeffObj_::a2, _FILTER_NOTCH_CoeffObj_::b0, _FILTER_NOTCH_CoeffObj_::b1, _FILTER_NOTCH_CoeffObj_::b2, _FILTER_NOTCH_Obj_::in, _FILTER_NOTCH_Obj_::in1, _FILTER_NOTCH_Obj_::in2, _FILTER_NOTCH_Obj_::out, _FILTER_NOTCH_Obj_::out1, and _FILTER_NOTCH_Obj_::out2.

◆ FILTER_NOTCH_reset()

void FILTER_NOTCH_reset ( FILTER_NOTCH_Handle  handle)

Resets the notch filter.

Parameters
[in]handleThe notch filter handle
Returns
None

◆ FILTER_COEFF_update()

void FILTER_COEFF_update ( FILTER_NOTCH_Coeff_Handle  handle,
const float32_t  Ts,
const float32_t  freqGrid,
const float32_t  c2,
const float32_t  c1 
)

Updates the notch filter numerator coefficients.

Parameters
[in]handleThe notch filter coefficient handle
[in]TsThe notch filter sampling period, sec
[in]freqGridThe Nominal AC grid frequency for notch filter, Hz
[in]c2The notch filter parameter
[in]c1The notch filter parameter
Returns
None

Copyright 2023, Texas Instruments Incorporated