?? rs_decoder.m
字號:
% a function to realize a decoder, summation of some of the other functions
% the input 'r_x' is the output sequence of the function rs_channel()
% the output 'm_x' is the sequence after decoding
function m_x=rs_decoder(r_x);
disp('伴隨多項式:')
synd_x=rs_decode_syndrome(r_x);
% to view the results clearly, pause, press any key to continue
disp('Press any key to continue...')
pause
disp('錯誤位置多項式:')
sigma_x=rs_decode_iterate(synd_x);
disp('Press any key to continue...')
pause
disp('錯誤位置多項式的根:')
root=rs_decode_root(sigma_x);
disp('Press any key to continue...')
pause
% if number of error is more than t, cases of no root and few or more root will occur
if length(root)==0
disp('檢測不到錯誤發生,解碼輸出:')
m_x=r_x(7:31);
else
disp('錯誤數值和錯誤位置:')
[value,site]=rs_decode_forney(synd_x,sigma_x,root);
disp('Press any key to continue...')
pause
temp=r_x;
for i=1:length(site)
temp(site(i)+1)=rs_add(r_x(site(i)+1),value(i));
end
if length(root)>3
disp('Too many errors occur, can not correct them all')
disp('部分糾錯解碼輸出:')
m_x=temp(7:31);
else
disp('解碼輸出:')
m_x=temp(7:31);
end
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -