2

I have a Gaussian Function -

$$G(a,x) = \sqrt{\frac{6.0}{\pi \cdot a^2}}\cdot \exp\left(\frac{-6.0x^2}{a^2}\right)$$

and I want to filter it with a tophat kernel

$$ f(x,\xi) = \left\{\begin{aligned} &\frac{1}{\Delta} &&: |x-\xi| < \frac {\Delta}{2}\\ &0 &&: |x-\xi| \ge \frac{\Delta}{2} \end{aligned} \right.$$

Is it possible to derive an analytical expression for filtered function?

For example if I we wish to filter G with a Gaussian filter then I can do it analytically.

I hope it is clear enough.If not please let me know. Thanks in advance

Asaf Karagila
  • 393,674

1 Answers1

2

Yes, an analytical expression is possible. However, it includes the Gaussian Error Function (erf), so it may not be simple to calculate (although many numerical programming packages include a fairly accurate/efficient approximation).

The general ingredients:

  1. Convolution is a linear operation $$A * (B + C) = (A * B) + (A * C)$$
  2. The tophat kernel is equivalent to the sum of two scaled and translated versions of the Heaviside step function (one right-side-up for the leading edge, the other inverted to get it back to 0) $$f(x) = \frac{H(x + \frac\delta2) - H(x - \frac\delta2)}\delta$$
  3. Convolution with the Heaviside step function is basically integration $$(f * H) = \int_{-\infty}^x f(z)dz$$
  4. The integral of a Gaussian function is a Gauss error function.

So you can split your tophat kernel into two modified Heaviside step functions, and split your convolution as well. Treat each convolution as integration to get your Gaussian Error Functions, and recombine - I expect the end result will be the difference of two GEFs.

cloudfeet
  • 375
  • Is it possible to get the final answer as a Gaussian function? As I want to compare the answer with filtering using Gaussian kernel. – user94517 Sep 12 '13 at 16:32
  • Only inside an integral, I'm afraid. – cloudfeet Sep 13 '13 at 07:49
  • 2
    The result of convolving a Gaussian with a tophat is not Gaussian-ish. It is the difference of two Gaussian Error Functions (which is the integral of your Gauss function). I'm afraid the comparison will not be as simple as you hoped. – cloudfeet Sep 13 '13 at 07:50