From 68c5886db9dfbc3ea938a0eb3a02fbb21643d9b5 Mon Sep 17 00:00:00 2001 From: Thomas Zander Date: Thu, 29 Jun 2017 20:43:33 +0200 Subject: Correct flattop window coefficients The window amplitude is now normalised to 1.0. Signed-off-by: Erik de Castro Lopo --- src/libFLAC/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libFLAC/window.c b/src/libFLAC/window.c index e977fd86..76983286 100644 --- a/src/libFLAC/window.c +++ b/src/libFLAC/window.c @@ -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) -- cgit v1.2.1