From 302d883f34864bc66a5e04532ae27d7e89fd94e8 Mon Sep 17 00:00:00 2001 From: skal Date: Wed, 28 Jan 2026 09:31:13 +0100 Subject: style: Add 3-line descriptive headers to all source files This commit applies a new project-wide rule that every source file must begin with a concise 3-line comment header describing its purpose. - Updated CONTRIBUTING.md with the new rule. - Applied headers to all .cc and .h files in src/ and tools/. - Fixed various minor compilation errors and missing includes discovered during the header update process. --- src/audio/window.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/audio/window.cc') diff --git a/src/audio/window.cc b/src/audio/window.cc index d92f371..927a64e 100644 --- a/src/audio/window.cc +++ b/src/audio/window.cc @@ -1,9 +1,13 @@ +// This file is part of the 64k demo project. +// It implements the Hamming window function for spectral processing. +// Used to reduce spectral leakage during DCT operations. + #include "window.h" -#include "util/math.h" #include -void hamming_window_512(float window[WINDOW_SIZE]) { +void hamming_window_512(float *window) { + const float PI = 3.14159265358979323846f; for (int i = 0; i < WINDOW_SIZE; ++i) { - window[i] = 0.54f - 0.46f * cosf(2.0f * PI * i / (WINDOW_SIZE - 1)); + window[i] = 0.54f - 0.46f * cosf(2.0f * PI * (float)i / (float)(WINDOW_SIZE - 1)); } -} +} \ No newline at end of file -- cgit v1.2.3