Analysis and construction of full-diversity joint network-LDPC codes for cooperative communications

—Transmit diversity is necessary in harsh environments to reduce the required transmit power for achieving a given error performance at a certain transmission rate. In networks, cooperative communication is a well known technique to yield transmit diversity and network coding can increase the spectral efﬁciency. These two techniques can be combined to achieve a double diversity order for a maximum coding rate R c = 2 / 3 on the Multiple Access Relay Channel (MARC), where two sources share a common relay in their transmission to the destination. However, codes have to be carefully designed to obtain the intrinsic diversity offered by the MARC. This paper presents the principles to design a family of full-diversity LDPC codes with maximum rate. Simulation of the word error rate performance of the new proposed family of LDPC codes for the MARC conﬁrms the full-diversity.


I. INTRODUCTION
Multipath propagation (small-scale fading) is an important salient effect of wireless channels, causing possible destructive adding of signals at the receiver. When the fading varies very slowly, error-correcting codes cannot combat the detrimental effect of the fading on a point-to-point channel. Space diversity, i.e., transmitting information over independent paths in space, is a means to mitigate the effects of slowly varying fading. Cooperative communication [1]- [4] is a well known technique to yield transmit diversity. The most elementary example of a cooperative network is the relay channel, consisting of a source, a relay and a destination [3], [5]. The task of the relay is specified by the strategy or protocol. In the case of coded cooperation [4], the relay decodes the message received from the source, and then transmits to the destination additional parity bits related to the message; this results in a higher information theoretic spectral efficiency than simply repeating the message received from the source [6]. The resulting outage probability [7] exhibits twice the diversity, as compared to point-to-point transmission. However, the overall Dieter  error-correcting code should be carefully designed in order to guarantee full-diversity [8].
We focus on capacity achieving codes, more precisely, lowdensity parity-check (LDPC) codes [9], because their word error rate (WER) performance is quasi-independent of the block length [10] when the block length is becoming very large.
Considering two users, S 1 and S 2 , and a common destination D, a double diversity order can be obtained by cooperating. When no common relay R is used, the maximum achievable coding rate that allows to achieve full-diversity is R c = 0.5 (according to the blockwise Singleton bound [7], [11]). However, when one common relay R for two users is used (a Multiple Access Relay Channel -MARC), it can be proven that the maximum achievable coding rate yielding full-diversity is R c = 2/3 [12]. The increase of the maximum coding rate yielding full-diversity from R c = 0.5 to R c = 2/3 is achieved through network coding [13] at the physical layer, i.e., R sends a transformation of its incoming bit packets to D (only linear transformations over GF (2) are considered here). From a decoding point of view, this linear transformation can be interpreted as additional parity bits of a linear block code. Hence, the destination will decode a joint network-channel code. Therefore, the problem formulation is how to design a full-diversity joint network-channel code construction for a rate R c = 2/3.
Up till now, no family of full-diversity LDPC codes with R c = 2/3 for coded cooperation on the MARC has been published. Chebli, Hausl and Dupraz obtained interesting results on joint network-channel coding for the MARC with turbo codes [14] and LDPC codes [15], [16], but these authors do not elaborate on a structure to guarantee full-diversity at maximum rate, which is the most important criterion for a good performance on fading channels. A full-diversity code structure describes a family of LDPC codes or an ensemble of LDPC codes, permitting to generate many specific instances of LDPC codes.
In this paper, we present a strategy to produce excellent LDPC codes for the MARC. First, we outline the physical layer network coding framework. Then, we derive the conditions on the MARC model and the coding rate necessary to achieve a double diversity order. In the second part of the paper, we elaborate on the code construction. A joint network-channel code construction is derived that guarantees full-diversity, irrespective of the parameters of the LDPC code (the degree distributions). Finally, the coding gain can be The Multiple Access Relay Channel model. The solid arrows correspond to timeslot 1, the dotted arrows to timeslot 2 and the dashed arrow to timeslot 3. improved by selecting the appropriate degree distributions of the LDPC code [17] or using the doping technique [18] as shown in section VII-B. Simulation results for finite and infinite length (through density evolution) are provided. To the best of authors'knowledge, this is the first time that a joint full-diversity network-channel LDPC code construction for maximum rate is proposed.
Channel-State Information is assumed to be available only at the decoder. In order to simplify the analysis, we consider orthogonal half-duplex devices that transmit in separate timeslots.

A. Multiple Access Relay Channel
We consider a Multiple Access Relay Channel (MARC) with two users S 1 and S 2 , a common relay R and a common destination D. Each of the three transmitting devices transmits in a different timeslot: S 1 in timeslot 1, S 2 in timeslot 2 and R in timeslot 3 ( Fig. 1). In this paper, we limit the scheme to two sources, but any extension to a larger number of sources is possible by applying the principles explained in the paper. We consider a joint network-channel code over this network, i.e., an overall codeword c = [c 1 , . . . , c N ] T is received at the destination during timeslot 1, timeslot 2, and timeslot 3, which form together one coding block. The codeword is partitioned into three parts: , . . . , c N ] T , and where S 1 and S 2 transmit N s bits (note that each user is given an equal slot length because of fairness) and R transmits N r bits, so that N = 2N s + N r . We define the level of cooperation, β, as the ratio N r /N . Because the users do not communicate between each other, the bits c(1), transmitted by S 1 , and the bits c(2), transmitted by S 2 , are independent. Since the focus in this paper is on coding, BPSK signaling is used for simplicity, so that the transmitters send symbols x(b) n ∈ {±1}, where b stands for the timeslot number, and n is the symbol time index in timeslot b. The channel is memoryless with real additive white Gaussian noise and multiplicative real fading. The fading coefficients are only known at the decoder side where the received signal vector at the destination D is where y(1) = [y(1) 1 , . . . , y(1) Ns ] T , y(2) = [y(2) 1 , . . . , y(2) Ns ] T , and y(3) = [y(3) 1 , . . . , y(3) Nr ] T are the received complex signal vectors in timeslots 1, 2, and 3 respectively. The noise vector w(b) consists of independent noise samples which are real Gaussian distributed, i.e., w(b) n ∼ N (0, σ 2 ), where 1 2σ 2 is the average signal-to-noise ratio 1 γ = Es N0 . The Rayleigh distributed fading coefficients α 1 , α 2 and α 3 are independent and identically distributed. The channel model is illustrated in Fig. 2. In some parts of the paper, a block binary erasure channel (block BEC) [19], [20] will be assumed, which is a special case of block fading. In a block BEC, the fading gains belong to the set {0, ∞}, where α = 0 means the link is a complete erasure, while α = ∞ means the link is perfect.
We assume that no errors occur on the S 1 -R and S 2 -R channels. This simplifies the analysis and does not change the criteria for the code to attain full-diversity, as will be shown in section III-B.

B. LDPC coding
We focus on binary LDPC codes C[N, 2K] 2 with block length N and dimension 2 2K, and coding rate R c = 2K/N . The code C is defined by a parity-check matrix H, or equivalently, by the corresponding Tanner graph [7], [9]. Regular (d b , d c ) LDPC codes have a parity-check matrix with d b ones in each column and d c ones in each row. For irregular (λ(x), ρ(x)) LDPC codes, these numbers are replaced by the so-called degree distributions [9]. These distributions are the standard polynomials λ(x) and ρ(x) [21]: where λ i (resp. ρ i ) is the fraction of all edges in the Tanner graph, connected to a bit node (resp. check node) of degree i. Therefore, λ(x) and ρ(x) are sometimes referred to as left and right degree distributions from an edge perspective. In section VI the polynomialsλ(x) andρ(x), which are the left and right distributions from a node perspective, will also be adopted: whereλ i (resp.ρ i ) is the fraction of all bit nodes (resp. check nodes) in the Tanner graph of degree i, henceλ i = λi/i j λj /j and likewise withρ i . The goal of this research is to design a full-diversity ensemble of LDPC codes for the MARC. An ensemble of LDPC 1 The average signal-to-noise ratios on the S 1 -D, S 2 -D and R-D channels are the same. 2 We consider two sources each with K information bits and an overall error-correcting code with N codebits codes is the set of all LDPC codes that satisfy the left degree distribution λ(x) and right degree distribution ρ(x).
In this paper, not all bit nodes and check nodes in the Tanner graph will be treated equally. To elucidate the different classes of bit nodes and check nodes, a compact representation of the Tanner graph, adopted from [22] and also known as protograph representation [9], [23], [24] (and the references therein), will be used. In this compact Tanner graph, bit nodes and check nodes of the same class are merged into one node.

C. Physical layer network coding
The coded bits transmitted by R are a linear transformation of the information bits 3 from S 1 and S 2 , denoted as i(1) and i(2), where both vectors are of length K. Let * stand for a matrix multiplication in GF (2).
The matrix T represents the network code, which has to be designed. Let us split T into two matrices H N and V such that T = H −1 N * V , where H N is an N r × N r matrix and V is an N r × 2K matrix. Now we have the following relation: Eq. (2) can be inserted into the parity-check matrix defining the overall error-correcting code. Instead of designing T , we can design H N and V using principles from coding theory.

A. Achievable diversity order
The formal definition of diversity order on a block fading channel is well known [25].

Definition 1 The diversity order attained by a code C is defined as
where P e is the word error rate after decoding.
However, in this document, as far as the diversity order is concerned, we mostly use a block BEC. It has been proved that a coding scheme is full-diversity on the block fading channel if and only if it is full-diversity on a block BEC [22]. The channel model is the same as for block fading, except that the fading gains belong to the set {0, ∞}. Suppose that on the S 1 -D, S 2 -D and R-D links, the probability of a complete erasure, i.e., α = 0, is .

Definition 2 A code C achieves a diversity order d on a block BEC if and only if [26]
where P e is the word error rate after decoding and ∝ means proportional to.
Therefore, it is sufficient to show that two erased channels cause an error event to prove that d < 3, because the probability of this event is proportional to 2 . Consider for example that the R-D channel has been erased, as well as the S 1 -D channel. Then, the information from S 1 can never reach D, because S 2 does not communicate with S 1 . Therefore, the diversity order d < 3.
A diversity order of two is achieved if the destination is capable of retrieving the information bits from S 1 and S 2 , when exactly one of the S 1 -D, S 2 -D, or R-D channels is erased. The maximum coding rate allowing the destination to do so will be derived in subsection III-D.

B. Perfect source-relay channels
Here, we will show that the achieved diversity at D does not depend on the quality of the source-relay (S-R) channel. Therefore, in the remainder of the paper, we will assume errorless S-R channels to simplify the analysis.
Let us consider a simple block fading relay channel with one source S, one relay R and one destination D. All considered point-to-point channels (S-R, S-D, R-D) have an intrinsic diversity order of one. In a cooperative protocol, where R has to decode the transmission from S in the first slot, two cases can be distinguished: (1) R is able to decode the transmission from S and cooperates with S in the second slot, hence D receives two messages carrying information from S; (2) R is not able to decode the transmission from S and therefore does not transmit in the second slot, hence D receives only one message carrying information from S, namely on the S-D channel. Now, the decoding error probability, i.e., the WER P e , at D can be written as follows: P e = P (case 1)P (e|case 1) + P (case 2)P (e|case 2).
The probability P (case 2) is equal to the probability of erroneous decoding at R. For large γ, we have P (case 2) ∝ 1 γ and P (case 1) = (1 − c γ ) [25], where c is a constant. The probability P (e|case 2) is equal to the probability of erroneous decoding on the S-D channel; hence for large γ, P (e|case 2) ∝ 1 γ . Now, the error probability P e at large γ is proportional to where c is a positive constant. According to definition 1, full-diversity requires that at large γ, P e ∝ 1 γ 2 . We see that this only depends on the behavior of P (e|case 1) at large γ, because the second case where the relay cannot decode the transmission from the source in the first slot does automatically give rise to a double diversity order without the need for any code structure. This means that as far as the diversity order is concerned, it is sufficient to assume errorless S-R channels (yielding P e = P (e|case 1)). Furthermore, techniques [8] are known to extend the proposed code construction to nonperfect source-relay channels, so that, for the clarity of the presentation, perfect source-relay channels are assumed in the remainder of the paper.

C. Outage probability of the MARC
We denote an outage event of the MARC by E o . An outage event is the event that the destination cannot retrieve the information from S 1 or S 2 , i.e., the transmitted rate is larger than or equal to the instantaneous mutual information. The transmitted rate r u is the average 4 spectral efficiency of user u, whereas r is the overall spectral efficiency, so that r = r 1 + r 2 . We can interprete r as the total spectral efficiency that is transmitted over the network. The MARC block fading channel has a Shannon capacity that is essentially zero since the fading gains make the mutual information a random variable which does not allow to achieve an arbitrarily small word error probability under a certain spectral efficiency. This word error probability is called information outage probability in the limit of large block length, denoted by The outage probability is a lower bound on the average word error rate of coded systems [27].
The mutual information from user 1 to the destination is the weighted sum of the mutual informations from the channels from S 1 -D and R-D 5 . Hence the spectral efficiency r 1 is upper bounded as: where (1 − β)/2 and β are the fractions of the time during which S 1 and R are active [25,Section 5.4.4]. The same holds for user 2: 4 The average spectral efficiency denotes the average number of bits per overall channel uses, including the channel uses of the other devices, that is transmitted over the MARC channel. 5 The transmission of R corresponds to redundancy for S 1 and S 2 at the same time. From the point of view of S 1 , the transmission of R contains interference from S 2 . By using the observations from S 2 , the decoder at the destination can at most cancel the interference from S 2 in the transmission from R.

Combining (3) and (4) yields
However, there is a tighter bound for r. Indeed, (3) and (4) both rely on the fact that the destination can cancel the interference from the other user on the relay-to-destination channel, but therefore, the destination must be able to decode one of the users'information from their respective transmission. Hence, there exist two scenarios: (1) in the first scenario, D decodes the information of S 2 from the transmission of S 2 (r 2 < 1−β 2 I(S 2 ; D)), so that it can cancel the interference from S 2 in the transmission from R ((3) holds); (2) the second scenario is the symmetric case (r 1 < 1−β 2 I(S 1 ; D) and (4) holds). Both scenarios lead to a tighter bound for r: Bound (5) can be verified when considering the instantaneous mutual information between the sources and the sinks in the network. We denote the instantaneous mutual information of the MARC as I(α, γ), which is a function of the set of fading gains α = [α 1 , α 2 , α 3 ] and average SNR γ. The overall mutual information is because the three timeslots behave as parallel Gaussian channels whose mutual informations add together. Of course, the timeslots timeshare a time-interval, which gives a weight to each mutual information term [25,Section 5.4.4]. The total transmitted rate must be smaller than I(α, γ), which yields (5).
From the above analysis, we can now write the expression of an outage event: The three terms I(S 1 ; D), I(S 2 ; D) and I(R; D) are each the average mutual information of a point-to-point channel with input x ∈ {−1, 1}, received signal y = αx + w with w ∼ N (0, σ 2 ), conditioned on the channel realization α, which is determined by the following well-known formula [28]: where E Y |{x=1,α} is the mathematical expectation over Y given x = 1 and α. Therefore, three terms I(S 1 ; D), I(S 2 ; D) and I(R; D) are Now, the outage probability can be easily determined through Monte-Carlo simulations to average over the fading gains and to average over the noise 6 .

D. Maximum achievable coding rate for full-diversity
In section III-A we established that the maximum achievable diversity order is two. Here, we will derive an upper bound on the coding rate yielding full-diversity, valid for all discrete constellations (assume a discrete constellation with M bits per symbol).
It has been proved that a coding scheme is full-diversity on the block fading channel if and only if it is full-diversity on a block BEC [22]. So let us assume a block BEC, hence α i ∈ {0, ∞}, i = 1, 2, 3. The strategy to derive the maximum achievable coding rate is as follows: erase one of the three channels (see Fig. 3), and derive the maximum spectral efficiency that allows successful decoding at the destination 7 . The criteria for successful decoding at the destination are given in the previous subsection: (3), (4), and (5). Because one of the three channels has been erased (see Fig. 3), one of the mutual informations is zero. The channels that are not erased have a maximum mutual information M (discrete signaling). A user's spectral efficiency allows successful decoding if and only if It can be easily seen that (7) is a looser bound than (6) (r = r 1 + r 2 ), so that finally which is maximized if β = 1/3, such that r < 2M/3. The destination decodes all the information bits on one graph that represents an overall code with coding rate R c . Hence the maximum achievable overall coding rate is R c = r M = 2/3. It is clear that to maximize r = r 1 +r 2 , the spectral efficiencies r 1 and r 2 should be equal, i.e., all users in the network transmit at the same rate. In this case, (8) and (6) are equivalent and it is sufficient to bound the sum-rate only. In our design, we will take r 1 = r 2 = 1/3, so that the maximum achievable coding rate can be achieved.

MULTIPLE FADING STATES
In the first part of the paper, we established the channel model, the physical layer network coding framework, the max- 6 Averaging over the noise can be done more efficiently using Gauss-Hermite quadrature rules [29] 7 Another approach from a coding point of view has been made in [30].
imum achievable diversity order and the maximum achievable coding rate yielding full-diversity. In a nutshell, if the relay transmits a linear transformation of the information bits from both sources during 1 3 of the time, a double diversity order can be achieved with one overall error-correcting code with a maximum coding rate R c = 2/3. Now, in the second part of the paper, this overall LDPC code construction that achieves full-diversity for maximum rate will be designed. First, in this section, rootchecks will be introduced, a basic tool to achieve diversity on fading channels under iterative decoding [22]. Then, in the following section, application of these rootchecks to the MARC will define the network code, i.e., H N and V , such that a double diversity order is achieved. Finally, these claims will be verified by means of simulations for finite length and infinite length codes.

A. Diversity rule
In order to perform close to the outage probability, an errorcorrecting code must fulfil two criteria: 1) full-diversity, i.e., the slope of the WER is the same as the slope of the outage probability at γ → ∞; 2) coding gain, i.e., minimizing the gap between the outage probability and the WER performance at high SNR. The criteria are given in order of importance. The first criterion is independent of the degree distributions of the code [22], hence serves to construct the skeleton of the code. It guarantees that the gap between the outage probability and the WER performance is not increasing at high SNR. The second criterion can be achieved selecting the appropriate degree distributions or applying the doping techniques (see section VII-B). In this paper, the most attention goes to the first criterion.
In the belief propagation (BP) algorithm, probabilistic messages (log-likelihood ratios) are propagating on the Tanner graph. The behavior of the messages for γ → ∞ determines whether the diversity order can be achieved [17]. However, the BP algorithm is numerical and messages propagating on the graph are analytically intractable. Fortunately, there is another much simpler approach to prove full-diversity. Diversity is defined at γ → ∞. In this region the fading can be modeled by a block BEC, an extremal case of block-Rayleigh fading. Full-diversity on the block BEC is a necessary and sufficient condition for full-diversity on the block-Rayleigh fading channel [22]. The analysis on a block BEC channel is a very simple (bits are erased or perfectly known) but very powerful means to check the diversity order of a system.

Proposition 1
We obtain a diversity order d = 2 on the MARC, provided that all information bits can be recovered, when any single timeslot is erased.
This rule will be used in the remainder of the paper to derive the skeleton of the code.

B. Rootcheck
Applying Proposition 1 to the MARC leads to three possibilities (Fig. 3):  Fig. 3. In these three cases, where each time one link is erased, a full-diversity code construction allows the destination to retrieve the information bits from both S 1 and S 2 .
• case 1: the S 1 -D channel is erased: Let us zoom on the decoding algorithm to see what is happening. We illustrate the decoding procedure on a decoding tree, which represents the local neighborhood of a bit node in the Tanner graph (the incoming messages are assumed to be independent). When decoding, bit nodes called leaves pass extrinsic information through a check node to another bit node called root (Fig. 4). Because we consider a block BEC channel, the check node operation becomes very simple. If all leaf bits are known, the root bit becomes the modulo-2 sum of the leaf bits, otherwise, the rootbit is undetermined (P(bit=1)=P(bit=0)=0.5). Dealing with case 3 is simple: let every source send its information uncoded and R sends extra parity bits. If D receives the transmissions of S 1 and S 2 perfectly, it has all the information bits. So the challenging cases are the first two possibilities. Let us assume that the nodes corresponding to the bits transmitted by S 1 , S 2 and R are filled red, blue and white, respectively. Assume that all red (blue) bits are erased at D. A very simple way to guarantee full-diversity is to connect a red (blue) information bit node to a rootcheck ( Fig. 4(a) (4(b))).

Definition 3 A rootcheck is a special type of check node,
where all the leaves have colors that are different from the color of its root.
Assigning rootchecks to all the information bits is the key to achieve full-diversity. This solution has already been applied in some applications, for example the cooperative multiple access channel (without external relay) [8]. Note that a check node can be a rootcheck for more than one bit node, for example the second rootcheck in Fig. 4.

C. An example for the MARC
The sources S 1 and S 2 transmit information bits and parity bits that are related to their own information, and R transmits information bits and parity bits related to the information from S 1 and S 2 . The previous description naturally leads to 8 different classes of bit nodes. Information bits of S 1 are split into two classes: one class of bits is transmitted on fading gain α 1 (red) and is denoted as 1i 1 , the other class is transmitted on α 3 (white) and denoted as 2i 1 ; similarly, red and white parity bits derived from the message of S 1 are of the classes 1p 1 and 2p 1 respectively. Likewise, bits related to S 2 are split into four classes: blue bits 1i 2 and 1p 2 (transmitted on α 2 ), and white bits 2i 2 and 2p 2 (transmitted on α 3 ). The subscripts of a class refer to the associated user. In the remainder of the paper, the vectors 1i 1 , 2i 1 , 1p 1 , and 2p 1 collect the bits of the classes 1i 1 , 2i 1 , 1p 1 , and 2p 1 respectively. A similar notation holds for S 2 . This notation is illustrated in Fig. 5. Above, we concluded that all information bits should be the root of a rootcheck. The class of rootchecks for 1i 1 is denoted as 1c. Translating Fig. 4 to its matrix representation renders: {1i2, 1p2, 2i1, 2p1, 2i2, 2p2} The identity 8 matrix concatenated with a matrix of zeros, 8 Note that the identity matrix can be replaced by a permutation matrix. For the simplicity of the notation, in the rest of the paper I will be used.  assures that bits of the class 1i 1 are the only red bits connected to check nodes of the class 1c. As the bits from S 1 and S 2 are independent, the matrix representation can be further detailed: Hence, a full-diversity code construction for the MARC 9 can be formed by assigning this type of rootchecks (introducing new classes 2c, 3c, and 4c) to all information bits: .
(9) S 1 transmits 1i 1 and 1p 1 , S 2 transmits 1i 2 and 1p 2 , and the common relay first transmits 2i 1 and 2p 1 and then transmits 2i 2 and 2p 2 , hence the level of cooperation is β = 0.5. The reader can easily verify that if only one color is erased, all information bits can be retrieved after one decoding iteration. Note that both sources do not transmit all information bits, but the relay transmits a part of the information bits. This is possible because if R receives 1i 1 and 1p 1 perfectly 10 , it can derive 2i 1 (because of the rootchecks 2c) and consequently 2p 1 (after re-encoding). The same holds for S 2 . It turns out that splitting information bits in two parts and letting one part to be transmitted on the first fading gain and the other part on the second fading gain is the only way to guarantee full-diversity for maximum coding rate [22]. This code construction is semi-random, because only parts of the parity-check matrix are randomly generated. However, every set of rows and set of columns contain a randomly generated matrix and, therefore, can conform to any degree distribution. It has been shown that despite the semi-randomness (due to the presence of deterministic blocks), these LDPC codes are still very powerful in terms of decoding threshold [22]. No network coding has been used to obtain the code construction discussed above. The aim of this subsection was to show that through rootchecks, it is easy to construct a full-diversity code construction. However, when applying network coding, as will be discussed in section V, the spectral efficiency can be increased.

D. Rootchecks for punctured bits
In the previous subsection, we have illustrated that, through rootchecks, full-diversity can be achieved. Another feature of rootchecks is to retrieve bits that have not been transmitted, which are called punctured bits. Punctured bits are very similar to erased bits, because both are not received by the destination. However, the transmitter knows the exact position of the punctured bits inside the codeword which is not the case for erased bits. Formally we can state that from an algebraic decoding or a probabilistic decoding point of view, puncturing and erasing are identical, an erased/punctured bit is equivalent to an error with known location but unknown amplitude. From a transmitter point of view, punctured bits have always fixed position in the codeword whereas channel erased bits have random locations.
When punctured bits are information bits, the destination must be able to retrieve them. There are two ways to protect punctured bits.
• The punctured bit nodes are connected to one or more rootchecks. If the leaves are erased or punctured, the punctured root bit cannot be retrieved after the first decoding iteration. The erased or punctured leaves on their turn must be connected to rootchecks, such that they can be retrieved after the first iteration. Then, in the second iteration the punctured root bit can be retrieved. These rootchecks are denoted as second order rootchecks (see Fig. 6). Similarly, higher order rootchecks can be used. • The punctured bit nodes are connected to at least two rootchecks where both rootchecks have leaves with different colors (see Fig. 6). If one color is erased, there will always be a rootcheck without erased leaves to retrieve the punctured bit node. Combinations of both types of rootchecks are also possible.

V. FULL-DIVERSITY JOINT NETWORK-CHANNEL CODE
In this section, we join the principles of the previous section with the physical layer network coding framework. We will use the same bit node classes as in the previous section, hence S 1 transmits 1i 1 and 1p 1 , S 2 transmits 1i 2 and 1p 2 . The bits transmitted by the relay are determined by Eq. (2) and are of the class c(3). Adapting Eq. (2) to the classes of bit nodes gives: where the dimensions of V i are N r ×K/2. Please note that 2i 1 , 2p 1 , 2i 2 , and 2p 2 are not transmitted anymore (these bits are punctured).  Fig. 6. Two special rootchecks for punctured bits (shaded bit nodes). (a) is a second order rootcheck. Imagine that all blue bits are erased, than the shaded bit node will be retrieved in the second iteration. (b) represents two rootchecks where both rootchecks have leaves with other colors. Imagine that one color has been erased, than the shaded bit node will still be recovered after the first iteration. obtain a coding rate R c = 2/3, the relay can transmit N r = K bits. We will include the punctured information bits 2i 1 and 2i 2 in the parity-check matrix 11 for two reasons: • without 2i 1 and 2i 2 , we cannot insert Eq. (10) in the parity-check matrix; • the destination wants to recover all information bits, i.e., 1i 1 , 1i 2 , 2i 1 , and 2i 2 , so 2i 1 and 2i 2 must be included in the decoding graph. The parity-check matrix now has the following form: .
Because the nodes 2i 1 and 2i 2 have been added, we have now 4K columns and 2K rows. K rows are used to implement Eq. (10), while the other K rows define 1p 1 in terms of the information bits 1i 1 and 2i 1 (used for encoding at S 1 ), and 1p 2 in terms of the information bits 1i 2 and 2i 2 (used for encoding at S 2 ). The first two set of rows 1c and 2c are rootchecks for 2i 1 and 2i 2 , see section IV. Now it boils down to design the matrices V 1 , V 2 , V 3 , V 4 , and H N , such that the set of rows 3c and 4c represent rootchecks of the first or second order for all information bits. There exist 8 possible paritycheck matrices that conform to this requirement, see appendix A. With the exception of matrix (35), all matrices have one or both of the following disadvantages: • There is no random matrix in each set of columns, such that H cannot conform to any degree distribution.
• There is an asymmetry wrt. 2i 1 and 2i 2 and/or wrt. 1i 1 and 1i 2 and/or 3c and 4c which results in a loss of coding gain. Therefore, we select the matrix (35). The parity-check matrix (35) of the overall decoder at D shows that the bits transmitted by R are a linear transformation of all the information bits 1i 1 , 2i 1 , 1i 2 , and 2i 2 . Furthermore, the checks [3c 4c] represent rootchecks for all the information bits, guaranteeing full-diversity. The checks [1c 2c] are necessary because the bits [2i 1 2i 2 ] are not transmitted. Note that the punctured bits [2i 1 2i 2 ] have two rootchecks that have leaves with different colors. One of the rootchecks is a second order rootcheck. For example, the punctured bits of the class 2i 1 have two rootchecks, one of the class 1c and one of the class 4c. The rootcheck of the class 1c has only red leaves, while the rootcheck of the class 4c has white and blue leaves. All but one blue leaves are punctured such that the rootcheck of the class 4c is a second order rootcheck.

VI. DENSITY EVOLUTION FOR THE MARC
In this section, we develop the density evolution (DE) framework, to simulate the performance of infinite length LDPC codes. In classical LDPC coding, density evolution [9], [24], [31] is used to simulate the threshold of an ensemble of LDPC codes 12 . The threshold of an ensemble of codes is the minimum SNR at which the bit error rate converges to zero [31].
This technique can also be used to predict the word error rate of an ensemble of LDPC codes [22]. We refer to the event where the bit error probability does not converge to 0 by Density Evolution Outage (DEO). By averaging over a sufficient number of fading instances, we can determine the probability of a Density Evolution Outage P DEO . Now, it is possible to write the word error probability P e of the ensemble as where P e|DEO is the word error rate given a DEO event and P e|CONV is the word error rate when DE converges. If the bit error rate does not converge to zero, then the word error rate equals one, so that P e|DEO = 1. On the other hand, P e|CONV depends on the speed of convergence of density evolution and the population expansion of the ensemble with the number of decoding iterations [32], [33], but in any case P e ≥ P DEO , so that the performance simulated via DE is a lower bound on the word error rate. Finite length simulations confirm the tightness of this lower bound. In summary, a tight lower bound on the word error rate of infinite length LDPC codes can be obtained by determining the probability of a Density Evolution Outage P DEO . Given a triplet (α 1 , α 2 , α 3 ), one needs to track the evolution of message 13 densities under iterative decoding to check whether 12 Richardson and Urbanke [9], [31] established that, if the block length is large enough, (almost) all codes in an ensemble of codes behave alike, so the determination of the average behavior is sufficient to characterize a particular code behavior. This average behavior converges to the cycle-free case if the block length augments and it can be found in a deterministic way through density evolution (DE). 13 Messages are under the form of log-likelihood ratios (LLRs).
there is DEO. The evolution of message densities under iterative decoding is described through the density evolution equations, which are derived directly through the evolution trees. The evolution trees represent the local neighborhood of a bit node in an infinite length code whose graph has no cycles, hence incoming messages to every node are independent.
A. Tanner graph and notation The proposed code construction has 7 variable node types and 4 check node types. Consequently, the evolution of message densities under iterative decoding has to be described through multiple evolution trees, which can be derived from the Tanner graph. A Tanner graph is a representation of the parity-check matrices of an error-correcting code. In a Tanner graph, the focus is more on its degree distributions. In Fig. 7, the Tanner graph of matrix (35) Fig. 7. A compact representation of the Tanner graph of the proposed code construction (matrix (35)), adopted from [22] and also known as protograph representation [23]. Nodes of the same class are merged into one node for the purpose of presentation. Punctured bits are represented by a shaded node.

Proposition 2
In a Tanner graph with a left degree distribution λ(x), isolating one edge per bit node yields a new left degree distribution described by the polynomialλ(x): Proof: Let us define T bit,i as the number of edges connected to a bit node of degree i. Similarly, the number of all edges is denoted T bit . From section II, we know that λ i x i−1 expresses the left degree distribution, where λ i is the fraction of all edges in the Tanner graph, connected to a bit node of degree i. So finally λ i = Tbit,i Tbit . A similar reasoning can be followed to determineλ i : . a) j λj j T bit is equal to the number of edges that are removed which is equal to the number of bits. b) λ i T bit is equal to the number of edges connected to a bit of degree i.

B. DE trees and DE equations
The proposed code construction has 7 variable node types and 4 check node types. But not all variable node types are connected to all check node types. Therefore there are 14 evolution trees. But it is sufficient to draw only 7 of them because of symmetry. To write down the equations we adopt the following notation.
Let X 1 ∼ p 1 (x) and X 2 ∼ p 2 (x) be two independent real random variables. The density function of X 1 +X 2 is obtained by convolving the two original densities, written as p 1 (x) ⊗ p 2 (x). The notation p(x) ⊗n denotes the convolution of p(x) with itself n times.
The density function p(y) of the variable Y = 2 th −1 th X1 2 th X2 2 , obtained through a check node with X 1 and X 2 at the input, is obtained through the R-convolution [9], written as p 1 (x) p 2 (x). The notation th(.) denotes the tangent hyperbolic function and p(x) n denotes the R-convolution of p(x) with itself n times.
To simplify the notations, we use the following definitions: Next, we will use the following definitions: The first definition is necessary because of the non-linearity of the R-convolution. Therefore, the first equation is not equal to t(x) ρ (p (x)).
The following message densities at the m th iteration are distinguished: Note that the message densities propagating from bits of the class 2i 1 do not contain a channel observation µ 1 (x) because these information bits are punctured.
Proof: See appendix B.

A. Full-diversity LDPC ensembles
We evaluated the finite length performance of full-diversity LDPC codes and the asymptotic performance by applying DE on the proposed code construction. The parity-check matrix (35) is used by the destination to decode the information bits. This paper focuses on full-diversity, rather than coding gain. Therefore, one of the codes is a simple regular (3, 6) LDPC code. This means that all the random matrices in (35) are randomly generated satisfying an overall row weight of 6 and an overall column weight of 3. This matrix corresponds to a coding rate of 0.5, but because [2i 1 2i 2 ] are punctured, the actual coding rate is R c = 2/3. The other code that is simulated and is denoted as code 2 is an irregular (λ(x), ρ(x)) LDPC ensemble [22] with left and right degree distributions given by the polynomials We studied the following scenario: • The S 1 -D, S 2 -D and R-D links have the same average SNR. • The S 1 -R and S 2 -R links are perfect. • The coding rate is R c = 2 3 and the cooperation level is β = 2 3 . Fig. 8 shows the main results: the word error rate (WER) of a regular (3,6) LDPC ensemble and of an irregular (λ(x), ρ(x)) LDPC ensemble, which are both full-diversity. It is clear that the DE results are a lower bound on the actual word error rates (a tight lower bound for the regular code and a less tight lower bound for the irregular code). The word error rate of a regular (3,6) LDPC code is only about 1.5dB worse than the outage probability. The irregular LDPC code is only slightly better than the regular (3,6) LDPC code in terms of word error rate.

B. Full-diversity RA codes with improved coding gain
Another technique, suggested in [17] and investigated in [18], that improves the coding gain is called doping. For all the Rootcheck based LDPC codes the reliability of the messages exchanged by the belief propagation algorithm can be improved by increasing the reliability of parity bits (which are not protected by rootchecks). In fact the LLR values of the messages exchanged by the belief propagation algorithm are in the form [17]: l m+1 where α i are the fading coefficients, a i are positive constants and η represents the noise. The higher the coefficients a i , the more reliable are the LLR messages. Since the output messages of the check node are limited by the lowest LLR values of the incoming messages, i.e., the messages coming from parity bits, the doping technique aims to increase those values. The least reliable variable nodes are the parity bits sent on a channel in a deep fade.
In case of block-BEC, consider the parity bits sent on a channel with fading coefficient α 1 = 0 and suppose that all the other fading coefficients are α i = ∞ with i = 1. Consider the parity-check matrix (35). The doping technique consists in fixing the random matrix H 1p1 such that, under BP, all the variable nodes can be recovered after a certain number of iterations. This is equivalent of having reliable parity bits, i.e., connected to rootchecks of a certain order, and it guarantees to increase the coefficients a i .
As proposed in [18], regardless the degree distribution, we test the repeat-accumulate (RA) doping implementation substituting the matrices H 1p1 , H 1p2 and H N with staircase matrices (28). Moreover this particular structure offers the possibility of encoding in linear time.
Eq. (28) illustrates that the first parity bit of each class of parity bits is connected to a second order rootcheck, the second parity bit of each class of parity bits is connected to a third order rootcheck, and so on. Fig 9 reports the simulation results for a regular RA code that show a 0.5dB improvement compared to the proposed regular (3,6) code. Together with the fact that this simple code is now linear-time encoding, this result is impressive because we have lowered the complexity and improved the performance at the same time. As a benchmark the outage probability has been plotted. We have also included the best known LDPC code for the MARC in literature: the rate 2/3 network code proposed in [16]; it reports a loss of almost 2.5dB wrt. the proposed full-diversity RA code.

VIII. CONCLUSIONS AND REMARKS
We have studied LDPC codes for the multiple access relay channel in a slowly varying fading environment under iterative decoding. LDPC codes must be carefully designed to achieve full-diversity on this channel and network coding must be applied to increase the achievable coding rate to a maximum rate R cmax = 2/3. Combining network coding with full-diversity channel coding gave rise to a new family of semi-random fulldiversity joint network-channel LDPC codes for all rates not exceeding R cmax = 2/3. A code that is only 1.5dB away from the outage probability limit has been presented.
For a block fading channel with several fading states per codeword, it has been pointed out that the poor reliability of the parity bits in full-diversity LDPC codes (where especially the information bits are well protected) causes the actual gap with the outage probability limit. We increased the reliability of the parity bits by using a Repeat-Accumulate structure and have improved the coding gain of the presented code construction for the MARC.
ACKNOWLEDGEMENT Daniele Capirone wants to acknowledge Professor Benedetto for helpful and stimulating discussions. This work was supported by the European Commission in the framework of the FP7 Network of Excellence in Wireless COMmunications NEWCOM++ (contract n. 216715).

A. Full-diversity parity-check matrices
The reader can find here a list of full-diversity paritycheck matrices H, i.e., matrices where all information bits are assigned to a rootcheck in the last two set of rows 3c and 4c. Matrix (35) performs the best for reasons of symmetry and randomness. ρ(x) Fig. 10. Part of the compact graph representation of the Tanner graph of proposed code construction. The number of edges connecting (1i 1 − 1p 1 ) to 1c is T . The number of edges connecting 1p 1 to 1c is T 1p . The number of edges connecting 1i 1 to 1c is T 1i . 1λ

equations (38) and (39). b)
The fraction of edges T connecting 1p 1 to 1c is f 1p1c . The fraction of edges T connecting 1i 1 to 1c is f 1i4c . Note that in the first iteration, a 1 1 (x), f 1 1 (x), k 1 1 (x), b 1 1 (x) are equal to µ 1 (x), because the received messages come from check nodes where one of the leaves corresponds to a punctured information bit (so that their message density is a Dirac function on LLR = 0). Therefore the message densities coming from the check nodes are also Dirac functions 14 on LLR = 0. But q 1 (x) and g 1 (x) are different from a Dirac function on LLR = 0 after the first iteration, so that the next iteration also l 1 (x) becomes different from a Dirac function on LLR = 0.
The factor 0.5 in the equations (26) and (27) takes into account that c(3) counts N/4 variable nodes while 3c and 14 The output of a check node y is determined through its inputs x i , i = 1..dc − 1 via the following formula: th(y/2) = dc−1 i=1 th(x i /2). If one of the inputs x i is always zero because its distribution is a Dirac function on LLR = 0, than the output y will always be zero, so that its distribution will also be a Dirac function on LLR = 0. 4c count only N/8 parity check equations. Solving together equations (24)- (27) it is possible to prove that for any degree distribution f 3cc(3) = f 4cc(3) = 1/2 (42)