slight change to Fourier window
static inline double window_cosh(double x, double n_taps)
{
double r;
double A = 16.9779;
double x2;
x = 2.0 * x / n_taps;
x2 = x * x;
if (x2 >= 1.0)
return 0.0;
//doi:10.1109/RME.2008.4595727 with tweak
r = (exp(A * sqrt(1 - x2)) - 1) / (exp(A) - 1);
return r;
}
I changed two things because they have been bothering me, but they will be indistinguishable from the old behavior.
R->A calculation removed: it wasn't valid anyway. No behavior change. Placed existing A in there directly.
cosh window -> strangely tweaked exp window: remove the discontinuity at the border, which is wrong for a window function. If A changes in the future, this window will be better. With the current A, you will not be able to tell the difference on any graph. (Of course, it's not a cosh window anymore.)
I also added a reference to the paper since nobody will have any idea what the window is otherwise. Both cosh and exp are pretty rare windows.