procedure DeConv(B: TVec; A: TVec; Quot: TVec; Remain: TVec);
Divide polynomials, deconvolution.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | B | TVec | source TVec |
| 2 | A | TVec | source TVec |
| 3 | Quot | TVec | source TVec |
| 4 | Remain | TVec | source TVec |
Result: stored in self (calling object)
Remarks:
The procedure deconvolves vector A out of vector B. If vectors A and B are treated as polynomial coefficients, the the deconvolution is equal to polynomial division. In this case the DeConv divides polynomial B with polynomial A and returns the quotient in Quot and remainder in Remain. An exception is raised if A and B complex properties do not match. An exception is raised if |A.Values[0]| = 0.
NOTE
To perform polynomial multiplication, use the TVec.Convolve method.
Examples
uses MtxExpr, Math387, MtxVec, MtxVecEdit, MtxVecTee,Polynoms;
procedure TForm1.Button1Click(Sender: TObject);
var A, B, AR, BR, Q, R: Vector;
begin
// Case 1
Ar.SetIt(false,[1,2]); // Define roots of the polynomial A:
PolyCoeff(Ar,A); // get coefficients = (X - 1)* (X - 2)
Br.SetIt(false,[1,2,2]); // Define roots of the polynomial B:
PolyCoeff(Br,B); //get coefficents = (X - 1)* (X - 2) * (X - 2)
DeConv(B,A,Q,R);
// Q = [ 1, -2 ] // = polynomial: x - 2
// R = [ 0 ]
ViewValues(Q,'Q',true);
ViewValues(R,'R',true);
// Case 2
B.SetIt(true,[2,-1, 2,3, 0,5]);
A.SetIt(true,[0,2, 1,-3, 2,2]);
DeConv(B,A,Q,R);
// Q = [ -0.5 - i ]
// R = [ 0 , 5.5 + 2.5i, -1 + 8i]
ViewValues(Q,'Q',true);
ViewValues(R,'R',true);
end;