Browse Source

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

pre-master-46
dwarning 3 years ago
committed by Holger Vogt
parent
commit
45e6d319f3
  1. 8
      src/maths/cmaths/cmath4.c

8
src/maths/cmaths/cmath4.c

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

Loading…
Cancel
Save