Remarks & hints

The maximum order of the polynomial fit is three. More complex trends may be removed by higher-order polynomial fits, but fits with an order higher than three may result in removal of actual low-frequency information in the input time series signal.