Recent posts to Helphttp://sourceforge.net/p/itpp/discussion/115656/Recent posts to HelpenMon, 17 Dec 2012 15:19:43 -0000802.16d Reed-Solomonhttp://sourceforge.net/p/itpp/discussion/115656/thread/b9ffc06d/<div class="markdown_content"><p>So I was having issues and just decided to implement the Euclidean decoder. Everything seems to work fine. Maybe not as fast as the BM algorithm but I can live with it for now.</p></div>CalvinMon, 17 Dec 2012 15:19:43 -0000http://sourceforge.netea21a27db2f1495c8da8461feead9598ddf9f24f802.16d Reed-Solomonhttp://sourceforge.net/p/itpp/discussion/115656/thread/b9ffc06d/<div class="markdown_content"><p>Hey so I found a program written in C that might help us out. It looks like the algorithm is modified a bit to use different init values and some modified loop bounds</p></div>CalvinFri, 14 Dec 2012 15:37:52 -0000http://sourceforge.net936adaf4ac90fe5f6a10b61c482288d4890d6965802.16d Reed-Solomonhttp://sourceforge.net/p/itpp/discussion/115656/thread/b9ffc06d/As far as I know, your proposed 2e+f+1<= dmin = 2t is correct. But I do not have any clue about why this is not working with us, sorry.
BTW: If you want to do best decoding, that is Guruswami-Sudan decoding
(see Madhu Sudan, Venkatesan Guruswami “Improved Decoding of Reed–Solomon and Algebraic-Geometry Codes”). If you want best known decoding with soft-values use Koetter, Ralf; Vardy, Alexander (2003). "Algebraic soft-decision decoding of Reed–Solomon codes". IEEE Transactions on Information Theory 49 (11): 2809–2825. doi:10.1109/TIT.2003.819332.
But I do not have any clue about either of them.Stephan LudwigWed, 12 Dec 2012 15:16:20 -0000http://sourceforge.netb4946e3f554e59eacd251ceb2af53ac4648f0867802.16d Reed-Solomonhttp://sourceforge.net/p/itpp/discussion/115656/thread/b9ffc06d/So I have tried changing b=1, thinking maybe it had something to due with the code being non-narrow-sense...no luck. Still have the same problem.CalvinWed, 12 Dec 2012 15:14:27 -0000http://sourceforge.net13a1c5ef0e2f203c532679ea0225effcfe0c87e8802.16d Reed-Solomonhttp://sourceforge.net/p/itpp/discussion/115656/thread/b9ffc06d/Looking at it closer I found our code matches. In both cases, when there are more than t=8 erasures, the error locator polynomial, Lambda, is no longer of degree 0. This makes me think something is incorrect in the application of the Berlekamp-Massey algorithm.CalvinWed, 12 Dec 2012 14:39:32 -0000http://sourceforge.net06bdb0e93c6e67549cf9670cabbde0792fc6cc81802.16d Reed-Solomonhttp://sourceforge.net/p/itpp/discussion/115656/thread/b9ffc06d/I was under the impression that the equation for number of error/erasures that could be corrected was 2e+f+1<= dmin. Or: e+f/2<=t. So we can correct up to 2t erasures with no errors. This seems correct as the WiMAX code is (255,239) so t=8 and there are 12 erasures. This would mean there can be at max 2 errors, as stated by the standard and found using this equation.
I have also tried the code you posted and found it can only correct t erasures. The code I posted earlier can correct up to 2t. I will take a look at this more tomorrow.CalvinTue, 11 Dec 2012 21:56:08 -0000http://sourceforge.net86a0707267c356fe296db042744c43e928c9ff3e802.16d Reed-Solomonhttp://sourceforge.net/p/itpp/discussion/115656/thread/b9ffc06d/Thanks for the great explanation. I also found a good wiki article that spells this out too: http://en.wikipedia.org/wiki/BCH_code#Calculate_the_syndromes. Just in case anyone else wants to take a look at it.
As for the erasures I am running into a slight problem. I'll explain my problem then give an outline of my code.
So I can decode all the examples in the Wicker book no problem. It should be noted that these are all narrow-sense codes. Moving to the WiMAX code (b = 0), I run into an issue that I think is related to the non-narrow-sense nature of the code. If I specify that there are 12 erasures at position 239 to 250, as stated in the standard, my code will find all the erasures but it will also falsely identify an error at position 36. Now I can tell the calculation of Lambda is incorrect as Lambda != 1. If there are no errors Lambda should not have any roots and be equal to 1.
I will look back at the book but I am fairly certain I did everything properly. Do I need to modify the Berlekamp-Massey algorithm? Or when I calculated Xi did I do something incorrect. Thanks.
I should note that after finding Psi I treat erasures and zeros the same as the procedure is exactly the same. Finding the zeros of Psi gets the zeros of Lambda, which are the errors we don't know, and the zeros of gamma, which we do.
reedsolomon.cpp
~~~~~
bool Reed_Solomon::decode(const bvec &coded_bits, const int nerasure, const ivec &erasurepos, bvec &decoded_message, bvec &cw_isvalid)
{
.
.
.
GFX rx(q, n - 1), cx(q, n - 1), mx(q, k - 1), ex(q, n - 1), S(q, 2 * t), Gamma(q), Xi(q), Lambda(q),
OldLambda(q), T(q), Psi(q), Psiprim(q), Omega(q);
GFX dummy(q), One(q, (char*)"0"), X(q, (char*)"-1 0"), Xitemp(q), Omegatemp(q);
GF delta(q), tempsum(q), rtemp(q), Xk(q), Xkinv(q);
ivec errorpos;
for (i = 0; i < iterations; i++) {
.
. (fixing the Rx)
.
//Fix the Erasure polynomial Gamma(x).
Gamma = GFX(q, (char*)"0");
for (j = 0; j < nerasure; j++) {
Gamma *= One + GF(q, erasurepos[j])*X;
}
//Fix the syndrome polynomial S(x).
S.clear();
for (j = 1; j <= 2 * t; j++) {
S[j] = rx(GF(q, j + b0 - 1));
}
Xitemp = Gamma * (One + S) - One;
Xi.set_degree(2 * t);
for (j = 0; j <= 2 * t; j++) {
Xi[j] = Xitemp[j];
}
if (Xi.get_true_degree() >= 1) { //Errors in the received word
.
. (Iterate to find Lambda, use Xi instead of S)
.
Psi = Lambda * Gamma;
//Find the zeros to Psi(x).
errorpos.set_size(Psi.get_true_degree());
errorpos.clear();
foundzeros = 0;
for (j = q - 2; j >= 0; j--) {
if (Psi(GF(q, j)) == GF(q, -1)) {
errorpos(foundzeros) = (n - j) % n;
foundzeros += 1;
if (foundzeros >= Psi.get_true_degree()) {
break;
}
}
}
if (foundzeros != Psi.get_true_degree()) {
decoderfailure = true;
}
else {
//Compute Omega(x) using the key equation for RS-decoding
Omega.set_degree(2 * t);
Omegatemp = Lambda * (One + Xi);
.
.
.
}
.
.
.
}
.
.
.
}
.
.
.
}
CalvinTue, 11 Dec 2012 15:53:13 -0000http://sourceforge.netda1dcba3a0d3d2e666466b500f34cc35f369cb81802.16d Reed-Solomonhttp://sourceforge.net/p/itpp/discussion/115656/thread/b9ffc06d/So I did find a solution but it is kinda a hack. There may be a reason it works but idk. So I create a tmpPoly which is set by:
~~~
if (b0) {
tmpPoly = GFX(q, (char*)"0");
}
else {
tmpPoly = GFX(q, (char*)"-1 0");
}
.
.
.
ex[errorpos(j)] = (tmpPoly(Xk) * Xk * Omega(Xkinv)) / Psiprim(Xkinv);
~~~
This is the relationship I had seen before. Where the calculated magnitude was off by alpha^i, where the error was at location i. So in this case if b0 = 1 the magnitude is calculated via:
~~~
ex[errorpos(j)] = (Xk * Omega(Xkinv)) / Psiprim(Xkinv);
~~~
if b0 = 1, then:
~~~
ex[errorpos(j)] = (Xk * Xk * Omega(Xkinv)) / Psiprim(Xkinv);
~~~
CalvinMon, 10 Dec 2012 17:00:23 -0000http://sourceforge.net4cb455c767e4a934bd8e3ada4a4efb1140c248f9802.16d Reed-Solomonhttp://sourceforge.net/p/itpp/discussion/115656/thread/b9ffc06d/Hi,
thanks for providing the code. From your description, I think that changing the generator polynomial is severe. I cannot reason why that is the case, yet.
Just a short reply ahead of looking at the code: I think your generator polynomial is not correct for b0 = 0, because b0 must be >= 1 (maybe there exists also an upper bound. Recall p. 181 Def. 8-2, where a BCH-Code is called narrow-sense iff b=1. This is not a proper reason, but a feeling.
b cannot be zero, because the first term will be x-alpha^(b0+0) = x - 1 which is independent of alpha. I have not thought about, how this will affect coding - will need some time for that.
Are you sure that b0 = 0 is used in the standard? I have not had a look at the std documents yet.
I will have a look at the code and will be back.Stephan LudwigMon, 10 Dec 2012 15:43:29 -0000http://sourceforge.net1ca44e0e48e8a3ceaecff58227b8cabd2d29a5dd802.16d Reed-Solomonhttp://sourceforge.net/p/itpp/discussion/115656/thread/b9ffc06d/Hey,
So I took a look at the code you posted and found a couple reasons explaining our differences. First, the input vector did not match the one I am using. Second, the default IT++ generator polynomial does not match that in the IEEE standard. I have modified the test program you made as well as the reedsolomon.* files. I have attached them. You will see the corrections made to bvec variables. I have added a variable b0 which is used in the generator polynomial: g = (x + alpha^(b0+0))*(x + alpha^(b0+1))*...(x + alpha^(b0+2t-1)). IT++ defaults to a b0 = 1. If I set b0 to 1 everything works fine. But when I change b0=0, the encoder is now correct but the decoder does not calculate the correct error magnitude. I had to change lines 148 and 219 to also take into account b0. I have also included print statements in the code for easier debugging.
CalvinMon, 10 Dec 2012 14:53:46 -0000http://sourceforge.net1f35d1e78c3f6319373f656ec87a6928c4b4b5d6