This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

What is the correct parameters to use the VLIB_hammingDistance?

Hi,

I have a problem to compute a hammingDistance between A(1xn, 1-D array) and B(1xm 1-D array).

For example

A = {1 , 2, 3,  ..... , 30, 31, 32,     33, 34, 35, ......, 62, 63, 64}   ; 1x64(1x32x2) array

B = { 32,  31, 30, ......, 3, 2, 1}  ; 1x32 array.

I want calculate the hamming distance like bellow.

hammignDistance[0] = VLIB_hammindDistance( stringA[0~31], stringB[0~31] ) and 

hammignDistance[1] = VLIB_hammindDistance( stringA[32~63], stringB[0~31] ).

In the function description document,

It is said that 'xSize' is number of bytes in the first dimension and 'ySize' means number of row(size of second dimension)

and the mode is '1' means 'Many-to-One', and xPitch is Number of bytes between start of each string.

In this case, I don't know the xSize and ySize, and xPitch.

What is the correct number of the parameters(xSize, ySize, xPitch, mode) to use the VLIB_hammingDistance?

I think  < xSize = 32, ySize = 2, xPitch = 32, mode = 1 > like the example ( VLIB_hammingDistnace_d.c ).

Is it right or wrong?

Thank you.

Regards,

Tahk.

  • Hi,

    Welcome to the TI E2E forum. I hope you will find many good answers here and in the TI.com documents and in the TI Wiki Pages (for processor issues). Be sure to search those for helpful information and to browse for the questions others may have asked on similar topics (e2e.ti.com).

    We will get back to you shortly on the above query.

    Regards,
    Sivaraj K
  • Yes, your understanding is correct. You need to call the function with xSize = 32, ySize = 2, xPitch = 32 just as specified in the test vector project in the library. Let me know if you have any further questions.

    Regards,
    Rahul