Matrix Pattern Recognition Algorithm

I am designing a logic analyzer and I would like to implement some Matrix Algorithm. I have several channels each one represented by a row in the matrix and every element in the column would be the state, for example:

``````Channel 1   1 0 0 1 0 1 1 0 1
Channel 2   1 1 0 1 1 0 0 1 1
Channel 3   0 1 0 1 1 0 1 0 0
``````

I would like to detect a pattern inside my matrix for example, detect ALL the matches of the bitmap inside the matrix:

``````1 0
1 1
``````

I think it can be accomplished testing element by element but I think there should be a better way of doing it. Is there any Java API or any way to do it ? If there is a API ARM optimized for NEON instructions would be great also but not mandatory.

They will be about 8 matrix of 3 or 2 rows by 20000 columns approximately, the matrix is not fixed, it change every time I scan it because I am constantly receiving data. I need to process them in 500mS or less. I am working on an ARM platform, dual core, 1.2GHz, 1Gb RAM, Android 4.1.2

Thank you very much in advance.

• It would be helpful if you tell us the expected sizes of your matrixes, the number of them and how fast you need it to be. Commented Dec 18, 2012 at 7:26
• They will be about 8 matrix of 3 or 2 rows by 20000 columns approximately. I need to process them in 500mS or less. I am working on an ARM platform, dual core, 1.2GHz, 1Gb RAM, Android 4.1 Commented Dec 18, 2012 at 15:15
• What exactly do you mean by pattern? A submatrix (e.g. pick rows 1 and 3 and columns 2 and 5) or a bitmap like structure (e.g. a row and col index i,j such that for all x,y : p(x,y) = m(i+x, j+y) with p as pattern and m as "channel matrix")? Commented Dec 18, 2012 at 17:10
• I want to know if B sub-matrix exist in A matrix but it has to be a sub-matrix I don't want it to recognize the pattern if one match is in column 1 and the other match is in column 5 it must be all together like a matrix. Hope you understand :) Commented Dec 18, 2012 at 17:15
• Maybe then you should remove the word submatrix. A submatrix of a matrix is usually build by choosing arbitrary columns and rows. See en.wikipedia.org/wiki/Submatrix Commented Dec 18, 2012 at 17:17