This paper defines the medium term as the residual component of time series after extracting secular trend and seasonal variation. To select an optimal detrending method, I apply a distance metric, which measures the distortionary effect of linear filters on the spectrum of detrended time series. In particular, the metric identified substantial distortions of conventional detrending methods, including first-differencing and deterministic linear detrending. After examining major detrending methods, the paper singles out the HodrickPrescott and Baxter-King filters as the least-distorting ones. The paper also illustrates the consequences of alternative approaches to detrend data by estimating the Almost Ideal Demand System in Japan for major consumption categories. As predicted by the distance metric, first – differencing introduced an excessive noise in the spectrum of detrended data, which resulted in the ‘masking’ of significant relationships in the estimated demand system. In contrast, detrending with Hodrick-Prescott and (sigma-adjusted) Baxter-King filters produced estimates that avoided the excesses of deterministic linear detrending and first differencing.