summaryrefslogtreecommitdiff
path: root/src/audio/fft.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-03-05 22:55:56 +0100
committerskal <pascal.massimino@gmail.com>2026-03-05 22:55:56 +0100
commit34afbd6ca21d2b960573d787e6eae46fa86b200e (patch)
tree08450aeff4c67fb300428e705910265e6cd59943 /src/audio/fft.cc
parent35c9ebb0a7ce0e726f631a2b04bb26098926cfab (diff)
style: run clang-format to adhere to coding style
Diffstat (limited to 'src/audio/fft.cc')
-rw-r--r--src/audio/fft.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/audio/fft.cc b/src/audio/fft.cc
index 6029454..ddd442e 100644
--- a/src/audio/fft.cc
+++ b/src/audio/fft.cc
@@ -143,7 +143,8 @@ void dct_fft(const float* input, float* output, size_t N) {
// IMDCT via FFT
// Produces 2N time-domain samples from N MDCT coefficients.
// Formula: x[n] = (2/N) * sum_{k=0}^{N-1} X[k] * cos(pi*(2n+1+N)*(2k+1)/(2N))
-// When windowed (Hann, length 2N) and OLA'd with hop N, gives perfect reconstruction.
+// When windowed (Hann, length 2N) and OLA'd with hop N, gives perfect
+// reconstruction.
void imdct_fft(const float* input, float* output, size_t N) {
const float PI = 3.14159265358979323846f;
const size_t M = 2 * N; // output length
@@ -172,7 +173,8 @@ void imdct_fft(const float* input, float* output, size_t N) {
imag[i] *= scale;
}
- // Post-multiply by 2N * exp(-j*pi*(2n+1)/(4N)) and take real part, scale by 2/N
+ // Post-multiply by 2N * exp(-j*pi*(2n+1)/(4N)) and take real part, scale by
+ // 2/N
const float gain = 2.0f;
for (size_t n = 0; n < M; n++) {
const float angle = -PI * (2.0f * n + 1.0f) / (4.0f * N);