## MSdDeconvCof

#### Routine

int MSdDeconvCof (const double u[], int Nu, const double v[], int Nv, double q[], double r[])

#### Purpose

Polyomial divide (deconvolve the coefficients of two vectors)

#### Description

This routine divides one polynomial by another. Given polynomials U(D) and V(D), the polynomial division U(D)/V(D) gives quotient Q(D) and remainder R(D), where

      U(D) = Q(D) V(D) + R(D).

Polynomial U(D) is represented as

      U(D) = u[0] + u[1] D + u[2] D^2 + ... + u[Nu-1] D^(Nu-1).

The quotient Q(D) normally has Nu-Nv+1 terms. The remainder R(C) normally has Nv-1 terms.

#### Parameters

<- int MSdDeconvCof
  Number of quotient coefficients. This is normally Nu-Nv+1. If some of the higher order terms in v are zero, this may be as large as Nu. If the last non-zero term in v is v[k], then the number of quotient coefficients is returned as Nu-k.
-> double u[]
  Input vector of coefficients (Nu values)
-> int Nu
  Number of coefficients in u
-> double v[]
  Input vector of coefficients (Nv values)
-> int Nv
  Number of coefficients in v. If Nu < Nv, the quotient is empty and the remainder is equal to u.
<- double q[]
  Output vector of Nu coefficients representing the quotient of the polynomial division. The quotient vector can be the same as the vector u. If v[k] is the last non-zero coefficient of v, the last k coefficients of q will be zero.
<- double r[]
  Output vector of Nu coefficient representing the remainder of the polynomial division. If r is NULL, the remainder is not calculated. The remainder satisfies R(D) = U(D) - Q(D) U(D). If v[k] is the last nonzero coefficient of v (k can be ascertained from the function return value which is Nu-k), the last Nu-k terms of R(D) will be zero.

#### Author / revision

P. Kabal / Revision 1.3 2003/05/09

Main Index libtsp