3 #include "utilities/aligned/vector.h" 13 double gaussian(
double t,
double o);
14 double sin_modulated_gaussian(
double t,
double o);
15 double gaussian_dash(
double t,
double o);
17 template <
typename T,
typename Func>
18 util::aligned::vector<T> gauss_like_kernel(
double fc,
const Func& func) {
19 const auto o = 1.0 / (2.0 * M_PI * fc);
20 const ptrdiff_t delay = std::ceil(8.0 * o);
21 const auto l = delay * 2 + 1;
22 util::aligned::vector<T> ret;
24 for (ptrdiff_t i = 0; i != l; ++i) {
25 ret.emplace_back(func(i - delay, o));
30 template <
typename T =
float>
31 auto gen_gaussian(
double fc) {
32 return gauss_like_kernel<T>(fc, gaussian);
35 template <
typename T =
float>
36 auto gen_sin_modulated_gaussian(
double fc) {
37 return gauss_like_kernel<T>(fc, sin_modulated_gaussian);
40 template <
typename T =
float>
41 auto gen_gaussian_dash(
double fc) {
42 return gauss_like_kernel<T>(fc, gaussian_dash);
47 double ricker(
double t,
double f);
49 template <
typename T =
float>
50 util::aligned::vector<T> gen_ricker(
double fc) {
51 const ptrdiff_t delay = std::ceil(1.0 / fc);
52 const auto l = delay * 2 + 1;
53 util::aligned::vector<T> ret;
55 for (ptrdiff_t i = 0; i != l; ++i) {
56 ret.emplace_back(ricker(i - delay, fc));
Definition: capsule_base.h:9