⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rsdecoderoot.m

📁 该程序是RS编译码器的MATLAB仿真程序
💻 M
字号:
%*************************************************************************
%   Copyright (C) 2008 Circuit and System Lab of PKU
%
%   Created     :   2008-5
%   Author      :   houdong(houdong@pku.edu.cn)
%
%   File Name   :   RsDecodeRoot.m
%
%   Abstract    :   Calculating the root for error locator polynomial
%                   
%   Version     :   1.0     2008-5   All Right Reserved.
%*************************************************************************
function RootCalc=RsDecodeRoot(ErrPosPolyCalc)
% ErrPosPolyCalc为错误位置多项式,RootCalc为错误位置的根
table=[1 2 4 8 3 6 12 11 5 10 7 14 15 13 9];
l = length(table);
root1 = zeros(1,length(ErrPosPolyCalc)-1);
indexroot1 = 1;

%将元素代入多项式试探
for i=1:l
    Addall = 1;
    for j=1:length(ErrPosPolyCalc)-1
        temp = table(i);
        for k=1:j-1
            temp = RsSymbolMul(temp, table(i));
        end
        Addall = RsSymbolAdd(Addall, RsSymbolMul(ErrPosPolyCalc(j+1) ,temp));
    end
    if Addall == 0
         root1(indexroot1) = table(i);
        indexroot1 = indexroot1 + 1;
    end
end
j=0;

%试探结果在root1中
for i=1:length(root1)
    if root1(i)~=0
       j=j+1;
   end
end
RootCalc=zeros(1,j);
RootCalc=root1(1:j);


    

⌨️ 快捷键说明

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