1.4.2.66 DSP_VectorChkEqu32 Function

Compares two input vectors, returns an integer 1 if equal, and 0 if not equal.

Description

int DSP_VectorChkEqu32(int32_t *indata1, int32_t *indata2, int N);

Compares the first N values of indata1 to the same elements of indata2. The comparison requires that all numbers be in Q31 fractional data format. Returns the integer value 1 if all numbers are equal, and 0 if they are not equal. 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

indata1 pointer to input array 1 of elements (int32_t)

indata2 pointer to input array 2 of elements (int32_t)

N number of samples (int)

Returns

(int) - 1 if vectors are equal, 0 if vectors are not equal

Remarks

None.

Example

int 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_

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

0x80000000, 0x40000000, 0x7FFFFFFF, 0x20000000};

_// 1, -1, 0.9, 0.8, -1, 0.5, 1, 0.25_

outCheck = DSP_VectorChkEqu32(inBufTestA, inBufTestB, Num);

_// outCheck = 1 // true for first 4 numbers of series_

C

int  DSP_VectorChkEqu32 (int32_t * indata1 , int32_t * indata2 , int  N );