zoukankan      html  css  js  c++  java
  • CCS

    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

  • 相关阅读:
    乱七八糟的
    C# 获取客户端电脑MAC 地址
    CheckInput
    gridview 合计行实现
    乱七八糟22
    jQuery UI CSS Framework
    CSS float和CSS clear
    smtp,POP3,IMAP
    960GridSystem
    CSS 清除浮动
  • 原文地址:https://www.cnblogs.com/zzyzz/p/13759255.html
Copyright © 2011-2022 走看看