TVec CrossCorr(TVec Vec1, TVec Vec2, Int32 HiLag, Int32 LoLag, TCorrNorm CorrelationNorm, TVecInt Buffer)
The cross-correlation of two vectors.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec1 | TVec | source TVec |
| 2 | Vec2 | TVec | source TVec |
| 3 | HiLag | Int32 | |
| 4 | LoLag | Int32 | |
| 5 | CorrelationNorm | TCorrNorm | |
| 6 | Buffer | TVecInt | source TVecInt |
Result: stored in self (calling object), returns self for chaining
Remarks:
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.
Examples
TVec a;
TVec b;
TVec c;
MtxVec.CreateIt(out a, out b, out c);
a.SetIt(false,new double[] {1,-2,3,4});
b.SetIt(false,new double[] {2,-2,3,4});
c.CrossCorr(a,b,2,2);
MtxVec.FreeIt(ref a, ref b, ref c);