Fix up ldpcsim144 for comparisons with ldpcsim128_90.

This commit is contained in:
Steve Franke 2018-06-14 09:59:49 -05:00
parent 5da3986f0a
commit 1aeaa1715b
2 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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