diff --git a/src/frontend/com_fft.c b/src/frontend/com_fft.c index b141c8c29..ca7816008 100644 --- a/src/frontend/com_fft.c +++ b/src/frontend/com_fft.c @@ -181,7 +181,7 @@ com_fft(wordlist *wl) scale = (double) fpts - 1.0; fdvec[i][0].cx_real = out[0][0]/scale/2.0; fdvec[i][0].cx_imag = 0.0; - for (j = 1; j < fpts-1; j++) { + for (j = 1; j < fpts; j++) { fdvec[i][j].cx_real = out[j][0]/scale; fdvec[i][j].cx_imag = out[j][1]/scale; } @@ -419,7 +419,7 @@ com_psd(wordlist *wl) fdvec[i][0].cx_real = out[0][0]*out[0][0]/intres; fdvec[i][0].cx_imag = 0; noipower = fdvec[i][0].cx_real; - for (j = 1; j < fpts-1; j++) { + for (j = 1; j < fpts; j++) { fdvec[i][j].cx_real = 2.* (out[j][0]*out[j][0] + out[j][1]*out[j][1])/intres; fdvec[i][j].cx_imag = 0; noipower += fdvec[i][j].cx_real; diff --git a/src/maths/cmaths/cmath4.c b/src/maths/cmaths/cmath4.c index 427a21dc3..9252e2260 100644 --- a/src/maths/cmaths/cmath4.c +++ b/src/maths/cmaths/cmath4.c @@ -777,7 +777,7 @@ cx_fft(void *data, short int type, int length, int *newlength, short int *newtyp scale = (double) fpts - 1.0; outdata[0].cx_real = out[0][0]/scale/2.0; outdata[0].cx_imag = 0.0; - for (i = 1; i < fpts-1; i++) { + for (i = 1; i < fpts; i++) { outdata[i].cx_real = out[i][0]/scale; outdata[i].cx_imag = out[i][1]/scale; }