From 053363f85d4db42bc90f4deca744193c7d02412d Mon Sep 17 00:00:00 2001 From: Gerald Fournier <> Date: Wed, 11 Feb 2026 22:27:28 +0200 Subject: [PATCH] Fix freq bins in fft --- src/frontend/com_fft.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/frontend/com_fft.c b/src/frontend/com_fft.c index 2d592525b..82ea72ca8 100644 --- a/src/frontend/com_fft.c +++ b/src/frontend/com_fft.c @@ -60,6 +60,9 @@ com_fft(wordlist *wl) length = (plot_cur->pl_scale)->v_length; time = (plot_cur->pl_scale)->v_realdata; span = time[length-1] - time[0]; + if (length > 1) { + span += time[1] - time[0]; + } #ifdef HAVE_LIBFFTW3 fpts = length/2 + 1; @@ -75,7 +78,7 @@ com_fft(wordlist *wl) #endif win = TMALLOC(double, length); - maxt = time[length-1]; + maxt = span + time[0]; if (!cp_getvar("specwindow", CP_STRING, window, sizeof(window))) strcpy(window, "hanning"); if (!cp_getvar("specwindoworder", CP_NUM, &order, 0))