Class PerSensorAdaptiveRmsScaler

Per-sensor adaptive RMS scaler with peak-hold decay. Zero-centered mapping: [-scale .. +scale] → [0..1]. Each cell tracks its own RMS envelope and auto-scales independently. Handles grid resize by re-allocating state (new cells start fresh).

Inheritance
PerSensorAdaptiveRmsScaler
Implements
Namespace: MOSAIC.Visualization.Heatmap
Assembly: MOSAIC.dll
Syntax
public sealed class PerSensorAdaptiveRmsScaler : IHeatmapScaler

Fields

_configuredCount

Declaration
private int _configuredCount
Field Value
Type Description
int

_emaSq

Declaration
private double[]? _emaSq
Field Value
Type Description
double[]

_last

Declaration
private DateTime _last
Field Value
Type Description
DateTime

_scale

Declaration
private double[]? _scale
Field Value
Type Description
double[]

Properties

EmaAlpha

EMA smoothing factor (0.05..0.3). Higher = faster envelope tracking.

Declaration
public double EmaAlpha { get; set; }
Property Value
Type Description
double

Epsilon

Minimum scale to avoid divide-by-zero.

Declaration
public double Epsilon { get; set; }
Property Value
Type Description
double

HalfLifeSeconds

Peak-hold decay half-life in seconds. Shorter = faster re-centering.

Declaration
public double HalfLifeSeconds { get; set; }
Property Value
Type Description
double

K

Scale multiplier relative to RMS. √2 clips sine peaks at ±1.

Declaration
public double K { get; set; }
Property Value
Type Description
double

Methods

Configure(int)

Called whenever the grid size changes (length = rows*cols). Implementations must handle any cell count gracefully — never throw.

Declaration
public void Configure(int cellCount)
Parameters
Type Name Description
int cellCount

MapFrame(ReadOnlySpan<double>, WeightedPoint[], int[]?, Func<double, double>?, out LegendInfo)

Map an input frame to weights in LiveChartsCore.Defaults.WeightedPoint.Weight.

Declaration
public void MapFrame(ReadOnlySpan<double> frame, WeightedPoint[] points, int[]? indexMap, Func<double, double>? valueTransform, out LegendInfo legend)
Parameters
Type Name Description
ReadOnlySpan<double> frame
WeightedPoint[] points
int[] indexMap
Func<double, double> valueTransform
LegendInfo legend

Implements

IHeatmapScaler

Search documentation

Start typing to search the documentation.