ar_energy: reduced zeroCrossingCount magnitude by 1/3

zero crossing counter is often larger than in the prototype by @troyhacks - due to calculation after filtering (catches more crossings), and due to the fixed condition for detecting zero crossings (doubles the number of crossings).

This patch reduces the final value to 2/3, so it typically stays below 256.
This commit is contained in:
Frank
2024-04-05 14:57:55 +02:00
committed by GitHub
parent e46b12f419
commit bf6932ecb7

View File

@@ -563,6 +563,7 @@ void FFTcode(void * parameter)
}
}
}
newZeroCrossingCount = (newZeroCrossingCount*2)/3; // reduce value so it typicially stays below 256
zeroCrossingCount = newZeroCrossingCount; // update only once, to avoid that effects pick up an intermediate value
// release highest sample to volume reactive effects early - not strictly necessary here - could also be done at the end of the function