1.4.2.77 DSP_VectorMax32 Function

Returns the maximum value of a vector.

Description

int32_t DSP_VectorMax32(int32_t *indata, int N);

Returns the highest 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 multiple of four.

Parameters

indata pointer to input array of elements (int32_t)

N number of samples (int)

Returns

(int32_t) - maximum value within the vector, Q31 format

Remarks

None.

Example

int32_t outCheck;

int Num = 4;

int32_t inBufTestA[8]={0x7FFFFFFF, 0x80000000, 0x73333333, 0x66666666,

0x19999999, 0x40000000, 0x7FFFFFFF, 0xB3333334};

_// 1, -1, 0.9, 0.8, 0.2, 0.5, 1, -0.6_

outCheck = DSP_VectorMax32(inBufTestA, Num);

_// outCheck = 0x7FFFFFFF // first 4 values_

C

int32_t DSP_VectorMax32 (int32_t * indata , int  N );