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.
Similar Reads
Filter Function in MATLAB The filter function or 1-D digital filter is a function in MATLAB that is used to filter a given noisy data by removing the noise in the data and sharpening or smoothing the input function. As MATLAB provides a dedicated Signal Processing Toolset, the filter function comes handy to remove noise from
3 min read
User defined function in MATLAB Functions let you do a specific task. User defined functions are the functions created by the users according to their needs. This article explains how the user defined function in MATLAB is created. Syntax : function [a1,...,an] = func(x1,...,xm) func is the function name a1,...,an are outputs x1,.
2 min read
Convolution Shape (full/same/valid) in MATLAB Convolution is a mathematical operation. It is used in Image processing in MatLab. A mask/filter is used to convolve an image for image detection purposes. But MatLab offers three types of convolution. Here we shall explain the simple convolution. The filter slides over the image matrix from left to
6 min read
Alternatives To Eval Function in MATLAB The eval function is one of MATLAB's most powerful and flexible commands. Eval is an acronym for evaluating, which is exactly what it does: it evaluates MATLAB expressions. Any command that can be executed from the MATLAB prompt may be executed from a Mfile using eval. Use of Eval Function:The Eval
3 min read
Installing MATLAB on Linux MATLAB is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other language
3 min read
Convolution Theorem for Fourier Transform MATLAB A Convolution Theorem states that convolution in the spatial domain is equal to the inverse Fourier transformation of the pointwise multiplication of both Fourier transformed signal and Fourier transformed padded filter (to the same size as that of the signal). In other words, the convolution theore
3 min read