mirror of
				https://github.com/saitohirga/WSJT-X.git
				synced 2025-10-31 04:50:34 -04:00 
			
		
		
		
	Merge improvements to the FT algorithm into Bill's new structure for
the Fortran routines. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6328 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
		
							parent
							
								
									9e2fd2e11a
								
							
						
					
					
						commit
						5bfa43f46f
					
				| @ -215,16 +215,22 @@ contains | ||||
|     integer, intent(in) :: hard_min | ||||
|     integer, intent(in) :: aggression | ||||
| 
 | ||||
|     integer param(0:8) | ||||
|     real rtt | ||||
|     common/test000/param                              !### TEST ONLY ### | ||||
|     rtt=0.001*param(4) | ||||
| 
 | ||||
|     !$omp critical(decode_results) | ||||
|     write(*,1010) utc,snr,dt,freq,decoded | ||||
| 1010 format(i4.4,i4,f5.1,i5,1x,'#',1x,a22) | ||||
|     write(13,1012) utc,nint(sync),snr,dt,float(freq),drift,decoded,ft | ||||
| 1012 format(i4.4,i4,i5,f6.1,f8.0,i4,3x,a22,' JT65',i4) | ||||
|     call flush(6) | ||||
|     !          write(79,3001) utc,nint(sync),snr,dt,freq,candidates,    & | ||||
|     write(79,3001) utc,sync,snr,dt,freq,candidates,    & | ||||
|          hard_min,total_min,tries,aggression,ft,qual,decoded | ||||
| 3001 format(i4.4,f6.2,i4,f6.2,i5,i7,i3,i4,i8,i3,i2,i5,1x,a22) | ||||
| !    write(79,3001) utc,sync,snr,dt,freq,candidates,    & | ||||
| !         hard_min,total_min,rtt,tries,ft,min(qual,99),decoded | ||||
| !3001 format(i4.4,f5.1,i4,f5.1,i5,i6,i3,i4,f6.3,i8,i2,i3,1x,a22) | ||||
| !    flush(79) | ||||
| 
 | ||||
|     !$omp end critical(decode_results) | ||||
|     select type(this) | ||||
|     type is (counting_jt65_decoder) | ||||
|  | ||||
| @ -81,11 +81,17 @@ subroutine extract(s3,nadd,ntrials,naggressive,ndepth,mycall_12,    & | ||||
|   nhard=param(1) | ||||
|   nsoft=param(2) | ||||
|   nerased=param(3) | ||||
|   nsofter=param(4) | ||||
|   rtt=0.001*param(4) | ||||
|   ntotal=param(5) | ||||
|   qual=0.001*param(7) | ||||
|   qmin=11-naggressive | ||||
|   if(qual.ge.qmin) nft=1 | ||||
|   nd0=81 | ||||
|   r0=0.87 | ||||
|   if(naggressive.eq.10) then | ||||
|      nd0=83 | ||||
|      r0=0.90 | ||||
|   endif | ||||
|   if(ntotal.le.nd0 .and. rtt.le.r0) nft=1 | ||||
| !  nft=1                                         !### TEST ONLY ### | ||||
| 
 | ||||
|   if(nft.eq.0 .and. ndepth.ge.5) then | ||||
|      call timer('exp_deco',0) | ||||
| @ -97,7 +103,7 @@ subroutine extract(s3,nadd,ntrials,naggressive,ndepth,mycall_12,    & | ||||
|         nft=2 | ||||
|      else | ||||
|         decoded='                      ' | ||||
|         param=0 | ||||
| !###        param=0 | ||||
|         ntry=0 | ||||
|      endif | ||||
|      call timer('exp_deco',1) | ||||
| @ -143,16 +149,14 @@ subroutine getpp(workdat,p) | ||||
|   call graycode(a,63,1,a) | ||||
| 
 | ||||
|   psum=0. | ||||
|   ref=0. | ||||
|   do j=1,63 | ||||
|      i=a(j)+1 | ||||
|      x=s3a(i,j) | ||||
|      s3a(i,j)=0. | ||||
|      psum=psum + x | ||||
|      ref=ref + maxval(s3a(1:64,j)) | ||||
|      s3a(i,j)=x | ||||
|   enddo | ||||
|   p=psum/ref | ||||
|   p=psum/63.0 | ||||
| 
 | ||||
|   return | ||||
| end subroutine getpp | ||||
|  | ||||
| @ -38,8 +38,7 @@ void ftrsd2_(int mrsym[], int mrprob[], int mr2sym[], int mr2prob[], | ||||
|   int nhard=0,nhard_min=32768,nsoft=0,nsoft_min=32768; | ||||
|   int nsofter=0,nsofter_min=32768,ntotal=0,ntotal_min=32768,ncandidates; | ||||
|   int nera_best=0; | ||||
|   float pp,pp1,pp2,bias; | ||||
|   float qual=0.0; | ||||
|   float pp,pp1,pp2; | ||||
|   static unsigned int nseed; | ||||
| 
 | ||||
| // Power-percentage symbol metrics - composite gnnf/hf 
 | ||||
| @ -121,8 +120,10 @@ Hard-decision decoding failed.  Try the FT soft-decision method. | ||||
| Generate random erasure-locator vectors and see if any of them | ||||
| decode. This will generate a list of "candidate" codewords.  The | ||||
| soft distance between each candidate codeword and the received  | ||||
| word (or a quality estimator "qual") is used to decide which  | ||||
| candidate codeword is "best". | ||||
| word is estimated by finding the largest (pp1) and second-largest  | ||||
| (pp2) outputs from a synchronized filter-bank operating on the  | ||||
| symbol spectra, and using these to decide which candidate  | ||||
| codeword is "best". | ||||
| */ | ||||
| 
 | ||||
|   nseed=1;                                 //Seed for random numbers
 | ||||
| @ -173,8 +174,8 @@ NB: j is the symbol-vector index of the symbol with rank i. | ||||
|     nerr=decode_rs_int(rs,workdat,era_pos,numera,0);         | ||||
|     if( nerr >= 0 ) { | ||||
|       // We have a candidate coderowd.  Find its hard and soft distance from
 | ||||
|       // the received word.  Also find its quality estimate "qual" from the 
 | ||||
|       // full s3(64,63) array of synchronized symbol spectra.
 | ||||
|       // the received word.  Also find pp1 and pp2 from the full array 
 | ||||
|       // s3(64,63) of synchronized symbol spectra.
 | ||||
|       ncandidates=ncandidates+1; | ||||
|       nhard=0; | ||||
|       nsoft=0; | ||||
| @ -205,17 +206,12 @@ NB: j is the symbol-vector index of the symbol with rank i. | ||||
|         memcpy(correct,workdat,63*sizeof(int)); | ||||
|         nera_best=numera; | ||||
|         ntry[0]=k; | ||||
| 	bias=1.12*pp2; | ||||
| 	if(bias<0.570) bias=0.570; | ||||
| 	//	if(bias<0.335) bias=0.335;
 | ||||
|         //  if(mode65.eq.2) bias=max(1.08*p2,0.405)
 | ||||
|         //  if(mode65.ge.4) bias=max(1.04*p2,0.505)
 | ||||
| 	qual=100.0*(pp1-bias); | ||||
|       } else { | ||||
| 	if(pp>pp2 && pp!=pp1) pp2=pp; | ||||
|       } | ||||
| 
 | ||||
|       if(qual>10.0 && ncandidates>=100) break; | ||||
|       //      if(pp2==0.0 && pp1>5.0) break;
 | ||||
|       //      if(pp2>0.0 && pp1>4.4 && pp1>pp2+0.6) break;
 | ||||
|       if(ntotal_min <= 81 && pp2/pp1 <= 0.87) break; | ||||
|     } | ||||
|     if(k == ntrials) ntry[0]=k; | ||||
|   } | ||||
| @ -230,10 +226,11 @@ NB: j is the symbol-vector index of the symbol with rank i. | ||||
|   param[1]=nhard_min; | ||||
|   param[2]=nsoft_min; | ||||
|   param[3]=nera_best; | ||||
|   param[4]=nsofter_min; | ||||
|   param[4]=1000.0*pp2/pp1; | ||||
|   param[5]=ntotal_min; | ||||
|   param[6]=ntry[0]; | ||||
|   param[7]=1000.0*qual; | ||||
|   param[7]=1000.0*pp2; | ||||
|   param[8]=1000.0*pp1; | ||||
|   if(param[0]==0) param[2]=-1; | ||||
|   return; | ||||
| } | ||||
|  | ||||
| @ -77,8 +77,8 @@ contains | ||||
|     logical :: first_time, robust | ||||
|     common/decstats/ntry65a,ntry65b,n65a,n65b,num9,numfano | ||||
|     common/steve/thresh0 | ||||
|     common/test000/ncandidates,nhard_min,nsoft_min,nera_best,nsofter_min,   & | ||||
|          ntotal_min,ntry,nq1000,ntot         !### TEST ONLY ### | ||||
|     common/test000/ncandidates,nhard_min,nsoft_min,nera_best,nrtt1000,   & | ||||
|          ntotal_min,ntry,nq1000,npp1         !### TEST ONLY ### | ||||
|     save | ||||
| 
 | ||||
|     this%callback => callback | ||||
|  | ||||
| @ -34,7 +34,7 @@ contains | ||||
|   end subroutine test | ||||
| 
 | ||||
|   subroutine my_callback (this, utc, sync, snr, dt, freq, drift, decoded   & | ||||
|        , ft, qual, candidates, tries, total_min, hard_min, aggression) | ||||
|        , ft, qual, candidates, tries, total_min, hard_min, aggression, rtt) | ||||
|     use jt65_decode | ||||
|     implicit none | ||||
| 
 | ||||
| @ -53,16 +53,17 @@ contains | ||||
|     integer, intent(in) :: total_min | ||||
|     integer, intent(in) :: hard_min | ||||
|     integer, intent(in) :: aggression | ||||
|     real, intent(in) :: rtt | ||||
| 
 | ||||
|     write(*,1010) utc,snr,dt,freq,decoded | ||||
| 1010 format(i4.4,i4,f5.1,i5,1x,'#',1x,a22) | ||||
|     write(13,1012) utc,nint(sync),snr,dt,float(freq),drift,decoded,ft | ||||
| 1012 format(i4.4,i4,i5,f6.1,f8.0,i4,3x,a22,' JT65',i4) | ||||
|     call flush(6) | ||||
|     !          write(79,3001) utc,nint(sync),snr,dt,freq,candidates,    & | ||||
|     write(79,3001) utc,sync,snr,dt,freq,candidates,    & | ||||
|          hard_min,total_min,tries,aggression,ft,qual,decoded | ||||
| 3001 format(i4.4,f6.2,i4,f6.2,i5,i7,i3,i4,i8,i3,i2,i5,1x,a22) | ||||
| !    write(79,3001) utc,sync,snr,dt,freq,candidates,    & | ||||
| !         hard_min,total_min,rtt,tries,ft,qual,decoded | ||||
| !3001 format(i4.4,f5.1,i4,f5.1,i5,i6,i3,i4,f6.3,i8,i2,i3,1x,a22) | ||||
| 
 | ||||
|   end subroutine my_callback | ||||
| 
 | ||||
| end module jt65_test | ||||
|  | ||||
| @ -254,11 +254,15 @@ program jt9 | ||||
|      shared_data%params%nzhsym=181 | ||||
|      shared_data%params%ndepth=ndepth | ||||
|      shared_data%params%dttol=3. | ||||
| 
 | ||||
|      shared_data%params%minsync=-1      !### TEST ONLY | ||||
|      !mycall="K1ABC       "  !### TEST ONLY | ||||
|      shared_data%params%nfqso=1500      !### TEST ONLY | ||||
|      mycall="K1ABC       "              !### TEST ONLY | ||||
| 
 | ||||
|      shared_data%params%naggressive=10 | ||||
|      shared_data%params%n2pass=1 | ||||
|      shared_data%params%nranera=8  ! ntrials=10000 | ||||
|      shared_data%params%nranera=8                      !### ntrials=10000 | ||||
|      if(ndepth.eq.4) shared_data%params%nranera=10     !### ntrials=100,000 | ||||
|      shared_data%params%nrobust=.false. | ||||
|      shared_data%params%nexp_decode=nexp_decode | ||||
|      shared_data%params%mycall=mycall | ||||
|  | ||||
| @ -22,8 +22,9 @@ program stats | ||||
|      i1=index(infile,".")+1 | ||||
|      i2=40 | ||||
|      if(index(infile,"_").gt.1) i2=index(infile,"_") - 1 | ||||
|      read(infile(i1:i2),*) snrgen | ||||
|      snrgen=-snrgen | ||||
|      snrgen=0. | ||||
|      read(infile(i1:i2),*,err=1) snrgen | ||||
| 1     snrgen=-snrgen | ||||
|      nsynced=0 | ||||
|      nbm=0 | ||||
|      nftok=0 | ||||
| @ -34,8 +35,9 @@ program stats | ||||
| 
 | ||||
|      do iline=1,999999 | ||||
|         read(10,1010,end=100) nutc,sync,nsnr,dt,nfreq,ncandidates,nhard,  & | ||||
|              ntotal,ntry,naggressive,nft,nqual,decoded | ||||
| 1010    format(i4.4,f6.2,i4,f6.2,i5,i7,i3,i4,i8,i3,i2,i5,1x,a22) | ||||
|              ntotal,rtt,ntry,nft,nqual,decoded | ||||
| 1010    format(i4.4,f5.1,i4,f5.1,i5,i6,i3,i4,f6.3,i8,i2,i3,1x,a22) | ||||
| 
 | ||||
| !        ndfreq=9999 | ||||
| !        do ifreq=600,2400,200 | ||||
| !           n=abs(nfreq-ifreq) | ||||
| @ -49,13 +51,16 @@ program stats | ||||
|            nbadsync=nbadsync+1 | ||||
|         endif | ||||
|         if(decoded.eq.'                      ') cycle | ||||
|         if(decoded(1:11).eq.'K1ABC W9XYZ') then | ||||
|            ngood=ngood+1 | ||||
|            if(ncandidates.eq.0) nbm=nbm+1 | ||||
|            if(nft.eq.1) nftok=nftok+1 | ||||
|            if(nft.ge.1) nhint=nhint+1 | ||||
|         else | ||||
|            nbad=nbad+1 | ||||
| !        if(ntotal.le.83 .and. rtt.le.0.90) then           !nag=10 | ||||
|         if(ntotal.le.81 .and. rtt.le.0.87) then           !nag=0 | ||||
|            if(decoded(1:11).eq.'K1ABC W9XYZ') then | ||||
|               ngood=ngood+1 | ||||
|               if(ncandidates.eq.0) nbm=nbm+1 | ||||
|               if(nft.eq.1) nftok=nftok+1 | ||||
|               if(nft.ge.1) nhint=nhint+1 | ||||
|            else | ||||
|               nbad=nbad+1 | ||||
|            endif | ||||
|         endif | ||||
|      enddo | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user