Fix nyquist bin normalization

This commit is contained in:
Gerald Fournier 2026-02-16 01:59:00 +02:00 committed by dwarning
parent ce3f3c6221
commit 5610302c77
1 changed files with 6 additions and 0 deletions

View File

@ -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);