TVec.DownSample Method

Overload List

#SignatureDescription
1function DownSample(const Src: TMtxVec; Factor: Integer; Phase: Integer): TVec;Downsamples vector values.
2function DownSample(const Src: TMtxVec; Factor: Integer; SrcIndex: Integer; Index: Integer; Len: Integer; Phase: Integer): TMtxVec;Downsamples object values.

Overload 1: function DownSample(const Src: TMtxVec; Factor: Integer; Phase: Integer): TVec;

Downsamples vector values.

#NameTypeDescription
1SrcTMtxVec
2FactorInteger
3PhaseInteger

Result: stored in self (calling object), returns self for chaining

Remarks:

The methods copies only every Factor sample from the Src vector to the calling vector. The TMtxVecBase.Length and TMtxVec.Complex properties of the calling vector are set implicitly. The phase parameter determines the initial sample offset. Phase must be less than Factor.

Examples
var a,b: TVec;
begin
    CreateIt(a,b);
    try
        b.SetIt(False,[0,0,0,0,1,2,3,4,5,6]);
        a.DownSample(b,2); // a = [0,0,1,3,5]
    finally
        FreeIt(a,b);
    end;
end;
See Also: TVec.UpSample, TDenseMtxVec.UpSample, TVec.PixelDownSample

Overload 2: function DownSample(const Src: TMtxVec; Factor: Integer; SrcIndex: Integer; Index: Integer; Len: Integer; Phase: Integer): TMtxVec;

Downsamples object values.

#NameTypeDescription
1SrcTMtxVecsource TVec or TMtx
2FactorInteger
3SrcIndexIntegersource start index
4IndexIntegerstart index
5LenIntegerelement count
6PhaseInteger

Result: stored in self (calling object), returns self for chaining

Remarks:

Copy only every Factor sample from Src starting at SrcIndex up to Len to the calling object starting at Index. The phase parameter determines the initial sample offset. Phase must be less then Factor. Size and TMtxVec.Complex properties of the calling object are set implicitly. An exception is raised if array borders are overrun/underrun.