# Downsampling - how many extra samples to include

I want to downsample a finite section of an equidistant time-series $$x_i, \qquad i=0\dots n-1$$ by doing an FFT and dropping the upper part of the spectrum. Since the FFT looks at $$x_i$$ as a cyclic series, it will show edge effects (ringing) near $$i=0$$ and $$i=n-1$$ caused by for example a jump between $$x_{n-1}$$ and $$x_0$$ in the cyclic view. Hence I need to include some extra samples left of $$x_0$$ and right of $$x_{n-1}$$, i.e. take the indices $$i=-m\dots n-1+m$$ into the FFT, where the corresponding samples $$x_{i<0}$$ and $$x_{i>n-1}$$ are either accessible values (measurements) or respresent a reasonable extrapolation (e.g. zero-padding, $$x=0$$). The extra samples are dropped again once the downsampling is completed.

Now the question is, how many samples should I add? It is clear that the 'sinc' function, which represents the antialiasing cutoff (and hence, the edge ringing) is infinitely extended. So, I can, of course, not expect to obtain an exact solution from adding a finite set of samples. On the other hand, some quick examples show that adding just one sample on either side is not enough in most cases, since this only goes one half swing of the 'sinc' function towards the boundary values.

What heuristics could lead me to choose a reasonably appropriate number of extra samples (probably by specifying an accuracy parameter)?

The image above shows the result of a downsampled time-series that originally started at 1, but has been extended by a bunch of zeroes to the left. Since the ringing is not only determined by the sample rate but also by the height of the original step (in this case =1), it is not so easy to determine when the ringing (sinc) has dropped 'enough'. Imagine the step scaled by 1000, then the ringing is also scaled by 1000.