From bc5214b3e1b3afcc7c9430a75625ad9a41a8ea38 Mon Sep 17 00:00:00 2001 From: Daniel Hams Date: Sun, 24 Apr 2011 19:54:25 +0800 Subject: [PATCH] Use Hann window function instead of Hamming (issue 48) This helps to clear up spectral bleeding. Signed-off-by: Alexander Kojevnikov --- src/spek-pipeline.vala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/spek-pipeline.vala b/src/spek-pipeline.vala index c6d66bb..d10f2b7 100644 --- a/src/spek-pipeline.vala +++ b/src/spek-pipeline.vala @@ -243,8 +243,11 @@ namespace Spek { prev_head = head; for (int i = 0; i < nfft; i++) { float val = input[(input_size + head - nfft + i) % input_size]; + // TODO: allow the user to chose the window function // Hamming window. - val *= 0.53836f - 0.46164f * coss[i]; +// val *= 0.53836f - 0.46164f * coss[i]; + // Hann window. + val *= 0.5f * (1f - coss[i]); fft.input[i] = val; } fft.execute ();