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

📄 fromcrtpoly.m

📁 压缩文件中是Error Correction Coding - Mathematical Methods and Algorithms(Wiley 2005)作者:(Todd K. Moon )的配
💻 M
字号:
function [f,gamma] = fromcrtpoly(y,m,gammain)% function [f,gamma] = fromcrtpoly(y,m,gammain)% function [f] = fromcrtpoly(y,m)% function [f,gamma] = fromcrtpoly(y,m)% function [f] = fromcrtpoly(y,mp,gammain)%% Compute the representation of the polynomial f using the Chinese Remainder% Theorem (CRT) using the moduli m = [m1,m2,...,mr].  It is assumed % (without checking) that the moduli are relatively prime.  % Optionally, the gammas may be passed in (speeding computation), and% are returned as optional return values.% Copyright 2004 by Todd K. Moon% Permission is granted to use this program/data% for educational/research onlyr = length(y);mp = 1;for i=1:r  mp = polymult(mp,m{i});endif(nargin==2)  f = 0;  for i=1:r    [q,rm] = polydiv(mp,m{i});    [g,b,y1] = gcdpoly(q,m{i});    gamma{i} = polymult(q,b);    f = polyadd(f,polymult(gamma{i},y{i}));  endelse            % use the passed-in gammas  f = 0;  for i=1:r    f = polyadd(f,polymult(gammain{i},y{i}));  end  gamma = gammain;end% Take the result modulo m[q,f] = polydiv(f,mp);

⌨️ 快捷键说明

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