From fb29036ba7a2f78e11f696a72d5bdc7c443752ea Mon Sep 17 00:00:00 2001 From: Jan Post Date: Thu, 19 Jan 2023 05:58:01 +0100 Subject: [PATCH] Fix SDFT batch process (#12218) Fix SDFT batch processing --- src/main/common/sdft.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/common/sdft.c b/src/main/common/sdft.c index a2feef738..67c39f52f 100644 --- a/src/main/common/sdft.c +++ b/src/main/common/sdft.c @@ -86,7 +86,7 @@ FAST_CODE void sdftPush(sdft_t *sdft, const float sample) // Add new sample to frequency spectrum in parts FAST_CODE void sdftPushBatch(sdft_t *sdft, const float sample, const int batchIdx) { - const int batchStart = sdft->batchSize * batchIdx; + const int batchStart = sdft->batchSize * batchIdx + sdft->startBin; int batchEnd = batchStart; const float delta = sample - rPowerN * sdft->samples[sdft->idx]; @@ -191,7 +191,7 @@ static FAST_CODE void updateEdges(sdft_t *sdft, const float value, const int bat const unsigned idx = sdft->startBin - 1; sdft->data[idx] = twiddle[idx] * (sdft->data[idx] + value); } - + // First bin outside of upper range if (sdft->endBin < SDFT_BIN_COUNT - 1 && batchIdx == sdft->numBatches - 1) { const unsigned idx = sdft->endBin + 1; -- 2.11.4.GIT