• 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++泛型指针的正向与逆向循环读取的改进方法
    C++泛型指针的正向与逆向循环读取时报错Expreeeion:vector iterator + offset out of range问题
    模块“Project”的符号未加载
    简单的验证码Winform程序
    Dapper.Database<TDatabase>QueryMultiple()报错
    IE6IE7 div样式做的下拉框被遮住问题
    统计数据库已分组的表数据行数
    linux远程下载文件 的两种方法之 ftp命令和scp命令
    Oracle多表连接查询区别
    小程序(三)
  • 原文地址:https://www.cnblogs.com/zzyzz/p/13759217.html
Copyright © 2020-2023  润新知