Browse Source

ifft: in case input array is smaller then output array - fill in the rest with zero to prevent uninitialzed plot variables

pre-master-46
dwarning 3 years ago
committed by Holger Vogt
parent
commit
794a37339a
  1. 4
      src/maths/cmaths/cmath4.c

4
src/maths/cmaths/cmath4.c

@ -940,6 +940,10 @@ cx_ifft(void *data, short int type, int length, int *newlength, short int *newty
in[i][0] = indata[i].cx_real;
in[i][1] = indata[i].cx_imag;
}
for (i = length; i < tpts; i++) {
in[i][0] = 0.0;
in[i][1] = 0.0;
}
plan_backward = fftw_plan_dft_1d(tpts, in, out, FFTW_BACKWARD, FFTW_ESTIMATE);

Loading…
Cancel
Save