partly revert last commit: only real input vector get special scaling for dc component

This commit is contained in:
dwarning 2023-02-18 17:14:13 +01:00 committed by Holger Vogt
parent bccaee4821
commit 45e6d319f3
1 changed files with 2 additions and 6 deletions

View File

@ -713,9 +713,7 @@ cx_fft(void *data, short int type, int length, int *newlength, short int *newtyp
outdata = alloc_c(fpts);
scale = (double) fpts;
outdata[0].cx_real = out[0][0]/scale/2.0;
outdata[0].cx_imag = out[0][1]/scale/2.0;
for (i = 1; i < fpts; i++) {
for (i = 0; i < fpts; i++) {
outdata[i].cx_real = out[i][0]/scale;
outdata[i].cx_imag = out[i][1]/scale;
}
@ -746,9 +744,7 @@ cx_fft(void *data, short int type, int length, int *newlength, short int *newtyp
outdata = alloc_c(N);
scale = (double) N;
outdata[0].cx_real = datax[0]/scale/2.0;
outdata[0].cx_imag = datax[1]/scale/2.0;
for (i = 1; i < N; i++) {
for (i = 0; i < N; i++) {
outdata[i].cx_real = datax[2*i]/scale;
outdata[i].cx_imag = datax[2*i+1]/scale;
}