coherenceTrend property

int get coherenceTrend

Whether coherence is trending up (+1), down (-1), or stable (0).

Implementation

int get coherenceTrend {
  if (_coherenceHistory.length < 5) return 0;
  final recent = _coherenceHistory.last;
  final prev = _coherenceHistory[_coherenceHistory.length - 5];
  if (recent - prev > 0.05) return 1;
  if (prev - recent > 0.05) return -1;
  return 0;
}