Displaying 2 results from an estimated 2 matches for "anti_denormal".
2014 Aug 01
3
Fix and question apodization functions
Hi,
I was doing some speed and compression comparisons with various
apodization/windowing functions, and found out that the
definitions for the bartlett and bartlett_hann window in the
FLAC codebase have been wrong since their introduction. The
attached patch fixes that.
Furthermore, I found some peculiar behaviour of the gauss
apodization that seems to expose bug. Using different windows
2014 Aug 02
0
Fix and question apodization functions
...ncreases 20-fold while the number of calls stays the same.
> Could this be a bug?
<http://en.wikipedia.org/wiki/Denormal_number#Performance_issues> ?
Try something like this:
void FLAC__window_gauss(FLAC__real *window, const FLAC__int32 L, const FLAC__real stddev)
{
static const double anti_denormal = 0.88817841970012523233890533447266e-15; /* 2e-50 */
const FLAC__int32 N = L - 1;
const double N2 = (double)N / 2.;
FLAC__int32 n;
for (n = 0; n <= N; n++) {
const double k = ((double)n - N2) / (stddev * N2);
window[n] = (FLAC__real)exp(-0.5f * k * k);
window[n] += anti_denormal;
w...