BCH CODE - with codeword length
조회 수: 9 (최근 30일)
이전 댓글 표시
hey guys, i really need help at the following BCH CODE
it did not work with me, im stuck now
here is the instruction:
Before encoding, you need to convert your data u into a Galois field array using the command gf(u,1).
ugf=gf(u,1);
Then encode ugf into a codeword v, using bchenc(); that's the BCH encoder function. You don't need to generate any polynomial.
Add binary noise z to v mod-2 (XOR) to get y. In order to add the noise mod-2, you'll have to convert your binary noise z to a Galois field array using gf(z,1) just as you did u.
The xor and mod operators won't work with v, since v is a Galois field array (necessary for bchenc() and bchdec()).
Decode y using the BCH decoder function bchdec().
The output of bchdec() will be uhat.
f you look at the example in doc bchdec(), be careful not to use the same noise or entire code, because the example is not doing what I'm doing.
here is what i did
clc
clear
n = 63;
k = 30;
u = randi ([0,1],k);
ugf=gf(u,1);
v = bchenc(ugf,n,k);
z = randi ([0,1],k);
zgf = gf(z,1);
for i = 1:1:k
for j = 1:1:k
if v==zgf
y(i,j)=0
else
y(i,j)=1
end
end
end
any help please?
댓글 수: 3
Walter Roberson
2013년 12월 7일
y(1:k, 1:n) = 1 - v(1:k, 1:n);
I do not see any "v = mod(v,2)" in your code.
답변 (0개)
참고 항목
카테고리
Help Center 및 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!