1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Solved an issue in dsp::BallisticsFilter with peak and RMS envelopes calculation formulas

This commit is contained in:
Ivan Cohen 2020-09-21 17:16:55 +02:00 committed by reuk
parent 0ded1ccc5f
commit 5250dc815d
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11

View file

@ -92,13 +92,13 @@ SampleType BallisticsFilter<SampleType>::processSample (int channel, SampleType
{
jassert (isPositiveAndBelow (channel, yold.size()));
SampleType cte = (inputValue > yold[(size_t) channel] ? cteAT : cteRL);
if (levelType == LevelCalculationType::RMS)
inputValue *= inputValue;
else
inputValue = std::abs (inputValue);
SampleType cte = (inputValue > yold[(size_t) channel] ? cteAT : cteRL);
SampleType result = inputValue + cte * (yold[(size_t) channel] - inputValue);
yold[(size_t) channel] = result;