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
Low Pass Filter
Collaboration diagram for Low Pass Filter:

Data Structures

struct  a_lpf
 instance structure for Low Pass Filter More...
 

Macros

#define A_LPF_1(alpha)
 
#define A_LPF_2(fc, ts)
 
#define A_LPF_GEN(fc, ts)
 

Typedefs

typedef struct a_lpf a_lpf
 instance structure for Low Pass Filter
 

Functions

a_real a_lpf_gen (a_real fc, a_real ts)
 generate for Low Pass Filter
 
void a_lpf_init (a_lpf *ctx, a_real alpha)
 initialize for Low Pass Filter
 
a_real a_lpf_iter (a_lpf *ctx, a_real x)
 compute for Low Pass Filter
 
void a_lpf_zero (a_lpf *ctx)
 zeroing for Low Pass Filter
 

Detailed Description

Macro Definition Documentation

◆ A_LPF_1

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

◆ A_LPF_2

#define A_LPF_2 ( fc,
ts )
Value:
{A_LPF_GEN(fc, ts), 0}

◆ A_LPF_GEN

#define A_LPF_GEN ( fc,
ts )
Value:
(a_real_c(ts) / (A_REAL_1_TAU / a_real_c(fc) + a_real_c(ts)))
#define A_REAL_1_TAU
Definition math.h:271

Function Documentation

◆ a_lpf_gen()

a_real a_lpf_gen ( a_real fc,
a_real ts )

generate for Low Pass Filter

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

α=Ts12πfc+Ts

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

◆ a_lpf_init()

void a_lpf_init ( a_lpf * ctx,
a_real alpha )

initialize for Low Pass Filter

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

◆ a_lpf_iter()

a_real a_lpf_iter ( a_lpf * ctx,
a_real x )

compute for Low Pass Filter

Vo(n)=(1α)Vo(n1)+αVi(n)

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

◆ a_lpf_zero()

void a_lpf_zero ( a_lpf * ctx)

zeroing for Low Pass Filter

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