summaryrefslogtreecommitdiff
path: root/src/audio/window.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio/window.cc')
-rw-r--r--src/audio/window.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/audio/window.cc b/src/audio/window.cc
index b68c747..bcdd768 100644
--- a/src/audio/window.cc
+++ b/src/audio/window.cc
@@ -12,3 +12,11 @@ void hamming_window_512(float* window) {
0.54f - 0.46f * cosf(2.0f * PI * (float)i / (float)(WINDOW_SIZE - 1));
}
}
+
+void hann_window_512(float* window) {
+ const float PI = 3.14159265358979323846f;
+ for (int i = 0; i < WINDOW_SIZE; ++i) {
+ window[i] =
+ 0.5f - 0.5f * cosf(2.0f * PI * (float)i / (float)(WINDOW_SIZE - 1));
+ }
+}