Fixed array alignment in decoder
This commit is contained in:
		
							parent
							
								
									f332177034
								
							
						
					
					
						commit
						cfeed7fc87
					
				| @ -31,6 +31,7 @@ subroutine multimode_decoder(ss,id2,params,nfsample) | |||||||
|   logical baddata,newdat65,newdat9,single_decode,bVHF,bad0,newdat,trydecode |   logical baddata,newdat65,newdat9,single_decode,bVHF,bad0,newdat,trydecode | ||||||
|   integer*2 id0(NTMAX*12000) |   integer*2 id0(NTMAX*12000) | ||||||
|   integer*2 id2(NTMAX*12000) |   integer*2 id2(NTMAX*12000) | ||||||
|  |   integer pos,sz | ||||||
|   type(params_block) :: params |   type(params_block) :: params | ||||||
|   character(len=20) :: datetime |   character(len=20) :: datetime | ||||||
|   character(len=12) :: mycall, hiscall |   character(len=12) :: mycall, hiscall | ||||||
|  | |||||||
| @ -1,13 +1,10 @@ | |||||||
| subroutine syncjs8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase) | subroutine syncjs8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase) | ||||||
| 
 |  | ||||||
|   !include 'js8_params.f90' |  | ||||||
|    |  | ||||||
|   complex cx(0:NH1) |   complex cx(0:NH1) | ||||||
|   real s(NH1,NHSYM) |   real s(NH1,NHSYM) | ||||||
|   real savg(NH1) |   real savg(NH1) | ||||||
|   real sbase(NH1) |   real sbase(NH1) | ||||||
|   real x(NFFT1) |   real x(NFFT1) | ||||||
|   real sync2d(NH1,-JZ:JZ) |   real sync1d(-JZ:JZ) | ||||||
|   real red(NH1) |   real red(NH1) | ||||||
|   real candidate0(3,200) |   real candidate0(3,200) | ||||||
|   real candidate(3,200) |   real candidate(3,200) | ||||||
| @ -29,7 +26,7 @@ subroutine syncjs8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase) | |||||||
|     icos7c = (/2,5,0,6,4,1,3/)                  !End Costas 7x7 tone pattern |     icos7c = (/2,5,0,6,4,1,3/)                  !End Costas 7x7 tone pattern | ||||||
|   endif |   endif | ||||||
| 
 | 
 | ||||||
| ! Compute symbol spectra, stepping by NSTEP steps.   |   ! Compute symbol spectra, stepping by NSTEP steps. | ||||||
|   savg=0. |   savg=0. | ||||||
|   tstep=NSTEP/12000.0                          |   tstep=NSTEP/12000.0                          | ||||||
|   df=12000.0/NFFT1                   |   df=12000.0/NFFT1                   | ||||||
| @ -45,6 +42,7 @@ subroutine syncjs8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase) | |||||||
|      enddo |      enddo | ||||||
|      savg=savg + s(1:NH1,j)                   !Average spectrum |      savg=savg + s(1:NH1,j)                   !Average spectrum | ||||||
|   enddo |   enddo | ||||||
|  | 
 | ||||||
|   call baselinejs8(savg,nfa,nfb,sbase) |   call baselinejs8(savg,nfa,nfb,sbase) | ||||||
| 
 | 
 | ||||||
|   ia=max(1,nint(nfa/df)) ! min freq |   ia=max(1,nint(nfa/df)) ! min freq | ||||||
| @ -106,17 +104,13 @@ subroutine syncjs8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase) | |||||||
|         t0=(t0-t)/6.0 |         t0=(t0-t)/6.0 | ||||||
|         sync_bc=t/t0 |         sync_bc=t/t0 | ||||||
| 
 | 
 | ||||||
|         !sync2d(i,j)=max(max(max(sync_abc, sync_ab), sync_ac), sync_bc) |         sync1d(j)=max(sync_abc, sync_ab, sync_bc) | ||||||
|         sync2d(i,j)=max(sync_abc, sync_ab, sync_bc) |  | ||||||
|      enddo |      enddo | ||||||
|   enddo |  | ||||||
| 
 | 
 | ||||||
|   red=0. |      ii=maxloc(sync1d(-JZ:JZ)) - 1 - JZ | ||||||
|   do i=ia,ib |  | ||||||
|      ii=maxloc(sync2d(i,-JZ:JZ)) - 1 - JZ |  | ||||||
|      j0=ii(1) |      j0=ii(1) | ||||||
|      jpeak(i)=j0 |      jpeak(i)=j0 | ||||||
|      red(i)=sync2d(i,j0) |      red(i)=sync1d(j0) | ||||||
|   enddo |   enddo | ||||||
| 
 | 
 | ||||||
|   iz=ib-ia+1 |   iz=ib-ia+1 | ||||||
| @ -145,8 +139,7 @@ subroutine syncjs8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase) | |||||||
|   enddo |   enddo | ||||||
|   ncand=k |   ncand=k | ||||||
| 
 | 
 | ||||||
| 
 |   ! Save only the best of near-dupe freqs. | ||||||
| ! Save only the best of near-dupe freqs.   |  | ||||||
|   do i=1,ncand |   do i=1,ncand | ||||||
|      if(i.ge.2) then |      if(i.ge.2) then | ||||||
|         do j=1,i-1 |         do j=1,i-1 | ||||||
| @ -159,7 +152,7 @@ subroutine syncjs8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase) | |||||||
|      endif |      endif | ||||||
|   enddo |   enddo | ||||||
| 
 | 
 | ||||||
| ! Put nfqso at top of list |   ! Put nfqso at top of list | ||||||
|   do i=1,ncand |   do i=1,ncand | ||||||
|      if(abs(candidate0(1,i)-nfqso).lt.10.0) candidate0(1,i)=-candidate0(1,i) |      if(abs(candidate0(1,i)-nfqso).lt.10.0) candidate0(1,i)=-candidate0(1,i) | ||||||
|   enddo |   enddo | ||||||
| @ -167,15 +160,13 @@ subroutine syncjs8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase) | |||||||
|   fac=20.0/maxval(s) |   fac=20.0/maxval(s) | ||||||
|   s=fac*s |   s=fac*s | ||||||
| 
 | 
 | ||||||
| ! Sort by sync |   ! Sort by sync | ||||||
| !  call indexx(candidate0(3,1:ncand),ncand,indx) |   ! call indexx(candidate0(3,1:ncand),ncand,indx) | ||||||
| ! Sort by frequency  |   ! Sort by frequency | ||||||
|   call indexx(candidate0(1,1:ncand),ncand,indx) |   call indexx(candidate0(1,1:ncand),ncand,indx) | ||||||
|   k=1 |   k=1 | ||||||
| !  do i=ncand,1,-1 |  | ||||||
|   do i=1,ncand |   do i=1,ncand | ||||||
|      j=indx(i) |      j=indx(i) | ||||||
| !     if( candidate0(3,j) .ge. syncmin .and. candidate0(2,j).ge.-1.5 ) then |  | ||||||
|      if( candidate0(3,j) .ge. syncmin ) then |      if( candidate0(3,j) .ge. syncmin ) then | ||||||
|        candidate(1,k)=abs(candidate0(1,j)) |        candidate(1,k)=abs(candidate0(1,j)) | ||||||
|        candidate(2,k)=candidate0(2,j) |        candidate(2,k)=candidate0(2,j) | ||||||
| @ -184,5 +175,6 @@ subroutine syncjs8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase) | |||||||
|      endif |      endif | ||||||
|   enddo |   enddo | ||||||
|   ncand=k-1 |   ncand=k-1 | ||||||
|  | 
 | ||||||
|   return |   return | ||||||
| end subroutine syncjs8 | end subroutine syncjs8 | ||||||
|  | |||||||
| @ -43,11 +43,13 @@ contains | |||||||
|     character*6 mygrid6,hisgrid6 |     character*6 mygrid6,hisgrid6 | ||||||
|     integer*2 iwave(NMAX) |     integer*2 iwave(NMAX) | ||||||
|     integer apsym(KK) |     integer apsym(KK) | ||||||
|  |     integer ncand | ||||||
|     character datetime*13,message*22,msg37*37 |     character datetime*13,message*22,msg37*37 | ||||||
|     character*22 allmessages(100) |     character*22 allmessages(100) | ||||||
|     integer allsnrs(100) |     integer allsnrs(100) | ||||||
|     save s,dd |     save s,dd | ||||||
| 
 | 
 | ||||||
|  |     ncand=0 | ||||||
|     bcontest=iand(nexp_decode,128).ne.0 |     bcontest=iand(nexp_decode,128).ne.0 | ||||||
|     this%callback => callback |     this%callback => callback | ||||||
|     write(datetime,1001) nutc        !### TEMPORARY ### |     write(datetime,1001) nutc        !### TEMPORARY ### | ||||||
| @ -115,6 +117,7 @@ contains | |||||||
|              lapcqonly,napwid,lsubtract,nagain,iaptype,mycall12,mygrid6,   & |              lapcqonly,napwid,lsubtract,nagain,iaptype,mycall12,mygrid6,   & | ||||||
|              hiscall12,bcontest,sync,f1,xdt,xbase,apsym,nharderrors,dmin,  & |              hiscall12,bcontest,sync,f1,xdt,xbase,apsym,nharderrors,dmin,  & | ||||||
|              nbadcrc,iappass,iera,msg37,xsnr) |              nbadcrc,iappass,iera,msg37,xsnr) | ||||||
|  | 
 | ||||||
|         message=msg37(1:22)   !### |         message=msg37(1:22)   !### | ||||||
|         nsnr=nint(xsnr)  |         nsnr=nint(xsnr)  | ||||||
|         xdt=xdt-ASTART |         xdt=xdt-ASTART | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Jordan Sherer
						Jordan Sherer