목록Wireless Comm. (94)
UOMOP
BCH Decoder function Mhat = BCHdecoder(R, K, t) R = mod(R, 2); N = length(R); m = log2(N+1); a = gf(2, m); S = []; for i = 1 : 2*t S = [S GetSyndrom(R, a^i)]; end S = gf(S, m); Sk = gf(zeros(t, t+1), m); for x = 1 : t for y = 1 : t+1 Sk(x, y) = S(x+y-1); end end Sm = Sk(: ,1 : t); Sv = Sk(:, t+1); Sigma = inv(Sm) * Sv SigCoeff = [1 flip(Sigma')] Beta = []; for i = 1 : N sig_a = GetSyndrom(SigCoe..
RS Encoder function U = RSEncoder(M) K = length(M); m = M.m; N = 2^m-1; DegPoly = N - K; P = flip(rsgenpoly(N, K)); LFSR = gf(zeros(1, N-K), m); U = gf(zeros(1, N), m); U(N-K+1:N) = M; for i = 1 : K feedback = LFSR(DegPoly) + M(K-i+1); for j = DegPoly : -1 : 2 LFSR(j) = LFSR(j-1) + feedback*P(j); end LFSR(1) = feedback * P(1); end U(1:(N-K)) = LFSR; RS Decoder function Mhat = RSDecoder(R) a = gf..
function Mhat = cyclicdecoder(R, P, T) %usage : received vector(R), 생성 vector(P), syndrom(T)을 이용하여 massage(M)을 도출 %input : R=received massage, P=생성다항식계수, T = syndrom Table %output : M = only massage using decorder K = length(R); N = length(P)+K-1; DegPoly = N-K; LFSR = zeros(1, DegPoly); a = K-(N-K); for i = 1 : a feedback = mod(R(K+1-i)+LFSR(N-K), 2); str = sprintf('Input mesag : %d \nCurrent L..
function U = cyclicencoder(M, P) %usage : 메세지 벡터와 생성 벡터을 입력받고 cyclicencoding된 코드워드를 출력한다. %input : M=massage, P=생성다항식계수 %output : U = codeword using cyclicencoding K = length(M); N = length(P)+K-1; DegPoly = N-K; LFSR = zeros(1, DegPoly); U = zeros(1, N); U(N-K+1 : N) = M; for i = 1 : K feedback = mod(M(K+1-i)+LFSR(N-K), 2); str = sprintf('Input mesag : %d \nCurrent LFSR : %s \nFeedback : %d', M..