You are here: Symbol Reference > MtxVec Namespace > Classes > TVec Class > public > TVec.CrossCorr Method
MtxVec VCL
ContentsIndex
PreviousUpNext
TVec.CrossCorr Method

The cross-correlation of two vectors.

Pascal
function CrossCorr(const Vec1: TVec; const Vec2: TVec; HiLag: integer; LoLag: integer; CorrelationNorm: TCorrNorm = cnDefault; const Buffer: TVecInt = nil): TVec;

Calculate the cross-correlation of two vectors Vec1 and Vec2. The parameter HiLag indicates the top of the range of lags at which the correlation estimates should be computed. The parameter LoLag indicates the bottom of the range of lags at which the correlation estimates should be computed. The results are stored in calling vector. The resulting elements are defined by the equation: 

 

 

The Buffer parameter allows the same work memory to be used between consecutive calls to this and other functions. The Buffer object will not be resized, if sufficient memory is present.

var a,b,c: TVec; begin CreateIt(a,b,c); a.SetIt(False,[1,-2,3,4]); b.SetIt(False,[2,-2,3,4]); c.CrossCorr(a,b,2,2); FreeIt(a,b,c); end;
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!