Reed-Solomon Codes over Cyclic Polynomial Ring with Lower Encoding/Decoding Complexity
Abstract
000‡: Corresponding author. This work was partially supported by the Key-Area Research and Development Program of Guangdong Province 2020B0101110003, National Key R&D Program of China (No. 2020YFA0712300), the National Natural Science Foundation of China (No. 62071121, 62371411, 12025104), Basic Research Enhancement Program of China under Grant 2021-JCJQ-JJ-0483.Reed-Solomon (RS) codes are constructed over a finite field that have been widely employed in storage and communication systems. Many fast encoding/decoding algorithms such as fast Fourier transform (FFT) and modular approach are designed for RS codes to reduce the encoding/decoding complexity defined as the number of XORs involved in the encoding/decoding procedure. In this paper, we present the construction of RS codes over the cyclic polynomial ring and show that our codes are maximum distance separable (MDS) codes. Moreover, we propose the FFT and modular approach over the ring that can be employed in our codes for encoding/decoding complexity reduction. We show that our codes have 17.9% encoding complexity reduction and 7.5% decoding complexity reduction compared with RS codes over finite field, for .
I Introduction
Reed-Solomon (RS) codes are a class of maximum distance separable (MDS) codes that have been widely employed in communication and storage systems [1]. An RS code encodes data symbols to obtain the codeword symbols over the field , where are positive integers, and . In general, we can construct RS codes by choosing the Vandermonde matrix as generator matrix and the codes are MDS if and only if .
Encoding/decoding complexity defined as the total number of XORs involved in the encoding/decoding (error correction) procedure is the key metric for RS codes. Field addition and field multiplication are two basic operations in the encoding/decoding procedure, where one field addition over requires XORs and one field multiplication over requires much more XORs. Many fast encoding/decoding algorithms [2, 3, 4, 5, 6, 7, 8, 9, 10] have been proposed for encoding/decoding complexity reduction. We can divide the existing fast encoding/decoding algorithms into two methods. One method is to reduce the number of basic field operations, including addition and multiplication operations, such as [2, 3, 4, 5]. To the best of our knowledge, the fast Fourier transform (FFT) and modular approach [4] achieve the best asymptotic number of field operations, where the number of field operations involved in encoding procedure is and the number of field operations involved in decoding procedure is . Another method [6, 7, 8, 9, 10] is to construct RS codes over the cyclic polynomial ring or more general ring that can avoid the expensive field multiplication. We will present new fast encoding/decoding algorithms for RS codes by jointly considering the above two methods.
The main contributions of the paper are summarized as follows. First, we propose RS codes over the cyclic polynomial ring and show that our codes are MDS codes. Second, we propose fast encoding/decoding algorithms for our codes by employing the FFT and modular approach over the ring in the encoding/decoding procedure. We show that our codes can achieve the best asymptotic number of field operations required in the encoding/decoding procedure. Third, we evaluate the encoding/decoding complexity for our codes and the RS codes over finite field to show that our codes have lower encoding/decoding complexity. Specifically, our codes can reduce encoding complexity and decoding complexity compared with RS codes over the field with the fast encoding/decoding algorithms in [4], for .
II RS Codes over Cyclic Polynomial Ring
In this section, we present the construction of our RS codes over the cyclic polynomial ring , where is an odd number. Then we show our codes are MDS codes. Throughout the paper, we use the notation and for positive integer . Let be the number of elements in set .
II-A Construction
We denote the ring by and our codes are operated over , where is an odd number. We can factorize as a product of distinct irreducible polynomials over , i.e.,
where and for .
By the Chinese remainder theorem, the ring is isomorphic to the direct sum of the fields , , , [11, Theorem 6]. The isomorphism
is defined by
(1) |
where . For element , denote the -th component of as , i.e., . We can directly obtain the following result without proof.
Lemma 1.
The polynomial is invertible if and only if .
Next, we provide the definition of our RS codes over , where and .
For , since and , there exists a unique subfield of size in . We choose a basis of the subfield and denote it as . For , let , where is the inverse mapping of which is in Eq. (1). For , define
(2) |
where and is the binary representation of .
Given the data symbols , we will proof in Theorem 2 that there exists a polynomial such that for and we define the codeword symbols as
thus our codes are systematic codes. The codes defined above can be viewed as replacing the data symbols with and constructing codes by the generator matrix
(3) |
For , denote . We can compute that , where and is the binary representation of . The next theorem shows that our codes are well-defined and are MDS codes.
Theorem 2.
Our codes are well-defined and are MDS codes.
Proof:
Firstly, we proof that the determinant of any submatrix of the generator matrix in Eq. (3) is invertible in . This is equivalent to show that the determinant
is invertible in , where . And it is equivalent to proof that , is invertible in . For any , we can show
by the fact that the binary representations of and are different and are linearly independent for any . Therefore, is invertible by Lemma 1, and the determinant of any submatrix of the generator matrix in Eq. (3) is invertible in .
Given the data symbols , finding a polynomial such that for is equivalent to solving the equation
(4) |
Since the determinant of any submatrix of the generator matrix in Eq. (3) is invertible, the polynomial exists and is unique, thus our codes are well-defined.
Similar to the proof in [6], our codes are MDS codes if and only if the determinant of any submatrix of the generator matrix in Eq. (3) is invertible in . Therefore, our codes are MDS codes.
∎
III Encoding and Decoding Methods
In this section, we present FFT and the inverse FFT (IFFT) algorithms over . Then the encoding/decoding algorithms based on FFT and modular approach for our codes are presented. By a small abuse of the notation, we use the same indeterminate when referring to polynomials as elements in or . When the modulo operation is applied to a vector, it represents performing the modulo operation on each component.
For simplicity, we assume in this section, in which case the subfield generated by is identical to for . Otherwise, the same argument holds by replacing with the subfield generated by for .
III-A FFT and IFFT Algorithms over and
The FFT and IFFT algorithms over and are presented as follows.
-
(1)
[FFT and IFFT Algorithms over ]
For , the subspace polynomial [12] over is defined by for . For , define
where is the binary representation of . To avoid confusion, we use instead of to denote when it comes to polynomial ring . Since the degree of is for , the set is a basis of . For any , any with can be uniquely represented as the linear combination . The vector is the coordinate vector of with respect to the basis . Then the FFT over the field , denoted by , is defined by
where .
Since the set forms a finite field of size and holds, is well-defined and can be calculated by [4, Algorithm 2].
-
(2)
[FFT and IFFT Algorithms over ]
Similarly, define for . For , define
where is the binary representation of . Since we proved that for any , is invertible in in Theorem 2, we can show that is invertible in for . Therefore, is well defined, the degree of is and the leading coefficient is invertible. Then the set forms a basis of . Similarly, for any and with , the coordinate vector of with respect to the basis is denoted as . Then the FFT over , denoted by , is defined by
where .
Next we provide the algorithm for computing and prove its correctness. The FFT algorithm over is presented in Algorithm 1, where and . We proof in Theorem 3 that Algorithm 1 exactly output .
Theorem 3.
Algorithm 1 exactly output .
Proof:
Denote for and . For , define and denote as the coefficient vector of with respect to the basis .
For , taking all elements in the computation process modulo component-wise, the input is . Therefore, the input of Algorithm 1 is identical to the input of in [4, Algorithm 2] when taken modulo .
For , it is straightforward to verify that the intermediate steps of this algorithm are also identical to the algorithm in [4, Algorithm 2] under modulo by the following equation
Based on the above discussion, the output of Algorithm 1 is equivalent to the output of
under modulo for . Assuming the output of Algorithm 1 is , then we have(5) Since is a ring isomorphism, it must be the case that for . Therefore Algorithm 1 exactly output .
∎
The IFFT algorithm over and can be defined similarly.
III-B Encoding Algorithm
Given the data symbols , there exists such that for by the construction in Section II. For , denote
By the definition of our codes, are the parity symbols and are the data symbols. Then we only need to compute the parity symbols .
For any with , i.e., , denote by
(6) |
where and for .
For and , define and
For , is a codeword of RS codes over the field whose data symbols are . The next Lemma shows the formula for calculating .
Lemma 4.
The parity symbols of our RS codes can be calculated as follows,
Proof:
By the definition of and , the following equation can be concluded for any and ,
(7) |
where denotes the coordinate vector of with respect to the basis and modulo is taken component-wise.
Similarly,
(8) |
Therefore, applying these two equations iteratively yields
(9) | ||||
For , since is a codeword of RS codes over the field and are data symbols, then the following equation holds for by [13, Lemma 10].
(10) |
∎
III-C Decoding Algorithm
In [4], there are two algorithms for decoding RS codes based on FFT and modular approach, i.e., the frequency-domain modular approach (FDMA) and the fast modular approach (FMA). In this section, we will generalize the FDMA algorithm to our codes, and a similar generalization can be applied to the FMA algorithm.
Assume that the received vector over is represented as
where is the error pattern. Correspondingly, for , the received vector over the field is represented as , where and for
.
Since is the codeword of RS codes over for , the trivial approach is to use the FDMA algorithm in [4] to decode RS codes to obtain the codewords , then use to obtain the original codeword . However, this method performs multiplication in the fields , which has a higher multiplication complexity than in the cyclic polynomial ring. Our idea is to merge the decoding procedures over the fields and perform all multiplications in the cyclic polynomial ring without the need for modular decomposition.
We will present the algorithm in five steps:
III-C1 Syndrome
For and , define
where is the binary representation of .
Denote the coordinate vector of the syndrome polynomial with respect to as , then combined with the following Lemma 5, we show that we can compute by
where for . Subsequently, the syndrome
is computed by .
Next Lemma shows the relationship between the obtained syndromes and the corresponding syndromes of RS codes over fields.
Lemma 5.
For , denote as the syndrome polynomial of the RS code over the field whose coordinate vector with respect to is denoted as , then
III-C2 Solving the Key Equation by FDMA
Given the syndrome , the FDMA algorithm outputs , where is the error locator polynomial and is the error evaluation polynomial.
The FDMA algorithm corresponding to our codes is presented in Algorithm 2, in which is the indicator function (i.e., ) and the extended IFFT algorithm is identical to [4, Algorithm 5]. In Algorithm 2, for and , can be computed as follows by the inverse mapping of the Chinese remainder theorem:
where represents the inverse of in . Since can be computed in advance, computing requires multiplications in . The correctness of the extended IFFT algorithm used in Algorithm 2 can be proved similarly to the FFT algorithm.
The next Lemma 6 shows the relationship between the obtained error locator polynomial and the error evaluation polynomial to the corresponding two polynomials of RS codes over fields, which shows the rationality of our FDMA algorithm.
Lemma 6.
For , denote the error locator polynomial of RS codes over as and denote the corresponding error evaluation polynomial as , then obtained by our FDMA algorithm in Algorithm 2 satisfies:
Proof:
For , if all elements in the computation process are taken modulo component-wise, the input is the same as the input for the FDMA algorithm over as described in [4, Algorithm 4] due to Lemma 5. Furthermore, it can be verified that steps 1-30 are also the same as in the FDMA over when taken modulo . Therefore, we obtain
(11) |
where .
Similar to Eq. (7), we can obtain the following property of extended IFFT. For any and , the following holds:
(12) |
Therefore, combining Eq. (11) and Eq. (12), we have:
where the last equation is obtained by Step 23 in [4, Algorithm 4]. The equation for can be similarly proved.
∎
III-C3 Chein search
The Chein search algorithm to find the error locations corresponding to our codes is given by Algorithm 3. Assuming the set of error locations for RS codes over the field is denoted as , and the set of error locations obtained by our Chein search algorithm is denoted as for .
The next Lemma shows that for , which shows the rationality of our Chein search algorithm.
Lemma 7.
for .
III-C4 Formal Derivative
The algorithm for formal derivative is identical to that in [13], which computes the derivative of the error locator polynomial .
III-C5 Forney’s Formula
We present Forney’s formula for our codes to retrieve the original data symbols as follows.
For , if , it implies that there is no error at . Therefore, let . Otherwise, calculate and , then let . The next theorem shows that the obtained are indeed the original data symbols.
Theorem 8.
If the number of errors is no larger than the error correction capability, then our decoding algorithm can retrieve the original data symbols.
Proof:
It can be verified by Lemma 6 that the steps of Forney’s formula for our codes are equivalent to the following steps when taken modulo for : For , if , then let , otherwise let . By Lemma 7, the steps are indeed the procedure of Forney’s formula over the field presented in [4]. Therefore for and , is the original data symbol of RS codes over when taken modulo , i.e., , which implies that obtained by Forney’s formula are indeed the original data symbols of our codes. ∎
We can show that the asymptotic number of addition and multiplication operations involved in the encoding/decoding procedure of our codes is identical to [4].
IV Reduce Encoding/decoding complexity
In this section, we propose several methods to reduce encoding/decoding complexity by minimizing the XOR operations required for multiplication in the cyclic polynomial ring .
IV-A Efficient Multiplication by Circular Shifts
Due to the equation in , all multiplication in the ring during encoding/decoding procedure can be replaced with the multiplication in . It is sufficient to take the final results of the encoding/decoding procedure modulo to ensure the correctness of the outcomes. The multiplication in can be efficiently performed using circular shifts, as outlined in Algorithm 4, where represents the integer such that .
In comparison to the field multiplication where additional modulo operations are required after polynomial multiplication, multiplication in the ring involves fewer XOR operations.
IV-B Preprocessing in the Ring
According to Algorithm 4, the more zeros in the coefficients of , the fewer XOR operations are needed. Therefore, we present the following preprocessing steps: Iterate through the coefficients of and count the number of zeros, denoted as . If , then let and replace with , resulting in zeros in the coefficients of , which is more than before preprocessing. Since holds, the preprocessing does not affect the correctness.
We categorize all multiplications into two cases. In the first case, both factors are dependent on the received codeword and such multiplications are only computed during the FDMA algorithm when calculating and . For this case, it is sufficient to preprocess and for . The XOR operations involved in preprocessing are counted in the decoding procedure. In the second case, at least one of the factors is independent of the received codeword and can be computed in advance. For example, when performing FFT algorithm in Algorithm 1, the factor can be computed in advance. Therefore, we preprocess the factor and the additional XOR operations required are not counted in the encoding/decoding procedure.
IV-C Selection of
Since the selection of for and only needs to satisfy the conditions given in II-A, and throughout the encoding/decoding procedure, the majority of multiplications stem from FFT and IFFT, with nearly identical parameters. Therefore, a meticulous choice of for and will be introduced to reduce the number of XORs required for the multiplication in the FFT and IFFT algorithms.
Taking the computation of the syndrome as an example, it involves calculating for . For each , there are a total of multiplications in . Each multiplication involves a factor of the form , where . Assuming represents the sum of the number of non-zero coefficients of after preprocessing in all multiplications during the calculation of , where the first parameter in IFFT is independent of . The objective is to minimize . The variables are the bases , where .
When the parameters and of the code are small, an exhaustive algorithm can be employed. Otherwise, we start by randomly choosing for to determine the expression of and the value of . The subsequent bases for can be determined by the following approximate algorithm. Let . If is linearly independent of for all , then set for . Otherwise, select the that has the second smallest and check if it satisfies the condition. Continue this process until all bases are determined.
V Comparison of encoding/decoding complexity
In this section, we compare the encoding/decoding complexity of our codes with RS codes over finite fields presented in [4]. First, we discuss the parameters.
is a field if and only if is a primitive element in [6], which occurs when . In this case, we can directly apply the encoding/decoding algorithms for RS codes over fields in [4] and reduce encoding/decoding complexity by the methods discussed in Section IV. Now, we consider the case when is not a field. The code lengths of our codes for different are shown in Table I.
7 | 9 | 15 | 17 | 21 | 23 | 25 | |
---|---|---|---|---|---|---|---|
Code Length |
Due to the code length being much smaller than the size of the ring when the irreducible factorization of has a large , we find that there is no benefit in using our codes in such cases through numerical experiments. Therefore, the subsequent discussion focuses the case of and , corresponding to .
We compare the encoding/decoding complexity for our codes with RS codes over finite fields presented in [4]. Considering the parameters of our codes: Since , each data symbol has bits, and the code length is . For the comparison, RS codes over finite fields have two options. The first option is to take RS codes defined over , satisfying , and the code length can reach . The second option is to divide each data symbol into two parts, each having bits. This enables encoding/decoding using two RS codes over with the resulting data symbols, and each RS code can achieve a code length of . We choose the second approach for comparison because it possesses lower encoding/decoding complexity.
For the parameters , , and , we consider our (2048, 1984) RS code over . The encoding and decoding procedures are performed as described in Section III and IV. For comparison, two (2048, 1984) RS codes over are selected, using the encoding/decoding algorithms described in [4]. The choice of the irreducible polynomial is made to reduce the number of XORs in field multiplication. The comparisons are carried out by repeatedly performing encoding and decoding and counting the average number of XORs at each step. Table II shows the detailed comparisons.
Steps | Average XOR Operations | |
RS codes over | Two RS codes over field | |
Encoding | 1389200.4 | 1692843.6 |
Syndrome | 1420710 | 1736304 |
Key equation | 2081194.8 | 2210871 |
Chein search | 1489731.4 | 1482622.4 |
Formal derivative | 44896 | 30605.6 |
Forney’s formula | 242024.5 | 250949.2 |
Total decoding | 5278556.7 | 5711352.2 |
In the encoding/decoding procedure of our codes, we find a choice of according to the method in IV-C as follows: , , , , , , , , , , , where is the indeterminate of .
According to Table II, the proposed algorithm for our codes over the cyclic polynomial ring reduces the number of XORs by 17.9% during encoding and 7.5% during decoding.
VI Conclusion
In this paper, we construct RS codes over the cyclic polynomial ring . In addition, we generalize the encoding/decoding algorithms for RS codes over finite fields in [4] to our codes. We then reduce encoding/decoding complexity by the structure of the cyclic polynomial ring . Finally, we demonstrate that our codes can reduce 17.9% encoding complexity and 7.5% decoding complexity compared with the RS codes over finite fields when .
References
- [1] I. S. Reed and G. Solomon, “Polynomial Codes over Certain Finite Fields,” J. Soc. Ind. Appl. Math., vol. 8, no. 2, pp. 300–304, 1960.
- [2] M. F. I. Chowdhury, C.-P. Jeannerod, V. Neiger, É. Schost, and G. Villard, “Faster Algorithms for Multivariate Interpolation With Multiplicities and Simultaneous Polynomial Approximations,” IEEE Trans. Inf. Theory, vol. 61, no. 5, pp. 2370–2387, 2015.
- [3] N. Tang and Y. Lin, “Fast Encoding and Decoding Algorithms for Arbitrary Reed-Solomon Codes Over ,” IEEE Communi. Lett., vol. 24, no. 4, pp. 716–719, 2020.
- [4] N. Tang and Y. S. Han, “A New Decoding Method for Reed–Solomon Codes Based on FFT and Modular Approach,” IEEE Trans. Commun., vol. 70, no. 12, pp. 7790–7801, 2022.
- [5] W. K. Kadir, H.-Y. Lin, and E. Rosnes, “Efficient Interpolation-Based Decoding of Reed-Solomon Codes,” in 2023 IEEE Int. Symp. Inf. Theory (ISIT), 2023, pp. 997–1002.
- [6] M. Blaum and R. Roth, “New array codes for multiple phased burst correction,” IEEE Trans. Inf. Theory, vol. 39, no. 1, pp. 66–77, 1993.
- [7] H. Hou, K. W. Shum., M. Chen, and H. Li, “BASIC Codes: Low-Complexity Regenerating Codes for Distributed Storage Systems,” IEEE Trans. Inf. Theory, vol. 62, no. 6, pp. 3053–3069, 2016.
- [8] H. Hou and Y. S. Han, “A New Construction and an Efficient Decoding Method for Rabin-Like Codes,” IEEE Trans. Commun., vol. 66, no. 2, pp. 521–533, 2018.
- [9] H. Hou, Y. S. Han, K. W. Shum, and H. Li, “A Unified Form of EVENODD and RDP Codes and Their Efficient Decoding,” IEEE Trans. Commun., vol. 66, no. 11, pp. 5053–5066, 2018.
- [10] H. Hou, Y. S. Han, P. P. Lee, Y. Wu, G. Han, and M. Blaum, “A Generalization of Array Codes with Local Properties and Efficient Encoding/Decoding,” accepted in IEEE Trans. Information Theory, (early access: https://ieeexplore.ieee.org/document/9868795), 2022.
- [11] H. Hou, Y. S. Han, P. P. C. Lee, Y. Hu, and H. Li, “A New Design of Binary MDS Array Codes with Asymptotically Weak-Optimal Repair,” IEEE Trans. Inf. Theory, vol. 65, no. 11, pp. 7095––7113, 2019.
- [12] S. Gao and T. Mateer, “Additive Fast Fourier Transforms Over Finite Fields,” IEEE Trans. Inf. Theory, vol. 56, no. 12, pp. 6265–6272, 2010.
- [13] S.-J. Lin, T. Y. Al-Naffouri, and Y. S. Han, “FFT Algorithm for Binary Extension Finite Fields and Its Application to Reed–Solomon Codes,” IEEE Trans. Inf. Theory, vol. 62, no. 10, pp. 5343–5358, 2016.