diff options
Diffstat (limited to 'lib/ft8')
| -rw-r--r-- | lib/ft8/compress.f90 | 1 | ||||
| -rw-r--r-- | lib/ft8/foxgen.f90 | 2 | ||||
| -rw-r--r-- | lib/ft8/ft8_a7.f90 | 11 | ||||
| -rw-r--r-- | lib/ft8/ft8_a8_test.f90 | 2 | ||||
| -rw-r--r-- | lib/ft8/ft8_a8d.f90 | 6 | ||||
| -rw-r--r-- | lib/ft8/ft8b.f90 | 13 | ||||
| -rw-r--r-- | lib/ft8/ft8c.f90 | 7 | ||||
| -rw-r--r-- | lib/ft8/ft8sim.f90 | 13 | ||||
| -rw-r--r-- | lib/ft8/genft8.f90 | 8 | ||||
| -rw-r--r-- | lib/ft8/ldpcsim174_91.f90 | 2 | ||||
| -rw-r--r-- | lib/ft8/sync8.f90 | 4 |
11 files changed, 49 insertions, 20 deletions
diff --git a/lib/ft8/compress.f90 b/lib/ft8/compress.f90 index 683fc4d8..ece1d3ef 100644 --- a/lib/ft8/compress.f90 +++ b/lib/ft8/compress.f90 @@ -3,6 +3,7 @@ subroutine compress(c) parameter (NMAX=15*12000) !Samples in iwave (180,000) complex c(0:NMAX-1) real xr(0:NMAX-1),xi(0:NMAX-1) + save xr,xi xr=real(c) call wavestats(xr,NMAX,rms,pk,pwr_pk,pwr_ave) diff --git a/lib/ft8/foxgen.f90 b/lib/ft8/foxgen.f90 index 89383e71..0d50761a 100644 --- a/lib/ft8/foxgen.f90 +++ b/lib/ft8/foxgen.f90 @@ -38,7 +38,7 @@ subroutine foxgen(bSuperFox,fname) n=nslots if(bMoreCQs) cmsg(1)(40:40)='1' !Set flag to include a CQ if(bSendMsg) then - n=min(nslots+1,3) + n=min(nslots+1,5) cmsg(n)=textMsg cmsg(n)(39:39)='1' !Set flag for text message nslots=n diff --git a/lib/ft8/ft8_a7.f90 b/lib/ft8/ft8_a7.f90 index 7c7f0288..09a3837f 100644 --- a/lib/ft8/ft8_a7.f90 +++ b/lib/ft8/ft8_a7.f90 @@ -211,8 +211,11 @@ subroutine ft8_a7d(dd0,newdat,call_1,call_2,grid4,xdt,f1,xbase,nharderrors,dmin, nt=2**(3*nsym) do ihalf=1,2 do k=1,29,nsym - if(ihalf.eq.1) ks=k+7 - if(ihalf.eq.2) ks=k+43 + if(ihalf.eq.1) then + ks=k+7 + else + ks=k+43 + endif amax=-1.0 do i=0,nt-1 i1=i/64 @@ -364,9 +367,9 @@ subroutine ft8_a7d(dd0,newdat,call_1,call_2,grid4,xdt,f1,xbase,nharderrors,dmin, xsnr=-25. arg=pbest/xbase/3.0e6-1.0 if(arg.gt.0.0) xsnr=max(-25.0,db(arg)-27.0) -! write(41,3041) nharderrors,dmin,dmin2,dmin2/dmin,xsnr,trim(msgbest) +! write(41,3041) nharderrors,dmin,dmin2,dmin2/(dmin+1e-6),xsnr,trim(msgbest) !3041 format(i3,2f7.1,f7.2,f7.1,1x,a) - if(dmin.gt.100.0 .or. dmin2/dmin.lt.1.3) nharderrors=-1 + if(dmin.gt.100.0 .or. dmin2/(dmin+1e-6).lt.1.3) nharderrors=-1 msg37=msgbest if(msg37(1:3).eq.'CQ ' .and. std_2 .and. grid4.eq.' ') nharderrors=-1 if(msg37(1:6).eq.'QU1RK ') nharderrors=-1 diff --git a/lib/ft8/ft8_a8_test.f90 b/lib/ft8/ft8_a8_test.f90 index 50ebc5c2..33d5b91a 100644 --- a/lib/ft8/ft8_a8_test.f90 +++ b/lib/ft8/ft8_a8_test.f90 @@ -35,7 +35,7 @@ program ft8_a8_test fac=1.0/32767.0 dd=fac*iwave - call ft8_a8d(dd,mycall,dxcall,dxgrid,f1,xdt,fbest,xsnr,plog,msgbest) + call ft8_a8d(dd,mycall,dxcall,dxgrid,f1,xdt,fbest,xsnr,plog,msgbest,0) apflag=' a8' if(plog.lt.-155) apflag(1:1)='?' diff --git a/lib/ft8/ft8_a8d.f90 b/lib/ft8/ft8_a8d.f90 index 3fb1a073..5d05fef1 100644 --- a/lib/ft8/ft8_a8d.f90 +++ b/lib/ft8/ft8_a8d.f90 @@ -1,4 +1,5 @@ -subroutine ft8_a8d(dd,mycall,dxcall,dxgrid,f1a,xdt,fbest,xsnr,plog,msgbest) +subroutine ft8_a8d(dd,mycall,dxcall,dxgrid,f1a,xdt,fbest,xsnr,plog,msgbest, & + progress_generation) ! List decoding for FT8, activated only at nfqso (Rx Freq) +/- 10 Hz and when ! DxCall and DxGrid are populated. Returns xdt, fbest, and msgbest. @@ -6,6 +7,7 @@ subroutine ft8_a8d(dd,mycall,dxcall,dxgrid,f1a,xdt,fbest,xsnr,plog,msgbest) use packjt77 use ft8_a7 use timer_module, only: timer + use decode_completion_module, only: write_decode_progress include 'ft8_params.f90' !Set various constants parameter (NWAVE=NN*NSPS/NDOWN) !Length of generated cwave = 2528 parameter (NZZ=3200) !Length of downsampled arrays @@ -30,6 +32,7 @@ subroutine ft8_a8d(dd,mycall,dxcall,dxgrid,f1a,xdt,fbest,xsnr,plog,msgbest) complex csymb(0:31) integer itone(NN) integer itone_best(NN) + integer, intent(in) :: progress_generation integer ipk(1) logical newdat @@ -54,6 +57,7 @@ subroutine ft8_a8d(dd,mycall,dxcall,dxgrid,f1a,xdt,fbest,xsnr,plog,msgbest) msgbest='' itone_best=0 do imsg=1,NMSGS + call write_decode_progress(progress_generation) call getmsg(imsg,mycall,dxcall,dxgrid,msg) ! Source-encode the message, get itone(), and generate complex FT8 waveform. diff --git a/lib/ft8/ft8b.f90 b/lib/ft8/ft8b.f90 index 43ac33bf..8934e399 100644 --- a/lib/ft8/ft8b.f90 +++ b/lib/ft8/ft8b.f90 @@ -187,8 +187,11 @@ subroutine ft8b(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,nzhsym,lapon, & nt=2**(3*nsym) do ihalf=1,2 do k=1,29,nsym - if(ihalf.eq.1) ks=k+7 - if(ihalf.eq.2) ks=k+43 + if(ihalf.eq.1) then + ks=k+7 + else + ks=k+43 + endif amax=-1.0 do i=0,nt-1 i1=i/64 @@ -204,7 +207,7 @@ subroutine ft8b(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,nzhsym,lapon, & print*,"Error - nsym must be 1, 2, or 3." endif enddo - if(imetric.eq.2) s2=s2**2 + if(imetric.eq.2) s2(0:nt-1)=s2(0:nt-1)**2 i32=1+(k-1)*3+(ihalf-1)*87 if(nsym.eq.1) ibmax=2 if(nsym.eq.2) ibmax=5 @@ -432,12 +435,12 @@ subroutine ft8b(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,nzhsym,lapon, & (abs(nfqso-f1).le.napwid .or. abs(nftx-f1).le.napwid .or. ncontest.eq.7)) then maxosd=2 endif - call timer('dec174_91 ',0) + call timer('dec174_9',0) Keff=91 call decode174_91(llrz,Keff,maxosd,norder,apmask,message91,cw, & ntype,nharderrors,dmin) if(nharderrors.ge.0) message77=message91(1:77) - call timer('dec174_91 ',1) + call timer('dec174_9',1) msg37=' ' nbadcrc=1 diff --git a/lib/ft8/ft8c.f90 b/lib/ft8/ft8c.f90 index a7d1ccb9..4e2e8d72 100644 --- a/lib/ft8/ft8c.f90 +++ b/lib/ft8/ft8c.f90 @@ -136,8 +136,11 @@ subroutine ft8c(dd0,newdat,call_1,call_2,grid4,xdt,f1,nharderrors,dmin, & nt=2**(3*nsym) do ihalf=1,2 do k=1,29,nsym - if(ihalf.eq.1) ks=k+7 - if(ihalf.eq.2) ks=k+43 + if(ihalf.eq.1) then + ks=k+7 + else + ks=k+43 + endif amax=-1.0 do i=0,nt-1 i1=i/64 diff --git a/lib/ft8/ft8sim.f90 b/lib/ft8/ft8sim.f90 index 4897814b..2ee9bd5d 100644 --- a/lib/ft8/ft8sim.f90 +++ b/lib/ft8/ft8sim.f90 @@ -5,12 +5,15 @@ program ft8sim_gfsk use wavhdr use packjt77 + use, intrinsic :: iso_c_binding + include 'ft8_params.f90' !Set various constants parameter (NWAVE=NN*NSPS) type(hdr) h !Header for .wav file character arg*12,fname*17 character msg37*37,msgsent37*37 character c77*77 + character(len=7) :: prog_name='ft8sim'//char(0) complex c0(0:NMAX-1) complex c(0:NMAX-1) complex cwave(0:NWAVE-1) @@ -20,9 +23,17 @@ program ft8sim_gfsk integer*1 msgbits(77) integer*2 iwave(NMAX) !Generated full-length waveform + interface + subroutine print_version(prog_name) bind(C, name='print_version') + use, intrinsic :: iso_c_binding + character(kind=c_char, len=1), intent(in) :: prog_name(*) + end subroutine print_version + end interface + ! Get command-line argument(s) nargs=iargc() if(nargs.ne.7) then + call print_version(prog_name) print*,'Usage: ft8sim "message" f0 DT fdop del nfiles snr' print*,'Examples: ft8sim "K1ABC W9XYZ EN37" 1500.0 0.0 0.5 1.0 10 -18' print*,' ft8sim "K1ABC W9XYZ EN37" 1500.0 0.0 MM 1.0 10 -18' @@ -164,7 +175,7 @@ program ft8sim_gfsk h=default_header(12000,NMAX) write(fname,1102) ifile 1102 format('000000_',i6.6,'.wav') - open(10,file=fname,status='unknown',access='stream') + open(10,file=fname,status='replace',access='stream') write(10) h,iwave !Save to *.wav file close(10) write(*,1110) ifile,xdt,f0,snrdb,fname,snr_2500 diff --git a/lib/ft8/genft8.f90 b/lib/ft8/genft8.f90 index a03c3e58..ce866451 100644 --- a/lib/ft8/genft8.f90 +++ b/lib/ft8/genft8.f90 @@ -16,10 +16,12 @@ subroutine genft8(msg,i3,n3,msgsent,msgbits,itone) i3=-1 n3=-1 - call pack77(msg,i3,n3,c77) - call unpack77(c77,0,msgsent,unpk77_success) + c77=' ' + unpk77_success=.false. + call pack77_legacy_truncating_fallback(msg,i3,n3,c77) + if(i3.ge.0) call unpack77(c77,0,msgsent,unpk77_success) read(c77,'(77i1)',err=1) msgbits - if(unpk77_success) go to 2 + if(i3.ge.0 .and. unpk77_success) go to 2 1 msgbits=0 itone=0 msgsent='*** bad message *** ' diff --git a/lib/ft8/ldpcsim174_91.f90 b/lib/ft8/ldpcsim174_91.f90 index 4e30859a..9a286649 100644 --- a/lib/ft8/ldpcsim174_91.f90 +++ b/lib/ft8/ldpcsim174_91.f90 @@ -75,7 +75,7 @@ program ldpcsim174_91 msg="K9ABC K1ABC FN20" i3=0 n3=1 - call pack77(msg,i3,n3,c77) !Pack into 12 6-bit bytes + call pack77(msg,i3,n3,c77) call unpack77(c77,1,msgsent,unpk77_success) !Unpack to get msgsent write(*,*) "message sent ",msgsent diff --git a/lib/ft8/sync8.f90 b/lib/ft8/sync8.f90 index 57af21a8..b14300ab 100644 --- a/lib/ft8/sync8.f90 +++ b/lib/ft8/sync8.f90 @@ -14,6 +14,7 @@ subroutine sync8(dd,npts,nfa,nfb,syncmin,nfqso,maxcand,candidate,ncand,sbase) real red(NH1) real red2(NH1) real candidate0(3,MAXPRECAND) + real candidate_sync(MAXPRECAND) real candidate(3,maxcand) real dd(npts) integer jpeak(NH1) @@ -151,7 +152,8 @@ subroutine sync8(dd,npts,nfa,nfb,syncmin,nfqso,maxcand,candidate,ncand,sbase) s=fac*s ! Sort by sync - call indexx(candidate0(3,1:ncand),ncand,indx) + candidate_sync(1:ncand)=candidate0(3,1:ncand) + call indexx(candidate_sync,ncand,indx) ! Place candidates within 10 Hz of nfqso at the top of the list k=1 do i=1,ncand |
