1

I am not a mathematician by training, so excuse my lack of vocabulary or the imprecision in my question.

I have a 1D distribution that I need to convolute, using a Gaussian kernel. However, all the functions that are out there, be it MATLAB, python, mathematica or R are dedicated to image blurring and have a single scalar value for the sigma of the Gaussian distribution. For example:

[Python gaussian filter function][1]

However, the distribution I have, has different sigma along the x-axis, if that makes sense.

Is there a way to create a Gaussian kernel used for smoothing that has different sigma values along the x-axis?

Thanks is advance.

Melclic
  • 23
  • You'll have to clarify what you want. The sigma parameter is for the gaussian you're convoluting with, not for your distribution, so what you're asking doesn't really make sense.

    On the other hand, maybe you want to convolve with a mixture of gaussians (i.e. a linear combination of Gaussians) with different sigmas? If that's the case, by linearity of convolution you can convolve against each individual gaussian and add up the result.

    – Alex R. Sep 11 '15 at 18:03
  • Thanks for the response. Yes the second case, I think is what I want. Practically convolving with a series of gaussians that have a different sigma value along the array would work. However googling "linearity of convolution" does not yeild any results or explanations. Any links? Cheers – Melclic Sep 16 '15 at 16:39
  • see answer below. – Alex R. Sep 16 '15 at 18:27

1 Answers1

2

Suppose you have a linear combination of Gaussians:

$$k(x)=a_1N_1(x)+\cdots+a_n N_n(x),$$

where each gaussian $N_i(x):=\frac{1}{\sqrt{2\pi \sigma_i^2}}e^{-(x-\mu_i)^2/2\sigma_i^2}.$ Then if your function is $f(x)$ then

$$[f\star k](t)=\sum_{i=1}^n a_i [f\star N_i](t).$$

It sounds like your program knows how to calculate $[f\star N_i](t)$, so the answer will be the sum of convolutions for each $N_i$.

Alex R.
  • 32,771