1.4.2.81 DSP_VectorMinIndex32 Function
Returns the index of the minimum value of a vector.
Description
int DSP_VectorMinIndex32(int32_t *indata, int N);
Returns the relative position index of the lowest value of the first N elements of the vector indata. The comparison requires that all numbers be in Q31 fractional data format. N must be greater than or equal to four and a multiple of four, or it will be truncated to the nearest multiple of four.
Preconditions
The pointers outdata and indata must be aligned on 4-byte boundaries. N must be greater than or equal to four and a multiple of four.
Parameters
indata pointer to source array of elements (int32_t)
N number of samples (int)
Returns
int32_t - mean average value of the vector
Remarks
Index values range from 0 .. (n-1).
Example
int indexValue; int Num = 8; int32_t inBufTestA[8]={0x3FFFFFFF, 0x80000000, 0x73333333, 0x66666666, 0x19999999, 0x40000000, 0x7FFFFFFF, 0xB3333334}; _// 0.5, -1, 0.9, 0.8, 0.2, 0.5, 1, -0.6_ indexValue = DSP_VectorMinIndex32(inBufTestA, Num); _// returnValue = 1 (position corresponding to 0x80000000)_
C
int DSP_VectorMinIndex32 (int32_t * indata , int N );