2018-03-24 07:20:34 -04:00
|
|
|
program ft8d
|
|
|
|
|
2018-03-31 04:02:18 -04:00
|
|
|
! Decode FT8 data read from *.c2 files.
|
2018-03-24 07:20:34 -04:00
|
|
|
|
|
|
|
include 'ft8_params.f90'
|
2018-10-20 05:12:27 -04:00
|
|
|
character infile*80,date*6,time*4
|
2018-10-18 08:34:24 -04:00
|
|
|
character msgcall*6,msggrid*4
|
2018-04-01 11:36:02 -04:00
|
|
|
real s(NFFT1,NHSYM)
|
|
|
|
real sbase(NFFT1)
|
2018-03-24 12:00:48 -04:00
|
|
|
real candidate(3,200)
|
2018-04-01 11:36:02 -04:00
|
|
|
real*8 dialfreq
|
2018-04-02 16:29:55 -04:00
|
|
|
complex dd(NMAX,4)
|
2018-04-19 16:09:02 -04:00
|
|
|
logical newdat
|
2018-03-24 12:00:48 -04:00
|
|
|
integer apsym(KK)
|
2018-03-24 07:20:34 -04:00
|
|
|
|
|
|
|
nargs=iargc()
|
2018-04-02 16:29:55 -04:00
|
|
|
if(nargs.ne.1) then
|
|
|
|
print*,'Usage: ft8d file'
|
2018-03-24 12:06:33 -04:00
|
|
|
go to 999
|
2018-03-24 07:20:34 -04:00
|
|
|
endif
|
|
|
|
|
|
|
|
twopi=8.0*atan(1.0)
|
2018-04-01 16:08:21 -04:00
|
|
|
fs=4000.0 !Sample rate
|
2018-03-24 07:20:34 -04:00
|
|
|
dt=1.0/fs !Sample interval (s)
|
|
|
|
tt=NSPS*dt !Duration of "itone" symbols (s)
|
|
|
|
ts=2*NSPS*dt !Duration of OQPSK symbols (s)
|
|
|
|
baud=1.0/tt !Keying rate (baud)
|
|
|
|
txt=NZ*dt !Transmission length (s)
|
2018-04-01 16:08:21 -04:00
|
|
|
nfa=-1600
|
|
|
|
nfb=+1600
|
2018-04-01 11:36:02 -04:00
|
|
|
nfqso=0
|
2018-03-24 07:20:34 -04:00
|
|
|
|
2018-04-02 16:29:55 -04:00
|
|
|
call getarg(1,infile)
|
|
|
|
open(10,file=infile,status='old',access='stream')
|
|
|
|
read(10,end=999) dialfreq,dd
|
|
|
|
close(10)
|
|
|
|
j2=index(infile,'.c2')
|
2018-10-20 15:32:04 -04:00
|
|
|
date=infile(j2-11:j2-6)
|
|
|
|
time=infile(j2-4:j2-1)
|
2018-04-02 16:29:55 -04:00
|
|
|
do ipart=1,4
|
2018-03-24 12:06:33 -04:00
|
|
|
ndecodes=0
|
2018-03-26 02:37:27 -04:00
|
|
|
ndepth=1
|
2018-04-19 10:49:30 -04:00
|
|
|
newdat=.true.
|
|
|
|
syncmin=1.5
|
|
|
|
call sync8(dd(1:NMAX,ipart),nfa+2000,nfb+2000,syncmin, &
|
|
|
|
nfqso+2000,s,candidate,ncand,sbase)
|
|
|
|
do icand=1,ncand
|
|
|
|
sync=candidate(3,icand)
|
|
|
|
f1=candidate(1,icand)
|
|
|
|
xdt=candidate(2,icand)
|
|
|
|
xbase=10.0**(0.1*(sbase(nint(f1/3.125))-40.0))
|
|
|
|
call ft8b(dd(1:NMAX,ipart),newdat,nQSOProgress,nfqso+2000, &
|
|
|
|
nftx,ndepth,lft8apon,lapcqonly,napwid,nagain,iaptype, &
|
|
|
|
f1,xdt,xbase,apsym,nharderrors,dmin,nbadcrc,iappass, &
|
2018-04-19 16:09:02 -04:00
|
|
|
msgcall,msggrid,xsnr)
|
2018-04-19 10:49:30 -04:00
|
|
|
nsnr=nint(xsnr)
|
|
|
|
xdt=xdt-0.5
|
|
|
|
hd=nharderrors+dmin
|
2018-04-19 16:09:02 -04:00
|
|
|
if(nbadcrc.eq.0) then
|
2018-10-20 05:12:27 -04:00
|
|
|
write(*,1004) date,time,15*(ipart-1),min(sync,999.0),nint(xsnr), &
|
2018-04-19 16:09:02 -04:00
|
|
|
xdt,nint(f1-2000+dialfreq),msgcall,msggrid
|
2018-10-20 05:12:27 -04:00
|
|
|
1004 format(a6,1x,a4,i2.2,f6.1,i4,f6.2,i9,1x,a6,1x,a4)
|
2018-03-24 12:06:33 -04:00
|
|
|
endif
|
|
|
|
enddo
|
2018-04-02 16:29:55 -04:00
|
|
|
enddo ! ipart loop
|
2018-03-24 07:20:34 -04:00
|
|
|
|
|
|
|
999 end program ft8d
|
|
|
|
|