x is called design matrix. each element (1,Xi)
b : vector of parameters
e : error vector
y : response vector

If (x,y) pair is from a 1-d discrete signal with a fixed sample period,
so x is the sample time number 1,2,3,4,5,6,..... with respect to y1,y2,y3..
so (x,y) pair is (1,y1), (2,y2),(3,y3)...(n,yn)
The simplified detrend (linear regression) can be:
the Residuals are e = y - x * b, this is a detrend data in epsilon.
where b = inv(x*x') *x'*y