Added in difference calculation for new samples

Calculating change in slope of signal