From 1aeaa1715bc5d760f58e84d6076683f30e2892f9 Mon Sep 17 00:00:00 2001 From: Steve Franke Date: Thu, 14 Jun 2018 09:59:49 -0500 Subject: [PATCH] Fix up ldpcsim144 for comparisons with ldpcsim128_90. --- lib/ldpcsim128_90.f90 | 6 +++--- lib/ldpcsim144.f90 | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/ldpcsim128_90.f90 b/lib/ldpcsim128_90.f90 index ca2bc9b66..b00798123 100644 --- a/lib/ldpcsim128_90.f90 +++ b/lib/ldpcsim128_90.f90 @@ -130,15 +130,15 @@ do idb = 14,-6,-1 nerrdec(nerr)=nerrdec(nerr)+1 else ! this is an undetected error nue=nue+1 - nbadwt(nhw)=nbadwt(nhw)+1 ! store the weight of the error vector endif else nbadcrc=nbadcrc+1 + nbadwt(nhw)=nbadwt(nhw)+1 ! store the weight of the error vector endif endif enddo - snr2500=db-3.5 + snr2500=db-2.5 pberr=real(nerr)/real(ntrials*N) write(*,"(f4.1,4x,f5.1,1x,i8,1x,i8,1x,i8,8x,f5.2,8x,e10.3)") db,snr2500,ngood,nue,nbadcrc,ss,pberr @@ -149,7 +149,7 @@ do i=0,N write(23,'(i4,2x,i10,i10,f10.2)') i,nerrdec(i),nerrtot(i),real(nerrdec(i))/real(nerrtot(i)+1e-10) enddo close(23) -open(unit=25,file='undetected_error_hamming_weight.dat',status='unknown') +open(unit=25,file='badcrc_hamming_weight.dat',status='unknown') do i=0,N write(25,'(i4,2x,i10)') i,nbadwt(i) enddo diff --git a/lib/ldpcsim144.f90 b/lib/ldpcsim144.f90 index 66dbfbf0b..9dfdffc16 100644 --- a/lib/ldpcsim144.f90 +++ b/lib/ldpcsim144.f90 @@ -14,7 +14,7 @@ integer*1 i1hash(4) integer*1 msgbits(80) integer*4 i4Msg6BitWords(13) integer ihash -integer nerrtot(128),nerrdec(128) +integer nerrtot(0:128),nerrdec(0:128) real*8, allocatable :: lratio(:), rxdata(:), rxavgd(:) real, allocatable :: yy(:), llr(:) equivalence(ihash,i1hash) @@ -41,8 +41,8 @@ call getarg(4,arg) read(arg,*) s ! don't count hash bits as data bits +K=80 N=128 -K=72 rate=real(K)/real(N) write(*,*) "rate: ",rate @@ -90,7 +90,7 @@ msg="K9AN K1JT EN50" call init_random_seed() write(*,*) "Eb/N0 SNR2500 ngood nundetected nbadhash sigma" -do idb = -6, 14 +do idb = 14,-6,-1 db=idb/2.0-1.0 sigma=1/sqrt( 2*rate*(10**(db/10.0)) ) ngood=0 @@ -161,7 +161,7 @@ do idb = -6, 14 endif endif enddo - snr2500=db-3.5 + snr2500=db-3.0 write(*,"(f4.1,4x,f5.1,1x,i8,1x,i8,1x,i8,8x,f5.2)") db,snr2500,ngood,nue,nbadhash,ss enddo