Deconvolution of 1D Signals Blurred by a Gaussian Kernel
I've explained it once on StackOverflow.



Your signal can be represented as a vector, and convolution is multiplication with an N-diagonal matrix (where N is the length of the filter). I am assuming for the sake of the answer that the filter is much smaller than the signal

For example:

Your vector/signal is:

V1
V2
...
Vn


Your filter (convolving element) is:

  [b1 b2 b3];


So the matrix is nxn: (Let it be called A):

[b2 b3 0  0  0  0.... 0]
[b1 b2 b3 0  0  0.... 0]
[0  b1 b2 b3 0  0.... 0]
.....
[0  0  0  0  0  0...b2 b3]


Convolution is:

A*v;


And de-convolution is

A^(-1) * ( A) * v;


Obviously, in some cases de-convolution is not possible. These are the cases when you have singular A. Even matrixes that are not singular, but close to being singular, can be problematic, as they will have large numeric error. You can estimate it by computing the condition number of the matrix. 

If A has low condition, you can compute the inverse, and apply it on the result.



Now, let's see some examples in Matlab:

First, I've made a function that computes the convolution matrix.

function A = GetConvolutionMatrix(b,numA)
    A = zeros(numA,numA);
    vec = [b  zeros(1,numA-numel(b))];
    for i=1:size(A,1)
        A(i,:) = circshift(vec,[1 i]);
    end
end


Now, let's try to see what happens with different kernels:

    b = [1 1 1];
    A = GetConvolutionMatrix(b,10);
    disp(cond(A));


The condition number is :

 7.8541


This one is problematic, as expected. After averaging, it is hard to get back the original signal.

Now, let's try some milder averaging:

b = [0.1 0.8 0.1];
A = GetConvolutionMatrix(b,10);
disp(cond(A));


The result is:

1.6667


That goes well with our intuition, mild averaging of original signal is much easier to reverse.

We can also see how the inverse matrix looks like:

 figure;imagesc(inv(A));




Here is one line from the matrix:

  0.0003   -0.0026    0.0208   -0.1640    1.2910   -0.1640    0.0208   -0.0026    0.0003   -0.0001


We can see that most of the energy in each line is concentrated in 3-5 coefficients around the center. Therefore, in order to deconvolve, we can simply convolve the signal again with this approximation:

   [0.0208   -0.1640    1.2910   -0.1640    0.0208]


This kernel looks interesting! It is a sharpening operator. Our intuition is correct, sharpening cancels out blur.