| 
									
										
										
										
											2016-10-16 17:36:00 +00:00
										 |  |  | subroutine fast_decode(id2,narg,ntrperiod,bShMsgs,line,mycall_12,   &
 | 
					
						
							|  |  |  |      hiscall_12)
 | 
					
						
							| 
									
										
										
										
											2015-11-18 01:28:12 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |   parameter (NMAX=30*12000)
 | 
					
						
							|  |  |  |   integer*2 id2(NMAX)
 | 
					
						
							| 
									
										
										
										
											2016-07-29 16:10:55 +00:00
										 |  |  |   integer*2 id2a(NMAX)
 | 
					
						
							|  |  |  |   integer*2 id2b(NMAX)
 | 
					
						
							| 
									
										
										
										
											2016-02-03 20:23:52 +00:00
										 |  |  |   integer narg(0:14)
 | 
					
						
							| 
									
										
										
										
											2016-07-08 14:42:28 +00:00
										 |  |  |   logical*1 bShMsgs
 | 
					
						
							| 
									
										
										
										
											2015-11-18 01:28:12 +00:00
										 |  |  |   real dat(30*12000)
 | 
					
						
							|  |  |  |   complex cdat(262145),cdat2(262145)
 | 
					
						
							|  |  |  |   real psavg(450)
 | 
					
						
							| 
									
										
										
										
											2016-07-29 16:10:55 +00:00
										 |  |  |   logical pick,first
 | 
					
						
							| 
									
										
										
										
											2015-11-18 01:28:12 +00:00
										 |  |  |   character*6 cfile6
 | 
					
						
							| 
									
										
										
										
											2016-06-08 21:25:11 +00:00
										 |  |  |   character*80 line(100)
 | 
					
						
							| 
									
										
										
										
											2016-07-07 20:15:01 +00:00
										 |  |  |   character*12 mycall_12,hiscall_12
 | 
					
						
							|  |  |  |   character*6 mycall,hiscall
 | 
					
						
							| 
									
										
										
										
											2016-09-17 13:34:40 +00:00
										 |  |  |   data first/.true./,nutca/0/,nutcb/0/
 | 
					
						
							|  |  |  |   save npts,cdat,cdat2,id2a,id2b,nutca,nutcb
 | 
					
						
							| 
									
										
										
										
											2016-07-29 16:10:55 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |   if(first) then
 | 
					
						
							|  |  |  |      id2a=0
 | 
					
						
							|  |  |  |      id2b=0
 | 
					
						
							|  |  |  |      first=.false.
 | 
					
						
							|  |  |  |   endif
 | 
					
						
							| 
									
										
										
										
											2015-11-18 01:28:12 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-07 20:15:01 +00:00
										 |  |  |   mycall=mycall_12(1:6)
 | 
					
						
							|  |  |  |   hiscall=hiscall_12(1:6)
 | 
					
						
							| 
									
										
										
										
											2015-11-18 01:28:12 +00:00
										 |  |  |   nutc=narg(0)
 | 
					
						
							|  |  |  |   ndat0=narg(1)
 | 
					
						
							|  |  |  |   nsubmode=narg(2)
 | 
					
						
							|  |  |  |   newdat=narg(3)
 | 
					
						
							|  |  |  |   minsync=narg(4)
 | 
					
						
							|  |  |  |   npick=narg(5)
 | 
					
						
							|  |  |  |   t0=0.001*narg(6)
 | 
					
						
							|  |  |  |   t1=0.001*narg(7)
 | 
					
						
							| 
									
										
										
										
											2016-09-17 13:34:40 +00:00
										 |  |  |   tmid=0.5*(t0+t1)
 | 
					
						
							| 
									
										
										
										
											2015-11-18 01:28:12 +00:00
										 |  |  |   maxlines=narg(8)
 | 
					
						
							|  |  |  |   nmode=narg(9)
 | 
					
						
							| 
									
										
										
										
											2016-01-22 16:42:44 +00:00
										 |  |  |   nrxfreq=narg(10)
 | 
					
						
							|  |  |  |   ntol=narg(11)
 | 
					
						
							|  |  |  |   nhashcalls=narg(12)
 | 
					
						
							| 
									
										
										
										
											2015-11-18 01:28:12 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-29 16:10:55 +00:00
										 |  |  |   line(1:100)(1:1)=char(0)
 | 
					
						
							|  |  |  |   if(t0.gt.float(ntrperiod)) go to 900
 | 
					
						
							| 
									
										
										
										
											2016-07-30 19:06:19 +00:00
										 |  |  |   if(t0.gt.t1) go to 900
 | 
					
						
							| 
									
										
										
										
											2016-07-29 16:10:55 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-11-18 01:28:12 +00:00
										 |  |  |   if(nmode.eq.102) then
 | 
					
						
							|  |  |  |      call fast9(id2,narg,line)
 | 
					
						
							|  |  |  |      go to 900
 | 
					
						
							| 
									
										
										
										
											2016-06-03 15:45:54 +00:00
										 |  |  |   else if(nmode.eq.104) then
 | 
					
						
							| 
									
										
										
										
											2016-09-17 13:34:40 +00:00
										 |  |  | ! MSK144 mode
 | 
					
						
							| 
									
										
										
										
											2016-07-29 16:10:55 +00:00
										 |  |  |      if(newdat.eq.1) then
 | 
					
						
							| 
									
										
										
										
											2016-09-17 13:34:40 +00:00
										 |  |  |         id2b=id2a                     !Data for lower panel
 | 
					
						
							|  |  |  |         id2a=id2                      !Data for upper panel
 | 
					
						
							|  |  |  |         nutcb=nutca
 | 
					
						
							|  |  |  |         nutca=nutc
 | 
					
						
							| 
									
										
										
										
											2016-07-29 16:10:55 +00:00
										 |  |  |      endif
 | 
					
						
							| 
									
										
										
										
											2016-07-14 17:06:52 +00:00
										 |  |  |      ia=max(1,nint(t0*12000.0))
 | 
					
						
							| 
									
										
										
										
											2016-07-30 19:06:19 +00:00
										 |  |  |      ib=nint(t1*12000.0)
 | 
					
						
							|  |  |  |      if(ib.gt.ntrperiod*12000) ib=ntrperiod*12000
 | 
					
						
							| 
									
										
										
										
											2016-07-14 17:06:52 +00:00
										 |  |  |      nz=ib-ia+1
 | 
					
						
							| 
									
										
										
										
											2016-09-17 13:34:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |      if(newdat.eq.1) then
 | 
					
						
							|  |  |  | ! Full sequence of new data
 | 
					
						
							|  |  |  |         call msk144_decode(id2a(ia),nz,nutca,0,mycall,hiscall,   &
 | 
					
						
							|  |  |  |              bShMsgs,ntol,t0,line)
 | 
					
						
							|  |  |  |         go to 100
 | 
					
						
							|  |  |  |      endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |      if(npick.eq.1) then
 | 
					
						
							|  |  |  | ! Pick-decode from upper panel
 | 
					
						
							| 
									
										
										
										
											2016-09-01 21:50:52 +00:00
										 |  |  |         call msk144_decode(id2(ia),nz,nutc,0,mycall,hiscall,   &
 | 
					
						
							| 
									
										
										
										
											2016-07-29 16:10:55 +00:00
										 |  |  |              bShMsgs,ntol,t0,line)
 | 
					
						
							| 
									
										
										
										
											2016-09-17 13:34:40 +00:00
										 |  |  |         go to 100
 | 
					
						
							|  |  |  |      endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |      if(npick.eq.2) then
 | 
					
						
							| 
									
										
										
										
											2016-09-15 19:23:30 +00:00
										 |  |  | ! Pick-decode from lower panel
 | 
					
						
							| 
									
										
										
										
											2016-09-17 13:34:40 +00:00
										 |  |  | !        write(*,3001) newdat,npick,nutca
 | 
					
						
							|  |  |  |         call msk144_decode(id2b(ia),nz,nutca,0,mycall,hiscall,   &
 | 
					
						
							| 
									
										
										
										
											2016-07-29 16:10:55 +00:00
										 |  |  |              bShMsgs,ntol,t0,line)
 | 
					
						
							|  |  |  |      endif
 | 
					
						
							| 
									
										
										
										
											2016-09-17 13:34:40 +00:00
										 |  |  | 100  continue
 | 
					
						
							| 
									
										
										
										
											2016-06-03 15:45:54 +00:00
										 |  |  |      go to 900
 | 
					
						
							| 
									
										
										
										
											2016-09-17 13:34:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-11-18 01:28:12 +00:00
										 |  |  |   endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   if(newdat.eq.1) then
 | 
					
						
							|  |  |  |      cdat2=cdat
 | 
					
						
							|  |  |  |      ndat=ndat0
 | 
					
						
							|  |  |  |      call wav11(id2,ndat,dat)
 | 
					
						
							| 
									
										
										
										
											2016-10-16 17:36:00 +00:00
										 |  |  |      nzz=11025*ntrperiod
 | 
					
						
							| 
									
										
										
										
											2016-10-18 20:17:56 +00:00
										 |  |  |      if(ndat.lt.nzz) dat(ndat+1:nzz)=0.0
 | 
					
						
							| 
									
										
										
										
											2015-11-18 01:28:12 +00:00
										 |  |  |      ndat=min(ndat,30*11025)
 | 
					
						
							|  |  |  |      call ana932(dat,ndat,cdat,npts)          !Make downsampled analytic signal
 | 
					
						
							|  |  |  |   endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ! Now cdat() is the downsampled analytic signal.  
 | 
					
						
							|  |  |  | ! New sample rate = fsample = BW = 11025 * (9/32) = 3100.78125 Hz
 | 
					
						
							|  |  |  | ! NB: npts, nsps, etc., are all reduced by 9/32
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   write(cfile6,'(i6.6)') nutc
 | 
					
						
							|  |  |  |   nfreeze=1
 | 
					
						
							|  |  |  |   mousedf=0
 | 
					
						
							|  |  |  |   mousebutton=0
 | 
					
						
							|  |  |  |   mode4=1
 | 
					
						
							|  |  |  |   if(nsubmode.eq.1) mode4=2
 | 
					
						
							|  |  |  |   nafc=0
 | 
					
						
							|  |  |  |   ndebug=0
 | 
					
						
							|  |  |  |   t2=0.
 | 
					
						
							|  |  |  |   ia=1
 | 
					
						
							|  |  |  |   ib=npts
 | 
					
						
							|  |  |  |   pick=.false.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   if(npick.gt.0) then
 | 
					
						
							|  |  |  |      pick=.true.
 | 
					
						
							|  |  |  |      dt=1.0/11025.0 * (32.0/9.0)
 | 
					
						
							|  |  |  |      ia=t0/dt + 1.
 | 
					
						
							|  |  |  |      ib=t1/dt + 1.
 | 
					
						
							|  |  |  |      t2=t0
 | 
					
						
							|  |  |  |   endif
 | 
					
						
							|  |  |  |   jz=ib-ia+1
 | 
					
						
							|  |  |  |   line(1:100)(1:1)=char(0)
 | 
					
						
							|  |  |  |   if(npick.eq.2) then
 | 
					
						
							|  |  |  |      call iscat(cdat2(ia),jz,3,40,t2,pick,cfile6,minsync,ntol,NFreeze,    &
 | 
					
						
							|  |  |  |           MouseDF,mousebutton,mode4,nafc,ndebug,psavg,nmax,nlines,line)
 | 
					
						
							|  |  |  |   else
 | 
					
						
							|  |  |  |      call iscat(cdat(ia),jz,3,40,t2,pick,cfile6,minsync,ntol,NFreeze,     &
 | 
					
						
							|  |  |  |           MouseDF,mousebutton,mode4,nafc,ndebug,psavg,maxlines,nlines,line)
 | 
					
						
							|  |  |  |   endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 900 return
 | 
					
						
							|  |  |  | end subroutine fast_decode
 |