Create userdata without user values in Lua 5.4
[liba.git] / test / hpf.h
bloba588276e5a5f028bf1b66dfee3e93c6d6109ab2f
1 #define MAIN_(x) A_CAST_2(x, _hpf)
2 #include "test.h"
3 #include "a/hpf.h"
5 int MAIN(int argc, char *argv[]) // NOLINT(misc-definitions-in-headers)
7 test_init(argc, argv, 1);
8 a_hpf_s ctx = A_HPF_INIT(A_HPF_GEN(10, 0.01));
9 a_hpf_init(&ctx, a_hpf_gen(10, A_FLOAT_C(0.01)));
10 for (unsigned int i = 0; i < 100; ++i)
12 a_float_t x = A_FLOAT_PI / 10 * a_float_c(, i);
13 a_float_t x1 = a_float_sin(x);
14 a_float_t x2 = a_hpf_iter(&ctx, x1);
15 debug(A_FLOAT_PRI("+", "f ") A_FLOAT_PRI("+", "f ") A_FLOAT_PRI("+", "f\n"), x, x1, x2);
17 a_hpf_zero(&ctx);
18 return 0;