handwritten counterpart of peak2peak() function in matlab
replaced peak2peak() with Peak2Peak()