Patent ID: 7653626

Claim:
A method for detecting a regularly appearing pattern by comparing a symbol in a stream of symbols, wherein the regularly appearing pattern is a predetermined pattern, and a period of the regularly appearing pattern is N symbols and each symbol corresponds to a location index ranging from 0 to N−1, and a comparing of each symbol in a stream of symbols is in the order of location index from 0 to N−1, the method is executed by a computer and comprises: providing a matrix comprising at least one row, wherein each row comprises the location index and a count value, wherein the count value is associated with the location index for indicating the number of a predetermined value that appears at a time corresponding to the location index; receiving a symbol that corresponds to a current location; translating the current location into a current location index representing thereof; picking the first row of the matrix as a comparing row; proceeding a comparing procedure by comparing the received symbol with the predetermined value; comparing the current location index with the location index of the comparing row; incrementing the count value of the comparing row when the current location index equals the location index of the comparing row and the received symbol equals the predetermined value; arranging the matrix in a circular manner to put a preliminary comparing row as the first row of the matrix, wherein the preliminary comparing row is the comparing row for a symbol to be compared with the predetermined value in the following proceeding comparing procedure; determining whether the received symbol is the regularly appearing pattern according to the count values in the matrix.