INTRODUCTION
Lowdensity ParityCheck (LDPC) codes were introduced by Gallager
(1962) and Gallager (1963). LDPC codes have a excellent
performance with iterative decoding that is very close to the Shannon limit
over Additive White Gaussian Noise (AWGN) channels (Kou
et al., 2001; Lucas et al., 2000; MacKay
and Neal, 1996; MacKay, 1999; Tanner,
1981). LDPC codes can be showed by a bipartite graph called Tanner graph
(Tanner 1981). The Tanner graph is composed of two sets
of nodes, that these namely, variable nodes and check nodes. Each variable nodes
and check nodes correspond to the number of codeword symbols and parity symbols,
respectively. If a variable node is constrained by a check node, there is an
edge connecting these two nodes.
The girth of the code is the length of the shortest cycle in its Tanner graph and it is a crucial parameter.
Cycles, especially short cycles, leave a bad effect on the performance of LDPC
decoders. Because they affect the independence of the extrinsic information
which exchanged in iterative decoding (Sipser and Spielman,
1996; Wiberg, 1996). Several methods of counting
the number of cycles have been presented by Fan and Xiao
(2006) and Halford and Chugg (2004). In this paper
a method is presented for counting the number of cycles with length g. In this
method the paritycheck matrix must be (g2)cycle free (i.e. don’t have
any cycle of length (g2). Then we analyze the figures of 4cycles, 6cycles
and in generally gcycles in check matrix. Also we introduce algorithm for existence
of gcycle and computing the number of cycles with length g.
CYCLES OF LENGTH g AND ITS FIGURE
A LDPC code can be shown by a paritycheck matrix. The nonzero components are
too lesser than zero components in paritycheck matrix. A cyclein a tanner graph
refers to a finite set of connected edges that starts and ends at the same node
and satisfies the condition that no node (except the initial and final node)
appears more than once. The length of the cycle is the number of it edges. The
length of a smallest cycle in the graph is called the girth of the graph.
We know that four ones in 4cycle belong to 2 rows and 2 columns equally in check matrix. So the figure of 4cycle as shown in Fig. 1.
Consider H as a mxn check matrix. Figure 1 shows that 4cycle
must be in two rows. So we can calculate the number 4cycles in all possible
combinations of two rows in check matrix and add them (i.e. the total number
of 4cycles in check matrix). The number of 2column rows combinations is (Fan
and Xiao, 2006):
There are six number ones in 6cycles belong equally to 3 rows and 3 columns. So, we can get p^{3}_{3} = 6 number of 6cycles with different figures. 6cycles in paritycheck matrix shown in Fig. 2.
If H is a mxn check matrix. Figure 2 shows that a 6cycle
must be in 3 rows. So, we can calculate the number of 6cycles in all possible
combinations of 3 rows in check matrix and so the total number of 6cycles of
check matrix is sum of the number of 6 cycles in all possibilities.

Fig. 1: 
4Cycle in paritycheck matrix 

Fig. 2: 
6Cycles in paritycheck matrix 
The number of 3rows combinations w is (Fan and Xiao, 2006):
In generally g ones in gcycle belong equally to g/2 rows and g/2 columns of
check matrix. We can calculate the number of gcycles in all possible combinations
of g/2 in check matrix. Therefore to obtain the total number of gcycles in
check matrix we add the number of g cycles in all cases. The number of g/2 rows
combinations w is:
ALGORITHM FOR CALCULATING OF THE GIRTH AND THE NUMBER OF CYCLES OF LENGTH GIRTH
Here, a method for calculating of the girth and its number in paritycheck matrix is presented. First, we describe this method for 4cycle and 6cycle and then we describe it in general.
As we observed in previous section, a cycle is formed with four ones of two rows. By adding these two rows, the components of the new vector are 0, 1 or 2. If the number of 2 in the new row is t_{i}, where 1≤i≤ w and t_{i}≥2, then there is at least one 4cycle in paritycheck matrix and the number of 4cycle is:
The following is algorithm of 4cycle.
Check Algorithm of 4Cycles

Now we give an example for algorithm of 4cycles. 
Example 1: Consider the paritycheck matrix H as following:
If we add the first and second rows of this matrix, we get the vector (2 1
1 2 0). Since there are two entry 2 in this vector, so there is at least a 4cycle.
Therefore in this matrix there is a 4cycle which is obtained from the first
and the second rows and the first and the fourth columns. The two 4cycle in
this matrix are obtained from rows 1,2 and 2,3.
Now, we investigate check algorithm of 6cycles. First we check the algorithm of 4cycles for matrix, if there isn't any 4cycle (4cycle free), then we check the 6cycle and the number of 6cycles in matrix. The figures of 6cycle were shown in Fig. 2. By adding the any three rows in check matrix, we get a vector with possible entries 0, 1, 2 or 3. Then there is a 6cycle in paritycheck matrix. The number of 6cycles in paritycheck matrix which is 4cycle free is Σ^{w} _{i =1}^{ti}:, where t_{i} is defined as following:
The following algorithm is check algorithm of gcycle for matrix.
Check Algorithm of 6cycles
Example 2: Consider a 4cycle free check matrix H as:
The number of 6cycles in this matrix is 28. For example, by adding the first, second and forth rows we have a vector (2 2 2 0 1 1 1) as shown in the following image.
There are three entry 2 in this vector. So there is a 6cycle in matrix H. By checking all possible combination of three rows in this matrix, the number of 6cycles is 28.
In this subsection we present algorithm of gcycles in check matrix. First,
we check the algorithms of g’cycle for check matrix, where g’<g.
If this matrix is (g2)cycle free, then we run the check algorithm of gcycle
as following:
By adding the g/2 rows of check matrix, we get the vector that every entry is a nonnegative integer number belong to:
If the number of 2 in the new vector obtained from adding rows is, g/2 then there is a gcycle in this rowcombination. The number of gcycle in (g2)cycle free paritycheck matrix is equal to Σ^{w} _{i =1}^{ti}:, where t_{i} is defined as following:
Check Algorithm of gCycles
RESULT SIMULATION AND AFFECT SHORT CYCLES IN PERFORMANCE LDPC CODES
In this paper, we presented a method of detecting the gcycles in paritycheck matrix. Cycles, especially short cycles, degrade the performance of LDPC decoders, so it is requirement that remove the short cycles in paritycheck matrix. Since we like to grow the girth of check matrix by extending the binary field to F_{q} (i.e., by replacing the element field in check matrix we can extending the binary field to F_{q}), we need to find the short cycles with length girth. By finding these cycles and set the field member in it, we can grow the girth and prevent from forming the cycles with length g. Then the new obtained check matrix is free of gcycle. So by applying this method, we can grow the girth of LDPC code. BER performance of a non binary LDPC code with girth 6 and 8 over AWGN channel, BPSK modulation and 20 repeat simulated as shown in Fig. 3. The paritycheck matrix of this code is an 42x14 matrix and the number of cycles length girth (g = 6) equal to 1225. Using this method we can find the 6cycles and try set the field elements in check matrix such that the new paritycheck matrix free of 6cycle. The simulation results show that this code has better performance than random Mackay and Nil codes in g = 8.

Fig. 3: 
The simulation results to find better performance 
CONCLUSION
In this paper, a method for counting the number of cycles with length g is
presented. Also we analyzed the figures of 4cycles, 6cycles and in generally
gcycles in check matrix. We introduced algorithm for existence of gcycle and
computing the number of cycles with length g.
ACKNOWLEDGMENT
The authors would like to thank the referee for his/her helpful comments.