2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								program ldpcsim
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								use, intrinsic :: iso_c_binding
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								use hashing
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								use packjt
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 15:08:57 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								character*22 msg,msgsent,msgreceived
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								character*8 arg
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								integer*1, allocatable ::  codeword(:), decoded(:), message(:)
							 | 
						
					
						
							
								
									
										
										
										
											2017-02-26 20:14:51 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								real*8, allocatable ::  rxdata(:), rxavgd(:)
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-01 15:16:11 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								real, allocatable :: llr(:)
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-04 00:46:57 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								integer ihash
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-28 01:02:03 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								integer*1 hardbits(32)
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								nargs=iargc()
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-01 21:50:52 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								if(nargs.ne.4) then
							 | 
						
					
						
							
								
									
										
										
										
											2017-02-26 20:14:51 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								   print*,'Usage: ldpcsim  niter navg   #trials  s '
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-01 21:50:52 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								   print*,'eg:    ldpcsim   10     1     1000    0.75'
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								   return
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								endif
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-01 21:50:52 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								call getarg(1,arg)
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								read(arg,*) max_iterations 
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-01 21:50:52 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								call getarg(2,arg)
							 | 
						
					
						
							
								
									
										
										
										
											2017-02-26 20:14:51 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								read(arg,*) navg 
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-01 21:50:52 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								call getarg(3,arg)
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								read(arg,*) ntrials 
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-01 21:50:52 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								call getarg(4,arg)
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								read(arg,*) s
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-02-26 20:14:51 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								K=16
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								N=32
							 | 
						
					
						
							
								
									
										
										
										
											2016-10-23 17:37:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								!rate=real(K)/real(N)
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								! don't count hash bits as data bits
							 | 
						
					
						
							
								
									
										
										
										
											2016-10-23 17:37:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								rate=4.0/real(N)
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-28 01:02:03 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								write(*,*) "rate: ",rate
							 | 
						
					
						
							
								
									
										
										
										
											2017-02-26 20:14:51 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								write(*,*) "niter= ",max_iterations,"navg= ",navg," s= ",s
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								allocate ( codeword(N), decoded(K), message(K) )
							 | 
						
					
						
							
								
									
										
										
										
											2017-02-26 20:14:51 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								allocate ( rxdata(N), rxavgd(N), llr(N) )
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-10-23 17:37:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								msg="K1JT K9AN"
							 | 
						
					
						
							
								
									
										
										
										
											2017-02-26 20:14:51 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								call fmtmsg(msg,iz)
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-04 00:46:57 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								call hash(msg,22,ihash)
							 | 
						
					
						
							
								
									
										
										
										
											2017-02-26 20:14:51 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								irpt=14
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-28 01:02:03 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								ihash=iand(ihash,4095)                 !12-bit hash
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								ig=16*ihash + irpt                     !4-bit report
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-04 00:46:57 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								write(*,*) irpt,ihash,ig
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								do i=1,16
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  message(i)=iand(1,ishft(ig,1-i))
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								enddo
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-28 01:02:03 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								write(*,'(16i1)') message
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								call encode_msk40(message,codeword)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								write(*,'(32i1)') codeword
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-04 00:46:57 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								call init_random_seed()
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-01 15:16:11 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								write(*,*) "Eb/N0  SNR2500   ngood  nundetected nbadhash"
							 | 
						
					
						
							
								
									
										
										
										
											2016-10-23 17:37:44 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								do idb = 0, 30
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  db=idb/2.0
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  sigma=1/sqrt( 2*rate*(10**(db/10.0)) )
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  ngood=0
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  nue=0
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  nbadhash=0
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-28 01:02:03 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  itsum=0
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  do itrial=1, ntrials
							 | 
						
					
						
							
								
									
										
										
										
											2017-02-26 20:14:51 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    rxavgd=0d0
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    do iav=1,navg
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      call sgran()
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 15:08:57 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								! Create a realization of a noisy received word
							 | 
						
					
						
							
								
									
										
										
										
											2017-02-26 20:14:51 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      do i=1,N
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        rxdata(i) = 2.0*codeword(i)-1.0 + sigma*gran()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      enddo
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      rxavgd=rxavgd+rxdata
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    enddo
							 | 
						
					
						
							
								
									
										
										
										
											2017-02-26 20:14:51 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    rxdata=rxavgd
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 15:08:57 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								! Correct signal normalization is important for this decoder.
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    rxav=sum(rxdata)/N
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    rx2av=sum(rxdata*rxdata)/N
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    rxsig=sqrt(rx2av-rxav*rxav)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    rxdata=rxdata/rxsig
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-04 00:46:57 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    if( s .le. 0 ) then
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      ss=sigma
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    else 
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      ss=s
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    endif
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-28 01:02:03 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    llr=2.0*rxdata/(ss*ss)
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-28 01:02:03 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    call bpdecode40(llr, max_iterations, decoded, niterations)
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 15:08:57 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								! If the decoder finds a valid codeword, niterations will be .ge. 0.
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    if( niterations .ge. 0 ) then
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      nueflag=0
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      nhashflag=0
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-04 00:46:57 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      imsg=0
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      do i=1,16
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        imsg=ishft(imsg,1)+iand(1,decoded(17-i))
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      enddo
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-28 01:02:03 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      nrxrpt=iand(imsg,15)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      nrxhash=(imsg-nrxrpt)/16
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-04 00:46:57 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      if( nrxhash .ne. ihash ) then
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        nbadhash=nbadhash+1
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        nhashflag=1   
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      endif
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 15:08:57 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								! Check the message plus hash against what was sent.
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      do i=1,K
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        if( message(i) .ne. decoded(i) ) then
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								          nueflag=1
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        endif
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      enddo
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      if( nhashflag .eq. 0 .and. nueflag .eq. 0 ) then
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        ngood=ngood+1
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-28 01:02:03 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        itsum=itsum+niterations
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      else if( nhashflag .eq. 0 .and. nueflag .eq. 1 ) then
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        nue=nue+1;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      endif
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-28 01:02:03 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    else
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      hardbits=0
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      where(llr .gt. 0) hardbits=1
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								!      write(*,'(32i1)') hardbits 
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								!      write(*,'(32i1)') codeword 
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      isum=0
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      do i=1,32
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        if( hardbits(i) .ne. codeword(i) ) isum=isum+1
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      enddo
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								!      write(*,*) 'number of errors ',isum
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    endif
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  enddo
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-28 01:02:03 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  avits=real(itsum)/real(ngood+0.1)
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-01 15:16:11 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  snr2500=db-10.0
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  write(*,"(f4.1,4x,f5.1,1x,i8,1x,i8,1x,i8,1x,f8.2,1x,f8.1)") db,snr2500,ngood,nue,nbadhash,ss,avits
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-24 01:12:38 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								enddo
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								end program ldpcsim
							 |