Correct flattop window coefficients
authorThomas Zander <thomas.e.zander@googlemail.com>
Thu, 29 Jun 2017 18:43:33 +0000 (20:43 +0200)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Sat, 1 Jul 2017 05:43:46 +0000 (15:43 +1000)
The window amplitude is now  normalised to 1.0.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
src/libFLAC/window.c

index e977fd8..7698328 100644 (file)
@@ -109,7 +109,7 @@ void FLAC__window_flattop(FLAC__real *window, const FLAC__int32 L)
        FLAC__int32 n;
 
        for (n = 0; n < L; n++)
-               window[n] = (FLAC__real)(1.0f - 1.93f * cos(2.0f * M_PI * n / N) + 1.29f * cos(4.0f * M_PI * n / N) - 0.388f * cos(6.0f * M_PI * n / N) + 0.0322f * cos(8.0f * M_PI * n / N));
+               window[n] = (FLAC__real)(0.21557895f - 0.41663158f * cos(2.0f * M_PI * n / N) + 0.277263158f * cos(4.0f * M_PI * n / N) - 0.083578947f * cos(6.0f * M_PI * n / N) + 0.006947368f * cos(8.0f * M_PI * n / N));
 }
 
 void FLAC__window_gauss(FLAC__real *window, const FLAC__int32 L, const FLAC__real stddev)