28#ifndef _DSP_WINDOWS_H_
29#define _DSP_WINDOWS_H_
49template <window_sample_func_t F>
54 for (
int i = 0;
i <
n; ++
i)
56 double f = (double)
i /
n - 1;
57 F (
s[
i], .5 - .5 * cos (2 *
M_PI *
f));
61template <window_sample_func_t F>
67 for (
int i = 0;
i <
n; ++
i)
72 .5f * cos (2.f *
f *
M_PI /
w) +
73 .08 * cos (4.f *
f *
M_PI /
w);
79template <window_sample_func_t F>
83 double w1 = 2.f *
M_PI / (
n - 1);
87 for (
int i = 0;
i <
n; ++
i)
89 double f = (double)
i;
92 .48829f * cos (w1 *
f) +
93 .14128f * cos (w2 *
f) -
94 .01168f * cos (w3 *
f);
109 if ((ax = fabs (
x)) < 3.75)
113 ans = (1.0 +
y * (3.5156229 +
118 y * 0.45813e-2))))));
123 ans = ((exp (ax) / sqrt (ax))
132 y * 0.392377e-2)))))))));
138template <window_sample_func_t F>
145 for (
double i = -
n / 2 + .1; si <
n; ++si, ++
i)
147 double k =
besseli ((beta * sqrt (1 - pow ((2 *
i / (
n - 1)), 2)))) /
bb;
150 if (!isfinite (
k) || isnan(
k))
LADSPA_Data sample_t
Definition basics.h:100
#define M_PI
Definition compat.h:149
UINT_D64 w
Definition inflate.c:942
G bb
Definition inflate.c:1057
register unsigned k
Definition inflate.c:946
int y
Definition inflate.c:1588
unsigned d
Definition inflate.c:940
register unsigned i
Definition inflate.c:1575
unsigned s
Definition inflate.c:1555
unsigned x[BMAX+1]
Definition inflate.c:1586
unsigned f
Definition inflate.c:1572
void store_sample(sample_t &d, sample_t s)
Definition windows.h:38
void(* window_sample_func_t)(sample_t &, sample_t)
Definition windows.h:34
double besseli(double x)
Definition windows.h:104
void apply_window(sample_t &d, sample_t s)
Definition windows.h:44
void blackman_harris(sample_t *s, int n)
Definition windows.h:81
void hanning(sample_t *s, int n)
Definition windows.h:51
void blackman(sample_t *s, int n)
Definition windows.h:63
void kaiser(sample_t *s, int n, double beta)
Definition windows.h:140
int n
Definition crypt.c:458
#define void
Definition unzip.h:396