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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user