CCS - Channel Capacity and Coding - Channel Coding - Linear Block Codes - Hamming Codes
Hamming Codes
Matlab Coding
1 % MATLAB script for Illustrative Problem 10.9. 2 echo on 3 k=11; 4 for i=1:2^k 5 for j=k:-1:1 6 if rem(i-1,2^(-j+k+1))>=2^(-j+k) 7 u(i,j)=1; 8 else 9 u(i,j)=0; 10 end 11 echo off ; 12 end 13 end 14 echo on ; 15 16 g=[1 0 0 0 0 0 0 0 0 0 0 1 1 0 0; 17 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0; 18 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1; 19 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0; 20 0 0 0 0 1 0 0 0 0 0 0 1 0 0 1; 21 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1; 22 0 0 0 0 0 0 1 0 0 0 0 1 1 1 0; 23 0 0 0 0 0 0 0 1 0 0 0 0 1 1 1; 24 0 0 0 0 0 0 0 0 1 0 0 1 0 1 1; 25 0 0 0 0 0 0 0 0 0 1 0 1 1 0 1; 26 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1]; 27 28 c=rem(u*g,2); 29 w_min=min(sum((c(2:2^k,:))'));
>> w_min
w_min =
3
Reference,
1. <<Contemporary Communication System using MATLAB>> - John G. Proakis
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步