Deconvolution in MATLAB
Last Updated :
21 Nov, 2022
Deconvolution is a mathematical method of extracting a given vector from another vector. It can be visualized as extracting a particular signal from an initial (vector A) signal after removing a second signal (vector B) from it. In mathematical terms, this can be understood as the division of two polynomials. Deconvolution is the inverse operation of convolution in MATLAB. Both of them are used in signal processing and image processing industries. MATLAB provides a simple function to extract the results of deconvolution, the deconv() function.
Syntax:
[quotient, remainder] = deconv(vecB, vecA)
Here, the deconv function deconvolves the vecA out of vecB and stores the quotient and remainder in variables. These 4 quantities are related by the following relation.
vecB = conv(vecA, quotient) + remainder
Now let us see a few examples of the same.
Using the deconv function to divide two polynomials of degree 3 and 1, respectively. Let vecA = x + 1 and vecB = x^3 – 1. Now, using the general form of a polynomial, the coefficient vectors will be vecA = [1 1] and vecB = [1 0 0 -1]. Now performing the deconvolution on the 2 vectors.
Example 1:
Matlab
vecB = [1 0 0 -1];
vecA = [1 1];
[qt,rem] = deconv(vecB,vecA);
disp(qt)
disp(rem)
|
Output:
This returns the coefficient vector of the quotient and remainder and according to this the polynomials are:
quotient = x^2 - x + 1
remainder = -2
Now let us divide another polynomial.
Example 2:
Matlab
vecB = [23 0 -3 0 1 13];
vecA = [4 -1 11];
[qt,rem] = deconv(vecB,vecA);
disp(qt)
disp(rem)
|
Output:
The quotient and remainder polynomial is:
quotient = 5.75*x^3 + 1.4375*x^2 - 16.2031*x - 8.0039
remainder = 171.2305 * x + 101.043
The results can be verified with the long-division method.
Share your thoughts in the comments
Please Login to comment...