Code covered by the BSD License  

Highlights from
Contemporary Communications Systems Matlab Files

image thumbnail

Contemporary Communications Systems Matlab Files

by

 

Matlab Files in this book

ip_08_08.m
% MATLAB script for Illustrative Problem 8.8. 
% Generate U, denoting all information sequences.
clear
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,:))'));

Contact us