mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
Fix SDFT batchSize rounding (#12329)
This commit is contained in:
parent
0ac9962bd4
commit
1ec9ec6bdc
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue