0
$\begingroup$

I was playing with the deconvolve method in scipy and I can't seem to get it working properly (I am still really new to DSP/deconvolution). I convolved a gaussian with a fwhm of 2.0e-9 with a simulated lidar return. My understanding is I should be able to use deconvolve from scipy with the same gaussian and the output of the convolution operation to get back the original lidar return, but instead I receive numbers with extremely high magnitudes:

convolved_output = np.convolve(lidar_return, gaussian, mode='same')

deconvolved_output = scipy.signal.deconvolve(convolved_output, gaussian)

deconvolved_ouput should be equal to lidar_return, but deconvolved output values make no sense:

array([ 7.78118027e-001,  1.09960030e-001,  9.32459273e-002,
        1.01568352e-001,  1.06121254e-001,  1.12864419e-001,
        7.11943641e-002, -5.02600631e+003, -8.66537116e+005,
        9.26383707e+008,  3.78170622e+011, -1.37174079e+014,
       -1.11875402e+017,  9.00155899e+018,  2.74827765e+022,
        3.25111371e+024, -5.66763475e+027, -1.83532870e+030,
        9.42559244e+032,  6.01205144e+035, -9.95973002e+037,
       -1.56642479e+041, -7.43370612e+042,  3.43785271e+046,
        8.32872653e+048, -6.25390056e+051, -3.11010910e+054,
        8.30120347e+056,  8.71129678e+059, -2.18155521e+061,
       -2.03372192e+065, -3.42272370e+067,  3.98969772e+070,
        1.55184120e+073, -6.12929324e+075, -4.72983116e+078,
        4.89311877e+080,  1.17572758e+084,  1.14836986e+086,
       -2.46662201e+089, -7.38173354e+091,  4.21604269e+094,
        2.50063070e+097, -4.81729474e+099, -6.64605556e+102,
       -1.80142109e+104,  1.48474568e+108,  3.27479553e+110,
       -2.76310234e+113, -1.28150438e+116,  3.84621299e+118,
        3.67153137e+121, -1.71398517e+123, -8.72468358e+126,
       -1.29045710e+129,  1.74588561e+132,  6.31683715e+134,
       -2.77356698e+137, -1.97902127e+140,  2.52516184e+142,
        5.01152787e+145,  3.89014932e+147, -1.07076960e+151,
       -2.95409635e+153,  1.87847112e+156,  1.03760556e+159,
       -2.29398331e+161, -2.81460150e+164, -1.82500636e+165,
        6.39980603e+169,  1.27575784e+172, -1.21718545e+175,
       -5.26377231e+177,  1.76786050e+180,  1.54433624e+183,
       -1.06399958e+185, -3.73596524e+188, -4.77120630e+190,
        7.62150090e+193,  2.56044068e+196, -1.24878335e+199,
       -8.26185855e+201,  1.26200106e+204,  2.13224424e+207,
        1.22616672e+209, -4.63849583e+212, -1.17474825e+215,
        8.33975805e+217,  4.29391686e+220, -1.07874288e+223,
       -1.18972106e+226,  1.72257914e+227,  2.75326321e+231,
        4.91510644e+233, -5.34701135e+236, -2.15476543e+239,
        8.06992701e+241,  6.48249099e+244, -5.95043179e+246,
       -1.59682400e+250, -1.71861015e+252,  3.31941500e+255,
        1.03298536e+258, -5.59730835e+260, -3.44099702e+263,
        6.16202208e+265,  9.05530106e+268,  3.37257499e+270,
       -2.00527364e+274, -4.63770707e+276,  3.69037905e+279,
        1.77190627e+282, -5.02062685e+284, -5.01918708e+287,
        1.80043965e+289,  1.18224864e+293,  1.86802022e+295,
       -2.34276555e+298, -8.78823888e+300,  3.66166359e+303,
        2.71530136e+306,              nan,              nan,
                    nan,              nan,              nan,
                    nan,              nan,              nan,
                    nan,              nan,              nan,
                    nan,              nan,              nan,
                    nan,              nan,              nan,
                    nan,              nan,              nan,
                    nan,              nan,              nan,
                    nan,              nan,              nan,
                    nan,              nan,              nan,
                    nan,              nan,              nan,
                    nan,              nan,              nan,
                    nan,              nan,              nan,
                    nan])

Is anyone familiar with why this would be occurring in general? I am more interested in understanding what the issue is from a deconvolution perspective than I am in understanding why the scipy method just doesn't work.

$\endgroup$
  • $\begingroup$ Does it work better if you use mode='full'? $\endgroup$ – endolith Apr 9 at 3:10
  • $\begingroup$ A gaussian has a lowpass type frequency response, so you are probably running into numerical errors during the doconvolution. $\endgroup$ – kippertoffee Apr 9 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.