From 5610302c77c4bf88a8dc7e4adbf799bdff23e47c Mon Sep 17 00:00:00 2001 From: Gerald Fournier <> Date: Mon, 16 Feb 2026 01:59:00 +0200 Subject: [PATCH] Fix nyquist bin normalization --- src/frontend/com_fft.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/frontend/com_fft.c b/src/frontend/com_fft.c index df73946a7..797fe3b63 100644 --- a/src/frontend/com_fft.c +++ b/src/frontend/com_fft.c @@ -189,6 +189,12 @@ com_fft(wordlist *wl) fdvec[i][j].cx_imag = out[j][1]/scale; } + /* for even-length input, the nyquist bin is paired with itself + and normalization does not require a factor of 2 */ + if ( length % 2 == 0) { + fdvec[i][fpts-1].cx_real /= 2; + fdvec[i][fpts-1].cx_imag /= 2; + } } fftw_destroy_plan(plan_forward);