資源簡介
CRC循環冗余編碼的編譯碼過程,在matlab下的仿真程序
代碼片段和文件信息
function?[Xerror]=CRCdecode(B)
G=[11100100001100111];
LG=length(G);
LB=length(B);
P=B(1:LG);
pointer=LG;
while?pointer<=LB
????????P=xor(PG);
??????????if?pointer==LB
???????????????break;
??????????end?????
?????????if?sum(P)==0
??????????????for?i=1:LG
??????????????????pointer=pointer+1;
??????????????????P(i)=B(pointer);
??????????????????if?pointer==LB
??????????????????????break;
??????????????????end????
??????????????end
???????????????
?????????else
???????????????for?j=1:LG
??????????????????if?P(j)==1
??????????????????????k=j;
???????????????????????????for?i=1:LG+1-k
??????????????????????????????P(i)=P(k-1+i);
???????????????????????????end
??????????????????????break;
???????????????????end
????????????????end
????????????????if?k>1?
????????????????????for?i=LG-k+2:LG
???????????????????????pointer=pointer+1;
???????????????????????P(i)=B(pointer);
???????????????????????if?pointer==LB
???????????????????????????break;
???????????????????????end????
????????????????????end
????????????????end???????????
?????????end??????????
?end
?
?if?sum(P)==0
?????error=0;
?????X=B(1:end-LG+1);
?else
?????error=1;
?????X=B(1:end-LG+1);
?end??
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1231??2007-01-16?14:22??crc_matlab\CRCdecode.m
?????文件????????405??2007-05-07?21:14??crc_matlab\crcmainprogram.m
?????文件???????1673??2007-01-14?20:58??crc_matlab\cyclic_redundancy_code.m
?????文件???????1961??2007-01-14?21:28??crc_matlab\cyclic_redundancy_decode.m
?????目錄??????????0??2009-02-28?23:41??crc_matlab
-----------?---------??----------?-----??----
?????????????????5270????????????????????5
- 上一篇:曲線旋轉得到曲面的MATLAB程序
- 下一篇:matlab鏈碼提取算法
評論
共有 條評論