|
liba 0.1.15
An algorithm library based on C/C++
|
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 | |
| #define A_LPF_1 | ( | alpha | ) |
| #define A_LPF_2 | ( | fc, | |
| ts ) |
| #define A_LPF_GEN | ( | fc, | |
| ts ) |
generate for Low Pass Filter
\begin{cases} \alpha=\frac{T_s}{RC+T_s},&\alpha\in[0,1]\\ RC=\frac{1}{2\pi f_c}. \end{cases}
\[ \alpha=\frac{T_s}{\frac{1}{2\pi f_c}+T_s} \]
| [in] | fc | cut-off frequency unit(hz) |
| [in] | ts | sampling time unit(s) |
initialize for Low Pass Filter
| [in,out] | ctx | points to an instance of Low Pass Filter |
| [in] | alpha | filter coefficient [0,1] |
compute for Low Pass Filter
\[ V_{\mathrm o}(n)=(1-\alpha)V_{\mathrm o}(n-1)+\alpha V_{\mathrm i}(n) \]
| [in,out] | ctx | points to an instance of Low Pass Filter |
| [in] | x | input value |
| void a_lpf_zero | ( | a_lpf * | ctx | ) |
zeroing for Low Pass Filter
| [in,out] | ctx | points to an instance of Low Pass Filter |