compare datapoint to previous threshold instead of current threshold
decouple the variance calculation from the baseline
resample the data after it has been filtered, if requested
merged back onto dev