You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
James Brundage edited this page Oct 23, 2026
·
1 revision
get_AverageVolume
Gets Average Volume
Gets the Average Volume from a wave, using the Root Mean Square
View Source
<#.SYNOPSIS Gets Average Volume.DESCRIPTION Gets the Average Volume from a wave, using the Root Mean Square.LINK https://en.wikipedia.org/wiki/Root_mean_square#>param()
# Get our samples as a `[double[]]`
[double[]]$samples=$this.Samples# If we had no samples, # the average volume is obviously zeroif (-not$samples) { return0 }
# If we had any samples, square them
[double[]]$Squared=@(foreach ($samplein$samples) {
$sample*$sample
})
# then average the squares and get the square root.return [Math]::Sqrt([Linq.Enumerable]::Average($Squared))