Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Syndrome calculation at Reed-Solomon decoder

Status
Not open for further replies.

serhannn

Member level 4
Member level 4
Joined
Sep 28, 2010
Messages
69
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
1,939
Hi, I'm trying to implement the Berlekamp-Massey algorithm in Matlab to decode Reed-Solomon codes.
As the first, I have to calculate the syndromes obviously to see whether an error has occurred. For this, syndromes are obtained by evaluating the received polynomial at the 2t zeros of the codeword, which means:

S(j)=r(aj)=c(aj)+e(aj)=Σk=0n-1 ek(aj)k j=1,2,...,2t

where t=error correcting capability of the code, n=length of the (n,k) code, a=primitive root of the GF field

When I implement this equation in Matlab, I get the correct result with the following code:

Code:
syndrome=codeword * (alpha.^((n-1:-1:0)'*(1:t2)));

where alpha is the primitive root and codeword is the r in the above equation.

With this code, I get zero-valued syndromes when there is no errors, which means it is correct. But I don't understand why I should write the sum as (n-1:-1:0) rather than (0:1:n-1). If I do the latter, I get a wrong result. Can someone explain why the code should be written like that?

Thanks for your help
 

Your doubt is more of a matlab syntax doubt is what I can gather from your query.

assuming alpha is the polynomial then you are considering the powers of alpha. When computing the powers for alpha

you are multiplying (n-1:-1:0)' * (1:t2) is not equal to (0:1:n-1)'*(1:t2).

Since these are not computed correctly your answer would not correspond to the same matrix, the matrix elements would be flipped symmetrically.

Have fun
 
This is based on how "codeword" is represented. eg, codeword[1] will either correspond to the highest, or lowest degree term. in one of these cases, you have the 0 to n-1. In the other case, it would be n-1 downto 0.
 
kalyanasv & permute: thank you for your answers. I think I found the source of the problem.. I have one more question.
Do you know is it possible to see the source code algorithms in Matlab, such as the Berlekamp-Massey algorithm. I know we can look into the m-files with edit command, but I couldn't find Berlekamp-Massey algorithm in there.
 

Not that I know of. Matlab is not open source, it only lets you source their functions.

Now: a few options for you to try are i) GNU based Octave (which is open source) close to Matlab and reasonably comprehensive

ii)IT++ link which is a neat signal/information theory C++ library by some awesome swedish nerds!
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top