From 1ec9ec6bdc5583d991311b5d996f50b22ed046df Mon Sep 17 00:00:00 2001 From: Jan Post Date: Thu, 9 Feb 2023 06:25:25 +0100 Subject: [PATCH] Fix SDFT batchSize rounding (#12329) --- 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 67c39f52ff..c10bbc341f 100644 --- a/src/main/common/sdft.c +++ b/src/main/common/sdft.c @@ -55,7 +55,7 @@ void sdftInit(sdft_t *sdft, const int startBin, const int endBin, const int numB sdft->endBin = constrain(endBin, sdft->startBin, SDFT_BIN_COUNT - 1); sdft->numBatches = MAX(numBatches, 1); - sdft->batchSize = (sdft->endBin - sdft->startBin) / sdft->numBatches + 1; // batchSize = ceil(numBins / numBatches) + sdft->batchSize = (sdft->endBin - sdft->startBin + 1) / sdft->numBatches; for (int i = 0; i < SDFT_SAMPLE_SIZE; i++) { sdft->samples[i] = 0.0f; @@ -183,7 +183,7 @@ static FAST_CODE void applySqrt(const sdft_t *sdft, float *data) } -// Needed for proper windowing at the edges of startBin and endBin +// Needed for proper windowing at the edges of active range static FAST_CODE void updateEdges(sdft_t *sdft, const float value, const int batchIdx) { // First bin outside of lower range