Open In App

Deconvolution in MATLAB

Last Updated : 21 Nov, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

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

% MATLAB code for coefficients of x^3 - 1
vecB = [1 0 0 -1];
 
% Coefficients of x + 1
vecA = [1 1];
 
% Deconvolving
[qt,rem] = deconv(vecB,vecA);
 
% Displaying coefficients of quotient and remainder polynomial
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. 

pol1 =23* x^5 - 3*x^3 + x +13 pol2 = 4*x^2 - x +11

Example 2:

Matlab

% MATLAB code for Coefficients of 23*x^5 - 3*x^3 + x + 13
vecB = [23 0 -3 0 1 13];
 
% Coefficients of 4*x^2 - x + 11
vecA = [4 -1 11];
 
% Deconvolving
[qt,rem] = deconv(vecB,vecA);
 
% Displaying coefficients of quotient and remainder polynomial
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.



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads