91 jassert (isPositiveAndBelow (channel, yold.size()));
93 if (levelType == LevelCalculationType::RMS)
94 inputValue *= inputValue;
96 inputValue = std::abs (inputValue);
98 SampleType cte = (inputValue > yold[(size_t) channel] ? cteAT : cteRL);
100 SampleType result = inputValue + cte * (yold[(size_t) channel] - inputValue);
101 yold[(size_t) channel] = result;
103 if (levelType == LevelCalculationType::RMS)
104 return std::sqrt (result);