Reed Solomon encoding/decoding for binary data
显示 更早的评论
I want to encode a binary data with the rsenc. It does the work but it generates random integer parities appenended in the end of the data vector. And when I try to manipulate it with adding random binary values and then pass it through the decoder all the results are messed up. I do get the final result correctly but the rest of the properties are all messed up. Here's one small example of what I did.
message_in_bin_enc = rsenc(message_in_bin_gf,n,k); % example message is [0 0 1] as a galois field.
bin_Rs_enc = message_in_bin_enc;
binRandom = randi([0 1],1,4);
bin_Rs_enc (1,4)= binRandom(1,1);
bin_Rs_enc (1,5)= binRandom(1,2);
bin_Rs_enc (1,6)= binRandom(1,3);
bin_Rs_enc (1,7)= binRandom(1,4);
%So here I tried to manipulate the parity bits with my very own random
%binary bits cause I need the entire data as a binary stream.
% Let's say now the message looks something like [0 0 1 0 0 0 1] assuming
% its a (7,3) RS code.
%Then once it passes through my circuit which (can)randomly flips the
%message bits. e.g : [0 1 0 0 0 0 0] (error)
error = gf(bin_Rs_enc_1,m); % bin_Rs_enc_1 is when it passes through the ciruit and error in introduced.
[corrected_message,sheesh] = rsdec(error,n,k);
%Now if I decode all the results are butchered up for some odd reason tho I
%get the correct final ans.
Please guide me through this. Thank you in advance.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Error Detection and Correction 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!