discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] Re: 8b/10b for GMSK


From: Achilleas Anastasopoulos
Subject: [Discuss-gnuradio] Re: 8b/10b for GMSK
Date: Mon, 05 Feb 2007 20:44:44 -0500
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Here are my 2c regarding this issue:

I think the line code should be a seperate block
not related to modulation etc.
In fact this is precisely a block or a convolutional code
with the only exception that is used not for error correction but to shape the data. Or you can think about it as an error-correcting
code against a channel that is hostile to runlengths.

If you are interested only in breaking runlengths then
the 8b/10b may not be the best choice (since it also does some
DC balancing etc; at least this is what I gathered from a quick
google search).

For instance it is easy to construct a block code
with length 10 (bits) and 2^9 codewords that has
runlengths of at most 5 bits.
This means that the throughput is only 9/10 of that
without line coding, which is better than the 8/10 of the 8b/10b code.

If you consider a code of length 14 (bits) you can do the same
(ie, have runlengths of at most 5 bits) with 2^13
codewords and a throughput of 13/14 > 9/10 > 8/10.

I am attaching a simple piece of code that shows you how
you can easily construct these codes (not optimized by any means).
The generated codes have no structure at all, so they should
be decoded using a lookup table. But I guess one can construct
also linear (or even cyclic) codes with these properties and make
the encoding/decoding simpler...



run
[C,r]=line_code(10,5)
or
[C,r]=line_code(14,5)
to get both the rate and the code.


Achilleas
function [C,practicalrate] = line_code(n,m)

%n=10; % how many bits are transmitetd in the channel
%m=5;  % maximum runlengths that are acceptable

C=[];
for i=0:2^n-1,
    c=dec2base(i,2,n)-'0';
    C=[C;c];
end


eliminated=1;
while eliminated

eliminated=0;
[si,le]=size(C);
Cn=[];
for i=1:si,
    c=C(i,:);
    if runlength(c)<=m & runlength_b(c)<=floor(m/2) & 
runlength_b(fliplr(c))<=ceil(m/2)
        %c
        %runlength(c)
        Cn=[Cn;c];
    else
        eliminated=1;
    end
end
C=Cn;

end

%C
%size(C)
%rate=log2(length(C))/n
practicalrate=floor(log2(length(C)))/n;




% eliminated=1;
% while eliminated
% 
% eliminated=0;
% [si,le]=size(C);
% Cn=[];
% for i=1:si,
%     
%     cf=C(i,:);
%     violation=0;
%     for j=1:si,
%         cl=C(j,:);
%         c=[cf cl];
%         if runlength(c)>=m
%             violation=1;
%         end
%     end
%     if violation==0
%         Cn=[Cn cf];
%     else
%         eliminated=1;
%     end
% end
% C=Cn;
% 
% end
% 
% 
% 
% 
% C
% size(C)



function maxr = runlength(c)

n=length(c);
maxr=1;
r=1;
rc=c(1);
for i=2:n,
    if c(i)==rc
        r=r+1;    
    else
        maxr=max([maxr,r]);
        r=1;
        rc=c(i);
    end
end
maxr=max([maxr,r]);



function r = runlength_b(c)

n=length(c);
r=1;
rc=c(1);
for i=2:n,
    if c(i)==rc
        r=r+1;    
    else
        return;
    end
end

reply via email to

[Prev in Thread] Current Thread [Next in Thread]