0

I am trying to compute Deconvolution using Python. I have a signal let say f(t) which is the convoluted by the window function say g(t). Is there some direct way to compute the deconvolution so I can get back the original signal?

For instance f(t) = exp(-t**2/3); Gaussian function and g(t) = Trapezoidal function

Thanks in advance for your kind suggestion.

1 Answers1

0

Is this an analytical or numerical problem?

If it's numerical, use scipy.signal.devconvolve: http://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.deconvolve.html

From the docs:

>>> from scipy import signal
>>> sig = np.array([0, 0, 0, 0, 0, 1, 1, 1, 1,])
>>> filter = np.array([1,1,0])
>>> res = signal.convolve(sig, filter)
>>> signal.deconvolve(res, filter)
(array([ 0.,  0.,  0.,  0.,  0.,  1.,  1.,  1.,  1.]),
 array([ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.]))

Otherwise, if you want an analytic solution, you might be using the wrong tool.

Additionally, just a tip for future google-ing, when you're talking about convolution, the action is usually/often "convolved" not "convoluted", see https://english.stackexchange.com/questions/64046/convolve-vs-convolute

Community
  • 1
  • 1
Joan Smith
  • 931
  • 6
  • 15
  • @user3284855 Did this answer your question? If so, please mark as answered by clicking the check mark. If not, what can be done to improve the answer? What didn't work? – Joan Smith Feb 28 '14 at 15:30
  • Dear Joan Thanks again for your concern. I am still looking for more precise answer. I am looking for the convolution where the output result is as the function of input signal variable. Is there some way to compute the direct convolution of a function lets say f(x) with g(x) and the convolved one is, say f'(x)? It works for an array but gives result with another array with different shape. How can the result expressed as a function of x? Thanks again for your (or any other experts) suggestions. – user3284855 Feb 28 '14 at 17:29
  • Although there is a docstring for `deconvolve` it still doesn't seem to do what you'd expect, like `Deconvolve(Convolve(f,g) , g) == f`. I asked a question (http://stackoverflow.com/questions/40615034/understanding-scipy-deconvolve) about that, so maybe someone can help out there. – ImportanceOfBeingErnest Nov 15 '16 at 18:04