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:
parent
0ded1ccc5f
commit
5250dc815d
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue