Normalization constructor
const
Normalization({})
A parameter class that primarily pertain to XLayer
s
for customizing the intake of SensorEvent
data.
- autocompensates, a flag for toggling autocompensation after steady sensor samples for some time
- delay, how long to wait before kicking in autocompensation, considering sensitivity to past samples in a buffer
- compensation, an amount to shear from raw
AccelerometerEvent
data (x
ory
axis, as gyroscope is used forz
data) - scalar, an amount to multiply by the calculated sensor parallax factor
- samplingRate, how frequently sensor data samples are propagated
- sensitivity, a
double
clamped between0..1
, that influences the maximumList
length for a sensors data samples buffer.- A larger
sensitivity
and thus smaller samples buffer means new, strong outlier accelerometer data stands out more easily from the average of the past samples in the buffer
- A larger
❗ NOTE:
There is a fine balance between sensitivity
and samplingRate
.
It is recommended to keep them default and modify delay
as necessary.
Implementation
const Normalization({
this.autocompensates = true,
this.delay = const Duration(milliseconds: 1000),
this.compensation = Compensation.none,
this.scalar = const [1.0, 1.0, 1.0],
this.samplingRate = const Duration(milliseconds: 10),
this.sensitivity = 0.9,
}) : assert(sensitivity >= 0 && sensitivity <= 1);