I have the task of encoding and decoding some bytes of sound using parity checksum method and Reed-Solomon Erasure Correction. I've done my encoding for first method(parity checksum) but need help completing the second method which is detection by Reed-Solomon Erasure Correction.
So far I know that, RS code adds t
symbols to k
symbols of data. So it is able to locate and correct up to t/2
symbols or if the error locations are known so called erasures. It can correct up to t
. For this task I have to use Galois field GF(28) to represent each symbol as a byte. Operation addition and subtraction are based on XOR. So over all I have to employ Reed-Solomon codes that are capable of correction up to t=3
erasures. The computation of a single Reed Solomon code in now as follow
C0 | C1 |........| Ck-1 | Ck | Ck+1 | Ck+2
so the code bytes can be viewed as vector c=[c0,c1,...,ck+2]
and a single code C
is computed from k bytes of data as follow
d=[d0,d1,...,dk-1]
, so my encoding and decoding process require the following Vandermonde matrix F
1 1 12 13 ... 1k-1 1 2 22 23 ... 2k-1 ... 1 k+2 (k+2)2 (k+2)3 ... (k+2)k-1 1 k+3 (k+3)2 (k+3)3 ... (k+3)k-1
so a simple matrix vector multiplication using F
& D
we get C=F.D
.
so far what I did for encoding is as follow :
#else
void fox_encode(Buffer* bufin, Buffer* bufout, FoxEncData* algorithm_data){
// Your encoder for Task 2.C.3 goes in here !!!
while (bufin->size >= 1){
guint8 databyte = bufin->data[0]; //Pick up a byte from input buffer
buffer_push_byte (bufout, databyte); //Send it 3 times
buffer_push_byte (bufout, databyte);
buffer_push_byte (bufout, databyte);
buffer_pop (bufin, 1); //Remove it from the input buffer
}
}
#endif
I need code to complete this code for encoding and decoding my fox_encode and fox_decode class using Reed-Solomon Erasure Correction. Any Help will be appreciated to complete this task as soon as possible.
Thanks in advance