# Standard deviation of Gaussian corresponding to perfect low pass filter [1,1]

For a time discrete signal, the rect-filter (for 1D signal [1,1]) is a perfect low pass filter. I was wondering, what is the best gaussian approximation of this filter?

For a current problem, I cannot use binomial filters but have to use Gaussian filters for smoothing. Ths question is thus, what is the standard deviation of a Gaussian filter best approximating the [1,1] rect-filter. 'Best' could e.g. mean is has similar probperties in the frequency domain.

Suppose you want a low pass filter supported on $f \in [-1,1]$. The Fourier transform of a Gaussian is a Gaussian. So let's assume our Gaussian filter has a frequency response of the form $G_\sigma(f) = \frac{1}{\sigma \sqrt{2 \pi}} e^{-f^2/\sigma^2}$. For the best Gaussian fit in least squares sense, let us minimize the squared error ($\mathsf{SE}$): $$\mathsf{SE}(\sigma) = \int_{-1}^1 |G_\sigma(f)-1|^2 \;\;\; d\,f$$ by choice of $\sigma$. This calls for some numerical evaluation.

I used Mathematica:

Integrate[ (1/s/Sqrt[2 Pi] Exp[-f^2/s^2] - 1)^2, {f, -1, 1}]


which gave me

2 - Sqrt Erf[1/s] + 1/(2 Sqrt[2 Pi] s) Erf[ Sqrt/s ]


Then plot the result as a function of $\sigma$ (i.e. s).

I see a minimum around $\sigma =0.7$.