mirror of
https://github.com/alexkay/spek.git
synced 2025-06-09 03:42:32 +03:00
Use Hann window function instead of Hamming (issue 48)
This helps to clear up spectral bleeding. Signed-off-by: Alexander Kojevnikov <alexander@kojevnikov.com>
This commit is contained in:
parent
968c1644d2
commit
bc5214b3e1
@ -243,8 +243,11 @@ namespace Spek {
|
|||||||
prev_head = head;
|
prev_head = head;
|
||||||
for (int i = 0; i < nfft; i++) {
|
for (int i = 0; i < nfft; i++) {
|
||||||
float val = input[(input_size + head - nfft + i) % input_size];
|
float val = input[(input_size + head - nfft + i) % input_size];
|
||||||
|
// TODO: allow the user to chose the window function
|
||||||
// Hamming window.
|
// 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.input[i] = val;
|
||||||
}
|
}
|
||||||
fft.execute ();
|
fft.execute ();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user