Abstract This study proposes a spectral domain algorithm to remove the deterministic non-periodic trend from a time series using a class of fast, sharp and diffusive filters. These filters are principally the iterative moving least squares methods weighted using Gaussian windows. The responses of the filters expressed in analytic forms are proven to be diffusive. If it is a polynomial of finite degree, the embedded trend can be decoupled by the filters with specific order and iteration steps. The filters’ order, transition zone, error tolerance, iteration number and smoothing factor are subject to two algebraic equations to form a specific class. The operation counts of all filters are slightly larger than twice that applying a Fast Fourier Transform (FFT). It is numerically shown for a given transition zone and tolerance, there is a filter generating the shortest error penetration distance among all the filters. If either the trend or a spectral band is the main concern, there is an optimal strategy to shrink the error penetration distance. The numerical results show the filter has better performance than several existing methods. In addition, four examples successfully show direct applications of the filter’s response.