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_PeakTrough
Gets Wave Peaks and Troughs
Gets the points in a wave that are peaks or troughs.
View Source
<#.SYNOPSIS Gets Wave Peaks and Troughs .DESCRIPTION Gets the points in a wave that are peaks or troughs.#>
[double[]]$samples=$this.Samplesfor ($sampleNumber=1 ; $sampleNumber-lt ($samples.Length-1); $sampleNumber++) {
$isPeak=$samples[$sampleNumber] -gt$samples[$sampleNumber-1] -and$samples[$sampleNumber] -gt$samples[$sampleNumber+1]
if ($isPeak) {
[Numerics.Vector2]::new($sampleNumber,$samples[$sampleNumber])
continue
}
$isThrough=$samples[$sampleNumber] -lt$samples[$sampleNumber-1] -and$samples[$sampleNumber] -lt$samples[$sampleNumber+1]
if ($isThrough) {
[Numerics.Vector2]::new($sampleNumber,$samples[$sampleNumber])
continue
}
}