2.3.4 VectorCorrelate
Description
VectorCorrelate computes the correlation between two source vectors and stores the result in a destination vector. The result is computed as follows:
Prototype
fractional* VectorCorrelate (int numElems1, int numElems2, fractional* dstV, fractional* srcV1, fractional* srcV2);
Arguments
Parameters |
Description |
---|---|
numElems1 |
Number of elements in the source one vector (N) |
numElems2 |
Number of elements in the source two vector (M, with M ≤ N) |
dstV |
Pointer to the destination vector (of size N+M-1) |
srcV1 |
Pointer to the source one vector |
srcV2 |
Pointer to the source two vector |
Returns
Pointer to the base address of the destination vector.
Remarks
The number of elements in the source two vector must be less than or equal to the number of elements in the source one vector.
The destination vector must already exist, with exactly numElems1+numElems2-1 number of elements.
This function can be self-applicable.
This function uses VectorConvolve.
Source File
- vcor_aa.s
Function Profile
Device |
Program Words |
Cycles |
---|---|---|
PIC32A |
12 |
28 + ⌊M/2⌋ x 3 |
Note :
- The above-mentioned program word and cycle counts pertain solely to VectorCorrelate. However, as this function inherently utilizes VectorConvolve, the respective counts for VectorConvolve must also be considered.
- In the description of VectorConvolve, the number of cycles reported includes four cycles of C-function call overhead. Thus, the number of actual cycles from VectorConvolve to add to VectorCorrelate is four less than whatever number is reported for a stand-alone VectorConvolve.
System resource usage
The below system resource usages are excluded from those of the VectorConvolve function.
- W0…W7 - used, not restored
- REPEAT instruction(s) usage – None