zoukankan      html  css  js  c++  java
  • CCS

    Linear Block Codes

    Linear block codes are the most important and widely used class of block codes. A
    block code is linear if any linear combination of two codewords is a codeword. In the
    binary case, this means that the sum of any two codewords is a codeword. In linear
    block codes the codewords form a k-dimensional subspace of an n-dimensional space.
    Linear block codes are described in terms of a generator matrix G, which is a k x n
    binary matrix such that each codeword c can be written in the form

    where u is the binary data sequence of length k (the encoder input). Obviously, the
    all-0 sequence of length n is always a codeword of an ( n, k) linear block code.

    Matlab Coding

     

     

    % MATLAB script for Illustrative Problem 10.8.
    % Generate U, denoting all information sequences.
    k=4;
    for i=1:2^k
        for j=k:-1:1
            if rem(i-1,2^(-j+k+1))>=2^(-j+k)
                u(i,j)=1;
            else
                u(i,j)=0;
            end
            echo off ;
        end
    end
    echo on ;
    % Define G, the generator matrix.
    g=[1 0 0 1 1 1 0 1 1 1;
        1 1 1 0 0 0 1 1 1 0;
        0 1 1 0 1 1 0 1 0 1;
        1 1 0 1 1 1 1 0 0 1];
    % Generate codewords.
    c=rem(u*g,2);
    % Find the minimum distance.
    w_min=min(sum((c(2:2^k,:))'));


    >> w_min

    
    

    w_min =

    
    

    2

    
    

    >> c

    
    

    c =

    
    

    0 0 0 0 0 0 0 0 0 0
    1 1 0 1 1 1 1 0 0 1
    0 1 1 0 1 1 0 1 0 1
    1 0 1 1 0 0 1 1 0 0
    1 1 1 0 0 0 1 1 1 0
    0 0 1 1 1 1 0 1 1 1
    1 0 0 0 1 1 1 0 1 1
    0 1 0 1 0 0 0 0 1 0
    1 0 0 1 1 1 0 1 1 1
    0 1 0 0 0 0 1 1 1 0
    1 1 1 1 0 0 0 0 1 0
    0 0 1 0 1 1 1 0 1 1
    0 1 1 1 1 1 1 0 0 1
    1 0 1 0 0 0 0 0 0 0
    0 0 0 1 0 0 1 1 0 0
    1 1 0 0 1 1 0 1 0 1

    
    

    >> u

    
    

    u =

    
    

    0 0 0 0
    0 0 0 1
    0 0 1 0
    0 0 1 1
    0 1 0 0
    0 1 0 1
    0 1 1 0
    0 1 1 1
    1 0 0 0
    1 0 0 1
    1 0 1 0
    1 0 1 1
    1 1 0 0
    1 1 0 1
    1 1 1 0
    1 1 1 1

    
    

    >> g

    
    

    g =

    
    

    1 0 0 1 1 1 0 1 1 1
    1 1 1 0 0 0 1 1 1 0
    0 1 1 0 1 1 0 1 0 1
    1 1 0 1 1 1 1 0 0 1

    In a systematic code, the first k binary symbols in a codeword are the information bits, and the
    remaining n - k binary symbols are the parity-check symbols.

    Reference,

      1. <<Contemporary Communication System using MATLAB>> - John G. Proakis

  • 相关阅读:
    如何理解C语言的左结合 和右结合性
    Egg项目使用vscode的debug模式跑单元测试
    为什么要用MongoDB副本集
    理解JS原型和原型链
    防止重复请求攻击
    引擎、编译器和作用域
    闭包原理解析及其应用场景
    树形结构数据完美解决方案
    Excel文件导入导出(基于Nodejs、exceljs)
    架构层面高并发解决方案选择----项目架构模式选择
  • 原文地址:https://www.cnblogs.com/zzyzz/p/13759217.html
Copyright © 2011-2022 走看看