SVN r8748

This commit is contained in:
Jordan Sherer
2018-06-14 21:27:34 -04:00
parent 419c039d08
commit 4f1fe4fc94
581 changed files with 69338 additions and 39836 deletions
@@ -0,0 +1,89 @@
clear all;
global N
global R
global A
#-------------------------------------------------------------------------------
function retval = f1(theta)
global N;
global R;
retval=0.0;
gterm = gammaln(N/2) - gammaln((N+1)/2) - log(2*sqrt(pi));
rhs = -N*R*log(2);
lhs=gterm + (N-1)*log(sin(theta)) + log(1-(tan(theta).^2)/N) - log(cos(theta));
retval = rhs-real(lhs);
endfunction
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
function retval = d(N,i,x)
t1=(x.^2)/2;
t2=gammaln(N/2);
t3=-gammaln(i/2+1);
t4=-gammaln(N-i);
t5=(N-1-i)*log(sqrt(2)*x);
t6=-log(2)/2;
t7arg=1+(-1)^i * gammainc((x.^2)/2.0,(i+1)/2);
t7=log(t7arg);
retval=t1+t2+t3+t4+t5+t6+t7;
endfunction
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
function retval = maxstar(x1,x2)
retval = max(x1,x2)+log(1+exp(-abs(x1-x2)));
endfunction
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
function retval = spb_integrand(x)
global N;
global A;
t1=log(N-1);
t2=-N*(A^2)/2;
t3=-0.5*log(2*pi);
t4=(N-2)*log(sin(x));
arg=sqrt(N)*A*cos(x);
t5=maxstar(d(N,0,arg),d(N,1,arg));
for i=2:N-1
t5=maxstar(t5,d(N,i,arg));
endfor
retval=exp(t1+t2+t3+t4+t5);
endfunction
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
function retval = qfunc(x)
retval = 0.5 * erfc(x/sqrt(2));
endfunction
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Calculate sphere packing lower bound on the probability of word error
# given block length (N), code rate (R), and Eb/No.
#
# Ref:
# "Log-Domain Calculation of the 1959 Sphere-Packing Bound with Application to
# M-ary PSK Block Coded Modulation," Igal Sason and Gil Weichman,
# doi: 10.1109/EEEI.2006.321097
#-------------------------------------------------------------------------------
N=174
K=75
R=K/N
delta=0.01;
[ths,fval,info,output]=fzero(@f1,[delta,pi/2-delta], optimset ("jacobian", "off"));
for ebnodb=-6:0.5:4
ebno=10^(ebnodb/10.0);
esno=ebno*R;
A=sqrt(2*esno);
term1=quadcc(@spb_integrand,ths,pi/2);
term2=qfunc(sqrt(N)*A);
pe=term1+term2;
ps=1-pe;
printf("%f %f\n",ebnodb,ps);
endfor
@@ -1,67 +0,0 @@
<HTML><HEAD>
<TITLE> Github Facilities </TITLE>
</HEAD><BODY>
<H1> Github Facilities </H1>
<P>Starting with the Version of 2012-02-11, the source code repository
for this software is hosted by <A HREF="http://github.com">Github</A>,
and is located at <A
HREF="http://github.com/radfordneal/LDPC-codes">http://github.com/radfordneal/LDPC-codes</A>.
This repository includes the annotated log of changes made since the
Version of 2006-02-08.
<P>You can use the facilities at Github to obtain the source-code
repository, report bugs, and contribute to the wiki.
<H2>Obtaining the source repository, and modifying it</H2>
<P>To obtain a copy of the source-code repository, issue the following
command (in a Unix/Linux/Cygwin environment that has git installed):
<BLOCKQUOTE><PRE>
git clone git://github.com/radfordneal/LDPC-codes
</PRE></BLOCKQUOTE>
This will retrieve the current state of the software, storing it
in the directory <TT>LDPC-codes</TT>, which you should ensure does not
exist before issuing this command above.
<P>Note that if all you want to do is compile and use the current
version, you can instead download the source without development
history as described in the <A HREF="install.html">installation
instructions</A>.
<P>The <TT>LDPC-codes</TT> directory created by the <TT>git clone</TT>
command is a git repository, which can be manipulated with the various
forms of the <TT>git</TT> command, which are documented, for example,
<A HREF="http://git-scm.com/documentation">here</A>.
<P>Each stable version of the software is a separate branch of the
repository. The documentation on the most recent stable version is in
the "gh-pages" branch. The current development version is on the
"master" branch. The are other branches for each stable version that
was released.
<P>You can make local changes to your copy of the repository, and use
the modified software. If you wish, you can ask me
(radfordneal@gmail.com) to include your changes in a new release, or,
if you register as a <A HREF="http://github.com">Github</A> user, you can set
up your own fork of the software for you and other people to use.
<H2>Reporting Bugs</H2>
You can use the Github "Issues" facility to report bugs in the
software. You have to register as a <A HREF="github.com">Github</A>
user to do this (which is free). You can then go <A
HREF="https://github.com/radfordneal/LDPC-codes/issues">here</A> and
click on "New issue" to report a bug. You can also use this facility
to suggest new features or other revisions. I may not have time to
implement them, but perhaps someone else will.
<HR>
<A HREF="index.html">Back to index for LDPC software</A>
</BODY></HTML>