deconv

Deconvolution and polynomial division.

Category: Mathematics > Elementary Math

Syntax

[q, r] = deconv(v, u)

Divides v by u, returning the quotient q and the remainder r, so that v = conv(u, q) + r.

Description

deconv is long division of polynomials written as coefficient vectors, highest power first. It undoes conv: deconv(conv(u, q), u) returns q with a zero remainder. For example, dividing x^3 + 3x^2 + 5x + 3 by x + 1 gives x^2 + 2x + 3.

When the division is not exact, r is nonzero and holds the leftover terms.

Input arguments

v
Dividend: a vector (signal or polynomial coefficients).
u
Divisor: a vector whose first element is nonzero.

Output arguments

q
Quotient vector, of length numel(v) - numel(u) + 1.
r
Remainder, the same length as v.

Example

Polynomial division

[q, r] = deconv([1 3 5 3], [1 1])
[q, r] = deconv([1 2 3 4], [1 1])
Output
q = 1×3

     1     2     3
r = 1×4

     0     0     0     0
q = 1×3

     1     1     2
r = 1×4

     0     0     0     2

See also

conv polyval roots filter