From 4c4a9c78ec48dc26837b4a1eba6a8017e9b37e48 Mon Sep 17 00:00:00 2001 From: dwarning Date: Mon, 3 Jul 2023 10:07:32 +0200 Subject: [PATCH] ifft: in case input array is smaller then output array - fill in the rest with zero to prevent uninitialzed plot variables --- src/maths/cmaths/cmath4.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/maths/cmaths/cmath4.c b/src/maths/cmaths/cmath4.c index 0f9078950..50d772761 100644 --- a/src/maths/cmaths/cmath4.c +++ b/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);