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

This commit is contained in:
dwarning 2023-07-03 10:07:32 +02:00
parent e83fae11bc
commit 4c4a9c78ec
1 changed files with 4 additions and 0 deletions

View File

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