DSPRelated.com
Code

Reed Solomon Codes

Senthilkumar March 28, 2012 Coded in Scilab

This funtion is used to generate single error correcting RS code with a 2 bit byte

function[n,p,r] = ReedSolomon_Codes(m)

// Reed-Solomon Codes
//Single-error-correcting RS code with a 2-bit byte
//m = m-bit symbol
k = 1^m; //number of message bits
t =1; //single bit error correction
n = 2^m-1; //code word length in 2-bit byte
p = n-k; //parity bits length in  2-bit byte
r = k/n; //code rate
disp(n,'code word length in 2-bit byte n =')
disp(p,'parity bits length in  2-bit byte n-k=')
disp(r,'Code rate:r = k/n =')
disp(2*t,'It can correct any error upto =')
endfunction
//Result
//-->exec('C:\Users\SENTHILKUMAR\Desktop\Communication_Toolbox\Digital_Communication\ReedSolomon_Codes.sci', -1)
// 
//-->m=2
// m  =
// 
//    2.  
// 
//-->[n,p,r] = ReedSolomon_Codes(m)
// 
// code word length in 2-bit byte n =   
// 
//    3.  
// 
// parity bits length in  2-bit byte n-k=   
// 
//    2.  
// 
// Code rate:r = k/n =   
// 
//    0.3333333  
// 
// It can correct any error upto =   
// 
//    2.  
// r  =
// 
//    0.3333333  
// p  =
// 
//    2.  
// n  =
// 
//    3.  
//