rsdecodecalcsynd.m

来自「该程序是RS编译码器的MATLAB仿真程序」· M 代码 · 共 30 行

M
30
字号
%*************************************************************************
%   Copyright (C) 2008 Circuit and System Lab of PKU
%
%   Created     :   2008-5
%   Author      :   houdong(houdong@pku.edu.cn)
%
%   File Name   :   RsDecodeCalcSynd.m
%
%   Abstract    :   recieving the RS code and get the syndrome Polynomial
%                   
%   Version     :   1.0     2008-5   All Right Reserved.
%*************************************************************************
function [Syndrome]=RsDecodeCalcSynd(RsCodeWithNoise)
%RsCodeWithNoise为接收多项式,Syndrome为伴随多项式
T=[1,2,4,8,3,6,12,11,5,10,7,14,15,13,9];
s=zeros(1,4);
for j=1:4
% the following to calculate s(j)=r(a^j)
% all calculations are in the GF(2^4)
   TT=[1,2,4,8,3,6,12,11,5,10,7,14,15,13,9];
   xx=find(TT==T(j+1))-1;
   n=length(RsCodeWithNoise)-1;
   y1=RsCodeWithNoise(1);
   for i=1:n
      y1=RsSymbolAdd(y1,RsSymbolMul(RsCodeWithNoise(i+1),TT(mod(i*xx,15)+1)));
   end
   s(j)=y1;
end
Syndrome=s;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?