Fits a line through recent readings, so a slow drift is visible before it matters.
Creates an empty trend estimator over up to capacity readings, 32 unless told fewer.
capacity
A line needs two readings, so capacity is at least 2.
Optional
How many readings the estimator keeps.
The fitted slope in units per reading, or null without two readings.
null
A positive slope is a rising signal.
Adds a reading.
Fits a line through recent readings, so a slow drift is visible before it matters.