% Khởi tạo mã xoắn
constraintLength = [4 3];
codeGenerator = [4 5 17;7 4 2];
trellis = poly2trellis(constraintLength,codeGenerator);
tracebackLen = 2;
% Tạo tín hiệu ngẫu nhiên đầu vào
N = 10;
x = randi([0 1],N,1);
% Mã hóa
Txcode = convenc(x,trellis);
% Giải mã
x_ = vitdec(Txcode,trellis,tracebackLen,'trunc','hard');
% Tổng số lỗi
sum(x~=x_)
Không có nhận xét nào:
Đăng nhận xét