Remove linear trend along axis from data.
Parameters : | data : array_like
axis : int, optional
type : {‘linear’, ‘constant’}, optional
bp : array_like of ints, optional
|
---|---|
Returns : | ret : ndarray
|
Examples
>>> randgen = np.random.RandomState(9)
>>> npoints = 1e3
>>> noise = randgen.randn(npoints)
>>> x = 3 + 2*np.linspace(0, 1, npoints) + noise
>>> (sp.signal.detrend(x) - noise).max() < 0.01
True