liba 0.1.15
An algorithm library based on C/C++
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
Loading...
Searching...
No Matches
High Pass Filter
Collaboration diagram for High Pass Filter:

Data Structures

struct  a_hpf
 instance structure for High Pass Filter More...
 

Macros

#define A_HPF_1(alpha)
 
#define A_HPF_2(fc, ts)
 
#define A_HPF_GEN(fc, ts)
 

Typedefs

typedef struct a_hpf a_hpf
 instance structure for High Pass Filter
 

Functions

a_real a_hpf_gen (a_real fc, a_real ts)
 generate for High Pass Filter
 
void a_hpf_init (a_hpf *ctx, a_real alpha)
 initialize for High Pass Filter
 
a_real a_hpf_iter (a_hpf *ctx, a_real x)
 compute for High Pass Filter
 
void a_hpf_zero (a_hpf *ctx)
 zeroing for High Pass Filter
 

Detailed Description

Macro Definition Documentation

◆ A_HPF_1

#define A_HPF_1 ( alpha)
Value:
{a_real_c(alpha), 0, 0}
#define a_real_c(x)
static cast to floating-point number
Definition a.h:1003

◆ A_HPF_2

#define A_HPF_2 ( fc,
ts )
Value:
{A_HPF_GEN(fc, ts), 0, 0}

◆ A_HPF_GEN

#define A_HPF_GEN ( fc,
ts )
Value:
(1 / (A_REAL_TAU * a_real_c(fc) * a_real_c(ts) + 1))
#define A_REAL_TAU
Definition math.h:261

Function Documentation

◆ a_hpf_gen()

a_real a_hpf_gen ( a_real fc,
a_real ts )

generate for High Pass Filter

{α=RCRC+Ts,α[0,1]RC=12πfc.

α=12πfcTs+1

Parameters
[in]fccut-off frequency unit(hz)
[in]tssampling time unit(s)
Returns
filter coefficient [0,1]

◆ a_hpf_init()

void a_hpf_init ( a_hpf * ctx,
a_real alpha )

initialize for High Pass Filter

Parameters
[in,out]ctxpoints to an instance of High Pass Filter
[in]alphafilter coefficient [0,1]

◆ a_hpf_iter()

a_real a_hpf_iter ( a_hpf * ctx,
a_real x )

compute for High Pass Filter

Vo(n)=α[Vo(n1)+Vi(n)Vi(n1)]

Parameters
[in,out]ctxpoints to an instance of High Pass Filter
[in]xinput value
Returns
output value

◆ a_hpf_zero()

void a_hpf_zero ( a_hpf * ctx)

zeroing for High Pass Filter

Parameters
[in,out]ctxpoints to an instance of High Pass Filter