Detrend signal simply by subtracting a line through the first and last point of the trace

Parameters:data Data to detrend, type numpy.ndarray.
Returns:Detrended data. Returns the original array which has been modified in-place if possible but it might have to return a copy in case the dtype has to be changed.