Class WaveformPeaks
Multi-resolution min/max summary of a long signal, so that a waveform of millions of samples is drawn at any zoom level by reading at most a few values per pixel (used by WaveformView).
public sealed class WaveformPeaks
- Inheritance
-
WaveformPeaks
- Inherited Members
Remarks
Level k stores the minimum and maximum of blocks of BaseBlock × 4^k samples. Building is O(n) and memory is
about 2 × n / BaseBlock × 4/3 floats.
Constructors
WaveformPeaks(float[])
Builds the summary of one channel.
public WaveformPeaks(float[] samples)
Parameters
samplesfloat[]The samples (kept by reference: do not modify them afterwards).
Exceptions
- ArgumentNullException
samplesisnull.
Fields
BaseBlock
Samples per block of the finest level.
public const int BaseBlock = 64
Field Value
Properties
Length
Number of samples summarized.
public int Length { get; }
Property Value
Methods
Range(long, long)
Minimum and maximum of the samples in [start, end).
public (float Min, float Max) Range(long start, long end)