Skip to content

Deconvolution

Sambit Paul edited this page Dec 24, 2021 · 5 revisions

Real Deconvolution

Deconvolution works when the convolution was performed in either of these 2 modes:

  1. Full: This returns the convolution at each point of overlap between kernel and signal.
  2. Same: This returns the convolution such that it maintains the same size as the original signal.

Deconvolution does not work for Valid mode because there aren't enough data points for recovering the original signal.

The parameters for this filter are as follows:

  • Mode of Operation ⇨ Can be "full", "same", "valid"
  • Kernel ⇨ 1-D Array the signal is convolved with


Convolved Signal: [2.0, 14.0, 26.0, 18.0, 37.0, 16.0, 49.0, 39.0, 36.0, 27.0, 0.0]
Kernel: [1.0, 3.0, 1.0, 3.0]
Code
String mode = "full"; //Can be "full", "same"
Deconvolution d2 = new Deconvolution(convolved, kernel);
double[] signal = d2.deconvolve(mode);
Recovered Signal: [2.0, 8.0, 0.0, 4.0, 1.0, 9.0, 9.0, 0.0]

Convolved Signal: [14, 26, 18, 37, 16, 49, 39, 36]
Kernel: [1.0, 3.0, 1.0, 3.0]
Code
String mode = "same"; //Can be "full", "same"
Deconvolution d2 = new Deconvolution(convolved, kernel);
double[] signal = d2.deconvolve(mode);
Recovered Signal: [2.0, 8.0, 0.0, 4.0, 1.0, 9.0, 9.0, 0.0]

Complex Deconvolution

Works similar to real deconvolution. However, for complex deconvolution, the input "convolved signal" has to be complex. The output maybe a complex or a real signal. Hence, two getOutput functions are available; depending on the datatype, the relevant function will work, the other one will throw an error if called.

Complex Convolved Signal: [2.2+2.2j, 2.3-6.7j, 15.9+4.94j, 10.7-23.88j, 16.45-3.01j]
Kernel: [1, 0, 1, 0.5]
Code
mode = "same";
Complex[] cConv = UtilMethods.matToComplex(complexConvolved);
ComplexDeconvolution dc1 = new ComplexDeconvolution(cConv, kernel);
dc1.convolve(mode)
double[][] signal = UtilMethods.complexTo2D(dc1.getComplexOutput());
Recovered Signal: [-1.6+2.4j, 2.2+2.2j, 3.9-9.1j, 14.5+1.54j, 5.7-15.88j]

Clone this wiki locally