What are the limitations on the divisor argument for scipy.signal.deconvolve to ensure numerical stability?

Here is my problem: I am going to process the data coming from the system, for which I will have a good idea of ​​an impulse response. Before using Python for some basic scenarios, I introduced the functions scipy.signal.convolve and scipy.signal.deconvolve. To gain some confidence in my final decision, I would like to understand their requirements and limitations.

I used the following test:
1. I built a basic signal made of two Gaussians. 2. I built a Gaussian impulse response.
3. I linked my initial signal to this impulse response.
4. I deconstructed this minimized signal.
5. I compared this last signal with my first. The result of this test depended strongly on how I determined my impulse response: either I was able to restore the original signal, or the deconvolution signal diverged greatly.

Here is the code:
I am using python 3.4.2, numpy 1.8.2 and scipy 0.14.0.

import numpy as np from scipy import signal def gauss(x, amp = 1, mean = 0, sigma = 1): return amp * np.exp(-(x - mean)**2 / (2 * sigma**2)) step = 0.1 x_os = np.arange(0, 200 + step, step) low = -5 # lower bound of the interval for the impulse response up = 5 # upper bound of the interval for the impulse response x_ir = np.arange(low, up + step, step) y_os1 = gauss(x_os, 160, 80, 5.0) y_os2 = gauss(x_os, 20, 20, 2.0) y_os = y_os1 + y_os2 # original signal y_ir = gauss(x_ir, 1 / (np.sqrt(2 * np.pi)), 0.0, 1.0) # impulse response y_c = signal.convolve(y_os, y_ir, 'full') # convoluted signal y_d, _ = signal.deconvolve(y_c, y_ir) # deconvoluted signal 

In the previous code, the divisor argument for scipy.signal.deconvolve is y_ir. I played with parameters defining the interval at which y_ir is defined, for example. [low, up, step]. To show you what puzzles me, let's take the following three sets:
1) [-5, 5, 0.1] ,
2) [-2, 2, 0.1] ,
3) and [-2, 2, 0.5] (note that the step was not changed in the definition of y_os).

The following images show the original signal along with the deconvolution signal for the three aforementioned sets.
Original signal
Deconvolution Signal Comparison

Can anyone explain this behavior? Are there any divisor requirements that guarantee the correct behavior of this function?

Thanks in advance.

+2
python numpy scipy numerical-stability deconvolution
source share

No one has answered this question yet.

See similar questions:

fifteen
Understanding scipy deconvolve

or similar:

400
In Matplotlib, what does this argument mean in fig.add_subplot (111)?
fifteen
Understanding scipy deconvolve
7
Is there an equivalent to scipy.signal.deconvolve for 2D arrays?
5
Quaternions and numerical stability
5
Strategies for debugging problems with numerical stability?
4
Fourier transform / iterative deconvolution in python using numpy / scipy
2
ODE System Numerical Stability
2
The output of scipy.signal.deconvolve () does not seem to be the expected result
0
How to ensure numerical stability while minimizing (NLL)?
0
Failed to propagate scipy.signal.filt.filt example to high pass filter

All Articles