commit bc5214b3e1b3afcc7c9430a75625ad9a41a8ea38
parent 968c1644d2da7674cc5a893f1878283fe5b41d8b
Author: Daniel Hams <daniel.hams@gmail.com>
Date: Sun, 24 Apr 2011 19:54:25 +0800
Use Hann window function instead of Hamming (issue 48)
This helps to clear up spectral bleeding.
Signed-off-by: Alexander Kojevnikov <alexander@kojevnikov.com>
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git 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 ();