Skip to content

Commit

Permalink
Add Energy to StatisticsAccumulator
Browse files Browse the repository at this point in the history
  • Loading branch information
cjappl committed Feb 29, 2024
1 parent e265be5 commit 76e9d09
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/juce_core/maths/juce_StatisticsAccumulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ class StatisticsAccumulator
: FloatType();
}

/** Returns the energy of all the previously added values.
If no values have been added yet, this returns zero.
**/
FloatType getEnergy() const noexcept
{
return count > 0 ? sumSquares: FloatType();
}

/** Returns the standard deviation of all previously added values.
If no values have been added yet, this will return zero.
*/
Expand Down

0 comments on commit 76e9d09

Please sign in to comment.